From ba13930b32f39c392d1266e67077af2a53b4ea9b Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 13 Aug 2013 17:27:08 +0200 Subject: [PATCH] Fix test include pattern to include *Test.class We missed *Test.class which is not our convention but we could miss some tests. We should better include the *Test.class tests as well. --- pom.xml | 2 ++ ...chmarkTest.java => ChecksumBenchmark.java} | 2 +- ...ncurrentIndexingVersioningStressTest.java} | 3 ++- .../settings/ImmutableSettingsTests.java | 24 +++++++++---------- .../bar/{BarTest.java => BarTestClass.java} | 6 ++--- .../foo/{FooTest.java => FooTestClass.java} | 6 ++--- 6 files changed, 21 insertions(+), 22 deletions(-) rename src/test/java/org/elasticsearch/benchmark/checksum/{ChecksumBenchmarkTest.java => ChecksumBenchmark.java} (98%) rename src/test/java/org/elasticsearch/test/stress/indexing/{ConcurrentIndexingVersioningTest.java => ConcurrentIndexingVersioningStressTest.java} (98%) rename src/test/java/org/elasticsearch/test/unit/common/settings/bar/{BarTest.java => BarTestClass.java} (93%) rename src/test/java/org/elasticsearch/test/unit/common/settings/foo/{FooTest.java => FooTestClass.java} (93%) diff --git a/pom.xml b/pom.xml index db29198331b..9536f052af6 100644 --- a/pom.xml +++ b/pom.xml @@ -356,9 +356,11 @@ **/*Tests.class + **/*Test.class **/Abstract*.class + **/*StressTest.class -Xmx512m diff --git a/src/test/java/org/elasticsearch/benchmark/checksum/ChecksumBenchmarkTest.java b/src/test/java/org/elasticsearch/benchmark/checksum/ChecksumBenchmark.java similarity index 98% rename from src/test/java/org/elasticsearch/benchmark/checksum/ChecksumBenchmarkTest.java rename to src/test/java/org/elasticsearch/benchmark/checksum/ChecksumBenchmark.java index 3d6c95dbff8..ba3b87a4d9c 100644 --- a/src/test/java/org/elasticsearch/benchmark/checksum/ChecksumBenchmarkTest.java +++ b/src/test/java/org/elasticsearch/benchmark/checksum/ChecksumBenchmark.java @@ -29,7 +29,7 @@ import java.util.zip.CRC32; /** * */ -public class ChecksumBenchmarkTest { +public class ChecksumBenchmark { public static final int BATCH_SIZE = 16 * 1024; diff --git a/src/test/java/org/elasticsearch/test/stress/indexing/ConcurrentIndexingVersioningTest.java b/src/test/java/org/elasticsearch/test/stress/indexing/ConcurrentIndexingVersioningStressTest.java similarity index 98% rename from src/test/java/org/elasticsearch/test/stress/indexing/ConcurrentIndexingVersioningTest.java rename to src/test/java/org/elasticsearch/test/stress/indexing/ConcurrentIndexingVersioningStressTest.java index 6afcbb3700b..9bc16dcc817 100644 --- a/src/test/java/org/elasticsearch/test/stress/indexing/ConcurrentIndexingVersioningTest.java +++ b/src/test/java/org/elasticsearch/test/stress/indexing/ConcurrentIndexingVersioningStressTest.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.SizeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.node.Node; +import org.junit.Ignore; import java.util.concurrent.CountDownLatch; @@ -35,7 +36,7 @@ import static org.elasticsearch.node.NodeBuilder.nodeBuilder; /** * Checks that index operation does not create duplicate documents. */ -public class ConcurrentIndexingVersioningTest { +public class ConcurrentIndexingVersioningStressTest { public static void main(String[] args) throws Exception { diff --git a/src/test/java/org/elasticsearch/test/unit/common/settings/ImmutableSettingsTests.java b/src/test/java/org/elasticsearch/test/unit/common/settings/ImmutableSettingsTests.java index c988afcd2e4..905ec8bdd06 100644 --- a/src/test/java/org/elasticsearch/test/unit/common/settings/ImmutableSettingsTests.java +++ b/src/test/java/org/elasticsearch/test/unit/common/settings/ImmutableSettingsTests.java @@ -21,17 +21,17 @@ package org.elasticsearch.test.unit.common.settings; import org.elasticsearch.common.settings.NoClassSettingsException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.unit.common.settings.bar.BarTest; -import org.elasticsearch.test.unit.common.settings.foo.FooTest; +import org.elasticsearch.test.integration.ElasticsearchTestCase; +import org.elasticsearch.test.unit.common.settings.bar.BarTestClass; +import org.elasticsearch.test.unit.common.settings.foo.FooTestClass; import org.junit.Test; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** */ -public class ImmutableSettingsTests { +public class ImmutableSettingsTests extends ElasticsearchTestCase{ @Test public void testGetAsClass() { @@ -41,24 +41,24 @@ public class ImmutableSettingsTests { .build(); // Assert that defaultClazz is loaded if setting is not specified - assertThat(settings.getAsClass("no.settings", FooTest.class, "org.elasticsearch.test.unit.common.settings.", "Test").getName(), - equalTo(FooTest.class.getName())); + assertThat(settings.getAsClass("no.settings", FooTestClass.class, "org.elasticsearch.test.unit.common.settings.", "TestClass").getName(), + equalTo(FooTestClass.class.getName())); // Assert that correct class is loaded if setting contain name without package - assertThat(settings.getAsClass("test.class", FooTest.class, "org.elasticsearch.test.unit.common.settings.", "Test").getName(), - equalTo(BarTest.class.getName())); + assertThat(settings.getAsClass("test.class", FooTestClass.class, "org.elasticsearch.test.unit.common.settings.", "TestClass").getName(), + equalTo(BarTestClass.class.getName())); // Assert that class cannot be loaded if wrong packagePrefix is specified try { - settings.getAsClass("test.class", FooTest.class, "com.example.elasticsearch.test.unit..common.settings.", "Test"); - assertThat("Class with wrong package name shouldn't be loaded", false); + settings.getAsClass("test.class", FooTestClass.class, "com.example.elasticsearch.test.unit..common.settings.", "TestClass"); + fail("Class with wrong package name shouldn't be loaded"); } catch (NoClassSettingsException ex) { // Ignore } // Assert that package name in settings is getting correctly applied - assertThat(settings.getAsClass("test.class.package", FooTest.class, "com.example.elasticsearch.test.unit.common.settings.", "Test").getName(), - equalTo(BarTest.class.getName())); + assertThat(settings.getAsClass("test.class.package", FooTestClass.class, "com.example.elasticsearch.test.unit.common.settings.", "TestClass").getName(), + equalTo(BarTestClass.class.getName())); } diff --git a/src/test/java/org/elasticsearch/test/unit/common/settings/bar/BarTest.java b/src/test/java/org/elasticsearch/test/unit/common/settings/bar/BarTestClass.java similarity index 93% rename from src/test/java/org/elasticsearch/test/unit/common/settings/bar/BarTest.java rename to src/test/java/org/elasticsearch/test/unit/common/settings/bar/BarTestClass.java index 7807a467029..3e61f947d46 100644 --- a/src/test/java/org/elasticsearch/test/unit/common/settings/bar/BarTest.java +++ b/src/test/java/org/elasticsearch/test/unit/common/settings/bar/BarTestClass.java @@ -19,8 +19,6 @@ package org.elasticsearch.test.unit.common.settings.bar; -/** - * - */ -public class BarTest { +//used in ImmutableSettingsTest +public class BarTestClass { } diff --git a/src/test/java/org/elasticsearch/test/unit/common/settings/foo/FooTest.java b/src/test/java/org/elasticsearch/test/unit/common/settings/foo/FooTestClass.java similarity index 93% rename from src/test/java/org/elasticsearch/test/unit/common/settings/foo/FooTest.java rename to src/test/java/org/elasticsearch/test/unit/common/settings/foo/FooTestClass.java index af6bd3eb008..6a4fe62e23a 100644 --- a/src/test/java/org/elasticsearch/test/unit/common/settings/foo/FooTest.java +++ b/src/test/java/org/elasticsearch/test/unit/common/settings/foo/FooTestClass.java @@ -19,8 +19,6 @@ package org.elasticsearch.test.unit.common.settings.foo; -/** - * - */ -public class FooTest { +// used in ImmutableSettingsTest +public class FooTestClass { }