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.
This commit is contained in:
parent
7e1d8a6ca3
commit
ba13930b32
2
pom.xml
2
pom.xml
|
@ -356,9 +356,11 @@
|
|||
</balancers>
|
||||
<includes>
|
||||
<include>**/*Tests.class</include>
|
||||
<include>**/*Test.class</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/Abstract*.class</exclude>
|
||||
<exclude>**/*StressTest.class</exclude>
|
||||
</excludes>
|
||||
<jvmArgs>
|
||||
<param>-Xmx512m</param>
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.zip.CRC32;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public class ChecksumBenchmarkTest {
|
||||
public class ChecksumBenchmark {
|
||||
|
||||
public static final int BATCH_SIZE = 16 * 1024;
|
||||
|
|
@ -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 {
|
||||
|
|
@ -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()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.elasticsearch.test.unit.common.settings.bar;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BarTest {
|
||||
//used in ImmutableSettingsTest
|
||||
public class BarTestClass {
|
||||
}
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.elasticsearch.test.unit.common.settings.foo;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class FooTest {
|
||||
// used in ImmutableSettingsTest
|
||||
public class FooTestClass {
|
||||
}
|
Loading…
Reference in New Issue