From 985d66ce3cb42a91af227d6ece118bcbfc1c9b4d Mon Sep 17 00:00:00 2001 From: Sergey Chugunov Date: Thu, 24 Jan 2019 18:23:25 +0300 Subject: [PATCH] IGNITE-10776 Migrate config variations test suites from JUnit 3 to 4 - Fixes #5781. Signed-off-by: Ilya Kasnacheev --- .../IgnitePdsCompressionTestSuite.java | 16 +- .../IgnitePdsCompressionTestSuite2.java | 16 +- .../IgniteCacheInterceptorSelfTestSuite.java | 57 ++- ...heReadThroughEvictionsVariationsSuite.java | 23 +- .../ConfigVariationsTestSuiteBuilder.java | 190 +++++---- .../testframework/junits/DynamicSuite.java | 64 +++ .../junits/GridAbstractTest.java | 2 +- .../IgniteConfigVariationsAbstractTest.java | 15 +- .../ConfigVariationsTestSuiteBuilderTest.java | 367 +++++++++++++++--- .../IgniteBinaryCacheTestSuite.java | 13 +- .../IgniteBinaryObjectsCacheTestSuite3.java | 17 +- ...BasicConfigVariationsFullApiTestSuite.java | 18 +- ...lockExchangeOnReadOperationsTestSuite.java | 13 +- .../testsuites/IgniteCacheMvccTestSuite1.java | 13 +- .../testsuites/IgniteCacheMvccTestSuite2.java | 13 +- .../testsuites/IgniteCacheMvccTestSuite3.java | 13 +- .../testsuites/IgniteCacheMvccTestSuite4.java | 17 +- .../testsuites/IgniteCacheMvccTestSuite5.java | 13 +- .../testsuites/IgniteCacheMvccTestSuite6.java | 13 +- .../testsuites/IgniteCacheMvccTestSuite7.java | 18 +- .../testsuites/IgniteCacheMvccTestSuite8.java | 17 +- .../testsuites/IgniteCacheMvccTestSuite9.java | 13 +- .../IgniteCacheNearOnlySelfTestSuite.java | 31 +- ...gniteCacheTcpClientDiscoveryTestSuite.java | 13 +- .../testsuites/IgniteCacheTestSuite.java | 65 ++-- .../testsuites/IgniteCacheTestSuite2.java | 57 ++- .../testsuites/IgniteCacheTestSuite3.java | 153 ++++---- .../testsuites/IgniteCacheTestSuite4.java | 13 +- .../testsuites/IgniteCacheTestSuite5.java | 77 ++-- .../testsuites/IgniteCacheTestSuite6.java | 13 +- .../testsuites/IgniteCacheTestSuite7.java | 13 +- .../testsuites/IgniteCacheTestSuite8.java | 13 +- .../testsuites/IgniteCacheTestSuite9.java | 13 +- .../IgniteCacheWriteBehindTestSuite.java | 13 +- ...BasicConfigVariationsFullApiTestSuite.java | 45 +-- ...eContinuousQueryConfigVariationsSuite.java | 86 ++-- ...sagingConfigVariationFullApiTestSuite.java | 45 +-- .../testsuites/IgnitePdsMvccTestSuite.java | 17 +- .../testsuites/IgnitePdsMvccTestSuite2.java | 17 +- .../testsuites/IgnitePdsMvccTestSuite3.java | 13 +- .../testsuites/IgnitePdsMvccTestSuite4.java | 13 +- .../ignite/testsuites/IgnitePdsTestSuite.java | 17 +- .../testsuites/IgnitePdsTestSuite2.java | 17 +- .../testsuites/IgnitePdsTestSuite3.java | 17 +- .../testsuites/IgnitePdsTestSuite4.java | 17 +- .../testsuites/IgniteReproducingSuite.java | 6 +- ...rviceConfigVariationsFullApiTestSuite.java | 78 ++-- ...CacheConfigVariationsFullApiTestSuite.java | 18 +- ...CacheConfigVariationsFullApiTestSuite.java | 70 ++-- .../IgnitePdsNativeIoTestSuite.java | 13 +- .../IgnitePdsNativeIoTestSuite2.java | 13 +- .../hadoop/impl/igfs/IgfsEventsTestSuite.java | 11 +- .../testsuites/IgniteHadoopTestSuite.java | 12 +- .../IgniteIgfsLinuxAndMacOSTestSuite.java | 12 +- ...iteCacheConfigVariationQueryTestSuite.java | 18 +- parent/pom.xml | 7 + 56 files changed, 992 insertions(+), 985 deletions(-) create mode 100644 modules/core/src/test/java/org/apache/ignite/testframework/junits/DynamicSuite.java diff --git a/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite.java b/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite.java index 3cc08b641c908..1e29fa8289f32 100644 --- a/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite.java +++ b/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite.java @@ -24,17 +24,15 @@ import org.apache.ignite.internal.processors.compress.DiskPageCompressionIntegrationAsyncTest; import org.apache.ignite.internal.processors.compress.DiskPageCompressionIntegrationTest; import org.apache.ignite.internal.processors.compress.FileSystemUtilsTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; import static org.apache.ignite.IgniteSystemProperties.IGNITE_DEFAULT_DATA_STORAGE_PAGE_SIZE; import static org.apache.ignite.IgniteSystemProperties.IGNITE_DEFAULT_DISK_PAGE_COMPRESSION; import static org.apache.ignite.configuration.DiskPageCompression.ZSTD; -/** - */ -@RunWith(IgnitePdsCompressionTestSuite.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsCompressionTestSuite { /** * @return Suite. @@ -60,12 +58,4 @@ static void enableCompressionByDefault() { System.setProperty(IGNITE_DEFAULT_DISK_PAGE_COMPRESSION, ZSTD.name()); System.setProperty(IGNITE_DEFAULT_DATA_STORAGE_PAGE_SIZE, String.valueOf(8 * 1024)); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite2.java b/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite2.java index 81e3adfbf3be9..d86f20edc5a34 100644 --- a/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite2.java +++ b/modules/compress/src/test/java/org/apache/ignite/testsuites/IgnitePdsCompressionTestSuite2.java @@ -19,15 +19,13 @@ import java.util.ArrayList; import java.util.List; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; import static org.apache.ignite.testsuites.IgnitePdsCompressionTestSuite.enableCompressionByDefault; -/** - */ -@RunWith(IgnitePdsCompressionTestSuite2.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsCompressionTestSuite2 { /** * @return Suite. @@ -40,12 +38,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java index 57d601a585b11..d3d51593b4f16 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java @@ -21,14 +21,13 @@ import java.util.Collection; import java.util.List; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Cache interceptor suite. */ -@RunWith(IgniteCacheInterceptorSelfTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheInterceptorSelfTestSuite { /** * @return Cache API test suite. @@ -44,45 +43,37 @@ public static List> suite() { public static List> suite(Collection ignoredTests) { List> suite = new ArrayList<>(); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorLocalSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorLocalWithStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorLocalSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorLocalWithStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorLocalAtomicSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorLocalAtomicWithStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorLocalAtomicSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorLocalAtomicWithStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorAtomicSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorAtomicNearEnabledSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorAtomicWithStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorAtomicSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorAtomicNearEnabledSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorAtomicWithStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorAtomicReplicatedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorAtomicWithStoreReplicatedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorAtomicReplicatedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorAtomicWithStoreReplicatedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorNearEnabledSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorWithStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorReplicatedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorReplicatedWithStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorNearEnabledSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorWithStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorReplicatedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorReplicatedWithStoreSelfTest.class, ignoredTests); // TODO GG-11141. -// GridTestUtils.addTestIfNeeded(suite,GridCacheOnCopyFlagTxPartitionedSelfTest.class, ignoredTests); -// GridTestUtils.addTestIfNeeded(suite,GridCacheOnCopyFlagReplicatedSelfTest.class, ignoredTests); -// GridTestUtils.addTestIfNeeded(suite,GridCacheOnCopyFlagLocalSelfTest.class, ignoredTests); -// GridTestUtils.addTestIfNeeded(suite,GridCacheOnCopyFlagAtomicSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheOnCopyFlagTxPartitionedSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheOnCopyFlagReplicatedSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheOnCopyFlagLocalSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheOnCopyFlagAtomicSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheInterceptorPartitionCounterRandomOperationsTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheInterceptorPartitionCounterLocalSanityTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheInterceptorPartitionCounterRandomOperationsTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheInterceptorPartitionCounterLocalSanityTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorAtomicRebalanceTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheInterceptorTransactionalRebalanceTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorAtomicRebalanceTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheInterceptorTransactionalRebalanceTest.class, ignoredTests); return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java index e17c60e384784..c180ea66f2265 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java @@ -17,26 +17,20 @@ package org.apache.ignite.internal.processors.cache; -import junit.framework.TestSuite; +import java.util.List; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; -/** - * - */ -@RunWith(AllTests.class) +/** */ +@RunWith(DynamicSuite.class) public class IgniteCacheReadThroughEvictionsVariationsSuite { - /** - * @return Cache API test suite. - */ - public static TestSuite suite() { - return new ConfigVariationsTestSuiteBuilder( - "Cache Read Through Variations Test", - IgniteCacheReadThroughEvictionSelfTest.class) + /** */ + public static List> suite() { + return new ConfigVariationsTestSuiteBuilder(IgniteCacheReadThroughEvictionSelfTest.class) .withBasicCacheParams() .withIgniteConfigFilters(new IgnitePredicate() { /** {@inheritDoc} */ @@ -54,7 +48,6 @@ public static TestSuite suite() { .skipWaitPartitionMapExchange() .gridsCount(4).backups(1) .testedNodesCount(2).withClients() - .build(); + .classes(); } - } diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java index 284bb2f5db32b..a8b3b44227665 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java @@ -17,10 +17,23 @@ package org.apache.ignite.testframework.configvariations; +import java.util.ArrayList; import java.util.Arrays; -import junit.framework.JUnit4TestAdapter; -import junit.framework.TestResult; -import junit.framework.TestSuite; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import javassist.ClassClassPath; +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtMethod; +import javassist.CtNewMethod; +import javassist.bytecode.AnnotationsAttribute; +import javassist.bytecode.ClassFile; +import javassist.bytecode.ConstPool; +import javassist.bytecode.annotation.Annotation; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.testframework.junits.IgniteCacheConfigVariationsAbstractTest; @@ -33,7 +46,10 @@ */ public class ConfigVariationsTestSuiteBuilder { /** */ - private final TestSuite suite; + private static final AtomicInteger cntr = new AtomicInteger(0); + + /** */ + private static final Map cfgs = new ConcurrentHashMap<>(); /** */ private ConfigParameter[][] igniteParams = @@ -76,27 +92,31 @@ public class ConfigVariationsTestSuiteBuilder { private boolean skipWaitPartMapExchange; /** - * @param name Name. * @param cls Test class. */ - public ConfigVariationsTestSuiteBuilder(String name, Class cls) { - suite = new TestSuite(name); + public ConfigVariationsTestSuiteBuilder(Class cls) { this.cls = cls; } + /** Invoked by reflection in {@link #makeTestClass(String, VariationsTestsConfig)}. */ + @SuppressWarnings("unused") + public static VariationsTestsConfig getCfg(String key) { + return cfgs.get(key); + } + /** - * @return Test suite. + * Returns lists of test classes to execute with config variations. + * + * @return List of classes. */ - public TestSuite build() { + public List> classes() { assert testedNodeCnt > 0; assert gridsCnt > 0; - VariationsIterator igniteCfgIter; + VariationsIterator igniteCfgIter = specificIgniteParam == null ? new VariationsIterator(igniteParams) + : new OneElementVariationsIterator(specificIgniteParam, igniteParams); - if (specificIgniteParam == null) - igniteCfgIter = new VariationsIterator(igniteParams); - else - igniteCfgIter = new OneElementVariationsIterator(specificIgniteParam, igniteParams); + final List cfgsToTest = new ArrayList<>(); for (; igniteCfgIter.hasNext(); ) { final int[] igniteCfgVariation = igniteCfgIter.next(); @@ -105,35 +125,29 @@ public TestSuite build() { continue; if (cacheParams == null) { - TestSuite addedSuite = build(igniteCfgVariation, null, true); - - suite.addTest(addedSuite); + cfgsToTest.addAll(build(igniteCfgVariation, null, true)); + continue; } - else { - VariationsIterator cacheCfgIter; - - if (specificCacheParam == null) - cacheCfgIter = new VariationsIterator(cacheParams); - else - cacheCfgIter = new OneElementVariationsIterator(specificCacheParam, cacheParams); - for (; cacheCfgIter.hasNext(); ) { - int[] cacheCfgVariation = cacheCfgIter.next(); + VariationsIterator cacheCfgIter = specificCacheParam == null ? new VariationsIterator(cacheParams) + : new OneElementVariationsIterator(specificCacheParam, cacheParams); - if (!passCacheConfigFilter(cacheCfgVariation)) - continue; + for (; cacheCfgIter.hasNext(); ) { + int[] cacheCfgVariation = cacheCfgIter.next(); - // Stop all grids before starting new ignite configuration. - boolean stopNodes = !cacheCfgIter.hasNext(); + if (!passCacheConfigFilter(cacheCfgVariation)) + continue; - TestSuite addedSuite = build(igniteCfgVariation, cacheCfgVariation, stopNodes); + // Stop all grids before starting new ignite configuration. + boolean stopNodes = !cacheCfgIter.hasNext(); - suite.addTest(addedSuite); - } + cfgsToTest.addAll(build(igniteCfgVariation, cacheCfgVariation, stopNodes)); } } - return suite; + String pkg = "org.apache.ignite.testframework.configvariations.generated"; + + return cfgsToTest.stream().map(cfg -> makeTestClass(pkg, cfg)).collect(Collectors.toList()); } /** @@ -178,9 +192,10 @@ private boolean passCacheConfigFilter(int[] variation) { * @param igniteCfgVariation Ignite Variation. * @param cacheCfgVariation Cache Variation. * @param stopNodes Stop nodes. - * @return Test suite. + * @return List of config variations. */ - private TestSuite build(int[] igniteCfgVariation, @Nullable int[] cacheCfgVariation, boolean stopNodes) { + private List build(int[] igniteCfgVariation, @Nullable int[] cacheCfgVariation, + boolean stopNodes) { ConfigVariationsFactory factory = new ConfigVariationsFactory(igniteParams, igniteCfgVariation, cacheParams, cacheCfgVariation); @@ -194,25 +209,17 @@ private TestSuite build(int[] igniteCfgVariation, @Nullable int[] cacheCfgVariat VariationsTestsConfig testCfg = new VariationsTestsConfig(factory, clsNameSuffix, stopNodes, cacheStartMode, gridsCnt, !skipWaitPartMapExchange); - TestSuite addedSuite; - - if (testedNodeCnt > 1) - addedSuite = createMultiNodeTestSuite((Class)cls, - testCfg, testedNodeCnt, withClients, skipWaitPartMapExchange); - else - addedSuite = makeTestSuite(cls, testCfg); - - return addedSuite; + return testedNodeCnt > 1 ? createMultiNodeTestSuite( + testCfg, testedNodeCnt, withClients, skipWaitPartMapExchange) : Collections.singletonList(testCfg); } /** - * @param cls Test class. * @param cfg Configuration. * @param testedNodeCnt Count of tested nodes. */ - private static TestSuite createMultiNodeTestSuite(Class cls, + private static List createMultiNodeTestSuite( VariationsTestsConfig cfg, int testedNodeCnt, boolean withClients, boolean skipWaitParMapExchange) { - TestSuite suite = new TestSuite(); + List suite = new ArrayList<>(); if (cfg.gridCount() < testedNodeCnt) throw new IllegalArgumentException("Failed to initialize test suite [nodeCnt=" + testedNodeCnt @@ -227,28 +234,12 @@ private static TestSuite createMultiNodeTestSuite(Class cls, - VariationsTestsConfig cfg) { - TestSuite res = new TestSuite(cls.getSimpleName()); - - res.addTest(new JUnit4TestAdapter(cls) { - @Override public void run(TestResult tr) { - IgniteConfigVariationsAbstractTest.injectTestsConfiguration(cfg); - - super.run(tr); - } - }); - - return res; - } - /** * @return {@code this} for chaining. */ @@ -298,7 +289,7 @@ public ConfigVariationsTestSuiteBuilder gridsCount(int cnt) { */ public ConfigVariationsTestSuiteBuilder igniteParams( ConfigParameter[][] igniteParams) { - this.igniteParams = igniteParams; + this.igniteParams = igniteParams.clone(); return this; } @@ -307,8 +298,9 @@ public ConfigVariationsTestSuiteBuilder igniteParams( * @param cacheParams New cache params. * @return {@code this} for chaining. */ + @SuppressWarnings("unused") public ConfigVariationsTestSuiteBuilder cacheParams(ConfigParameter[][] cacheParams) { - this.cacheParams = cacheParams; + this.cacheParams = cacheParams.clone(); return this; } @@ -341,8 +333,9 @@ public ConfigVariationsTestSuiteBuilder backups(int backups) { * @param singleIgniteParam Param. * @return {@code this} for chaining. */ + @SuppressWarnings("unused") public ConfigVariationsTestSuiteBuilder specifyIgniteParam(int... singleIgniteParam) { - specificIgniteParam = singleIgniteParam; + specificIgniteParam = singleIgniteParam.clone(); return this; } @@ -351,8 +344,9 @@ public ConfigVariationsTestSuiteBuilder specifyIgniteParam(int... singleIgnitePa * @param singleParam Param. * @return {@code this} for chaining. */ + @SuppressWarnings("unused") public ConfigVariationsTestSuiteBuilder specifyCacheParam(int... singleParam) { - specificCacheParam = singleParam; + specificCacheParam = singleParam.clone(); return this; } @@ -362,11 +356,12 @@ public ConfigVariationsTestSuiteBuilder specifyCacheParam(int... singleParam) { * @return {@code this} for chaining. */ public ConfigVariationsTestSuiteBuilder withIgniteConfigFilters(IgnitePredicate... filters) { - igniteCfgFilters = filters; + igniteCfgFilters = filters.clone(); return this; } + /** */ public ConfigVariationsTestSuiteBuilder skipWaitPartitionMapExchange() { skipWaitPartMapExchange = true; @@ -378,14 +373,12 @@ public ConfigVariationsTestSuiteBuilder skipWaitPartitionMapExchange() { * @return {@code this} for chaining. */ public ConfigVariationsTestSuiteBuilder withCacheConfigFilters(IgnitePredicate... filters) { - cacheCfgFilters = filters; + cacheCfgFilters = filters.clone(); return this; } - /** - * - */ + /** */ private static class OneElementVariationsIterator extends VariationsIterator { /** */ private int[] elem; @@ -408,10 +401,57 @@ private static class OneElementVariationsIterator extends VariationsIterator { } /** {@inheritDoc} */ + @SuppressWarnings("IteratorNextCanNotThrowNoSuchElementException") @Override public int[] next() { hasNext = false; - return elem; + return elem.clone(); + } + } + + /** + * Creates test class for given config variation. + * + * @param pkg Package to put class in. + * @param cfg Config variation. + * @return Test class. + */ + private Class makeTestClass(String pkg, VariationsTestsConfig cfg) { + int idx = cntr.getAndIncrement(); + + String clsName = cls.getSimpleName() + "_" + idx; + + cfgs.put(clsName, cfg); + + ClassPool cp = ClassPool.getDefault(); + cp.insertClassPath(new ClassClassPath(ConfigVariationsTestSuiteBuilder.class)); + + CtClass cl = cp.makeClass(pkg + "." + clsName); + + try { + cl.setSuperclass(cp.get(cls.getName())); + + CtMethod mtd = CtNewMethod.make("public static void init() { " + + "injectTestsConfiguration(" + + ConfigVariationsTestSuiteBuilder.class.getName() + + ".getCfg(\"" + clsName + "\")); }", cl); + + // Create and add annotation. + ClassFile ccFile = cl.getClassFile(); + ConstPool constpool = ccFile.getConstPool(); + + AnnotationsAttribute attr = new AnnotationsAttribute(constpool, AnnotationsAttribute.visibleTag); + Annotation annot = new Annotation("org.junit.BeforeClass", constpool); + + attr.addAnnotation(annot); + mtd.getMethodInfo().addAttribute(attr); + + cl.addMethod(mtd); + + return cl.toClass(); + } + catch (Exception e) { + throw new RuntimeException(e); } } } diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/DynamicSuite.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/DynamicSuite.java new file mode 100644 index 0000000000000..46308daa1aeb9 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/DynamicSuite.java @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ignite.testframework.junits; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; +import org.junit.runners.Suite; +import org.junit.runners.model.InitializationError; + +/** + * Runner for use with test suite classes that implement a static {@code suite()} method for providing list of classes + * to execute in a way resembling how it was done in {@code org.junit.runners.AllTests}. For example: + *
+ * @RunWith(DynamicSuite.class)
+ * public class SomeTestSuite {
+ *    public static List<Class<?>> suite() {
+ *       ...
+ *    }
+ * }
+ * 
+ */ +public class DynamicSuite extends Suite { + /** */ + private static final String SUITE_METHOD_NAME = "suite"; + + /** */ + public DynamicSuite(Class cls) throws InitializationError { + super(cls, testClasses(cls)); + } + + /** */ + private static Class[] testClasses(Class cls) { + List> testClasses; + + try { + Method mtd = cls.getMethod(SUITE_METHOD_NAME); + + testClasses = (List>)mtd.invoke(null); + } + catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("No public static 'suite' method was found in provided suite class: " + + cls.getSimpleName()); + } + + assert testClasses != null : "Null list of test classes was obtained from suite class: " + cls.getSimpleName(); + + return testClasses.toArray(new Class[] {null}); + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java index 97791c95e8ae7..b94bbbcf4429e 100755 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java @@ -177,7 +177,7 @@ public abstract class GridAbstractTest extends JUnit3TestLegacySupport { /** */ protected static final String DEFAULT_CACHE_NAME = "default"; - /** Lock to maintain integrity of {@link TestCounters} and of {@link IgniteConfigVariationsAbstractTest}. */ + /** Lock to maintain integrity of {@link TestCounters}. */ private final Lock runSerializer = new ReentrantLock(); /** Manages test execution and reporting. */ diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java index 2bbead2c2cca0..19dff888e7325 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java @@ -65,10 +65,23 @@ public abstract class IgniteConfigVariationsAbstractTest extends GridCommonAbstr /** See {@link IgniteConfigVariationsAbstractTest#injectTestsConfiguration} */ private static VariationsTestsConfig testsCfgInjected; + /** {@inheritDoc} */ + @Override public String getTestIgniteInstanceName(int idx) { + return getTestIgniteInstanceName() + idx; + } + + /** {@inheritDoc} */ + @Override public String getTestIgniteInstanceName() { + return "testGrid"; + } + /** + * Invoked by reflection from {@code ConfigVariationsTestSuiteBuilder}. + * * @param testsCfgInjected Tests configuration. */ - public static void injectTestsConfiguration(VariationsTestsConfig testsCfgInjected) { + @SuppressWarnings("unused") + protected static void injectTestsConfiguration(VariationsTestsConfig testsCfgInjected) { IgniteConfigVariationsAbstractTest.testsCfgInjected = testsCfgInjected; } diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/test/ConfigVariationsTestSuiteBuilderTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/test/ConfigVariationsTestSuiteBuilderTest.java index 631f0337dcd2f..59cfce7f594fa 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/test/ConfigVariationsTestSuiteBuilderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/test/ConfigVariationsTestSuiteBuilderTest.java @@ -17,84 +17,251 @@ package org.apache.ignite.testframework.test; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import junit.framework.TestSuite; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; +import org.apache.ignite.testframework.junits.IgniteCacheConfigVariationsAbstractTest; import org.apache.ignite.testframework.junits.IgniteConfigVariationsAbstractTest; +import org.jetbrains.annotations.Nullable; +import org.junit.AfterClass; +import org.junit.Assume; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.Suite; +import org.junit.runners.model.InitializationError; +import static org.apache.ignite.IgniteSystemProperties.IGNITE_DISCOVERY_HISTORY_SIZE; import static org.junit.Assert.assertEquals; -/** - * - */ +/** */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ConfigVariationsTestSuiteBuilderTest.BasicTest.class, + ConfigVariationsTestSuiteBuilderTest.TestSuiteBasic.class, + ConfigVariationsTestSuiteBuilderTest.TestSuiteWithIgnored.class, + ConfigVariationsTestSuiteBuilderTest.TestSuiteWithExtendsIgnored.class, + ConfigVariationsTestSuiteBuilderTest.TestSuiteDummy.class, + ConfigVariationsTestSuiteBuilderTest.TestSuiteCacheParams.class +}) public class ConfigVariationsTestSuiteBuilderTest { /** */ - @Test - public void testDefaults() { - TestSuite dfltSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class).build(); + private static List> basicBuild(Class cls) { + return new ConfigVariationsTestSuiteBuilder(cls).classes(); + } - assertEquals(4, dfltSuite.countTestCases()); + /** */ + public static class BasicTest { + /** */ + @Test + public void testDefaults() { + List> classes = basicBuild(NoopTest.class); + + assertEquals(4, classes.size()); - TestSuite dfltCacheSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class) - .withBasicCacheParams().build(); + classes = new ConfigVariationsTestSuiteBuilder(NoopTest.class) + .withBasicCacheParams().classes(); - assertEquals(4 * 4 * 2, dfltCacheSuite.countTestCases()); + assertEquals(4 * 4 * 2, classes.size()); - // With clients. - dfltSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class) - .testedNodesCount(2).withClients().build(); + // With clients. + classes = new ConfigVariationsTestSuiteBuilder(NoopTest.class) + .testedNodesCount(2).withClients().classes(); - assertEquals(4 * 2, dfltSuite.countTestCases()); + assertEquals(4 * 2, classes.size()); - dfltCacheSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class) - .withBasicCacheParams().testedNodesCount(3).withClients().build(); + classes = new ConfigVariationsTestSuiteBuilder(NoopTest.class) + .withBasicCacheParams().testedNodesCount(3).withClients().classes(); + + assertEquals(4 * 4 * 2 * 3, classes.size()); + } - assertEquals(4 * 4 * 2 * 3, dfltCacheSuite.countTestCases()); + /** */ + @SuppressWarnings("serial") + @Test + public void testIgniteConfigFilter() { + List> classes = basicBuild(NoopTest.class); + + final AtomicInteger cnt = new AtomicInteger(); + + List> filteredClasses = new ConfigVariationsTestSuiteBuilder(NoopTest.class) + .withIgniteConfigFilters(new IgnitePredicate() { + @Override public boolean apply(IgniteConfiguration configuration) { + return cnt.getAndIncrement() % 2 == 0; + } + }) + .classes(); + + assertEquals(classes.size() / 2, filteredClasses.size()); + } + + /** */ + @SuppressWarnings("serial") + @Test + public void testCacheConfigFilter() { + List> classes = new ConfigVariationsTestSuiteBuilder(NoopTest.class) + .withBasicCacheParams() + .classes(); + + final AtomicInteger cnt = new AtomicInteger(); + + List> filteredClasses = new ConfigVariationsTestSuiteBuilder(NoopTest.class) + .withBasicCacheParams() + .withCacheConfigFilters(new IgnitePredicate() { + @Override public boolean apply(CacheConfiguration configuration) { + return cnt.getAndIncrement() % 2 == 0; + } + }) + .classes(); + + assertEquals(classes.size() / 2, filteredClasses.size()); + } } /** */ - @SuppressWarnings("serial") - @Test - public void testIgniteConfigFilter() { - TestSuite dfltSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class).build(); + @RunWith(ConfigVariationsTestSuiteBuilderTest.SuiteBasic.class) + public static class TestSuiteBasic { + /** **/ + private static final AtomicBoolean alreadyRun = new AtomicBoolean(false); - final AtomicInteger cnt = new AtomicInteger(); + /** */ + @BeforeClass + public static void init() { + Assume.assumeFalse("This test already has run.", alreadyRun.getAndSet(true)); + } - TestSuite filteredSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class) - .withIgniteConfigFilters(new IgnitePredicate() { - @Override public boolean apply(IgniteConfiguration configuration) { - return cnt.getAndIncrement() % 2 == 0; - } - }) - .build(); + /** */ + @AfterClass + public static void verify() { + assertEquals(4, SuiteBasic.cntr.get()); + } + } + + /** */ + @RunWith(ConfigVariationsTestSuiteBuilderTest.SuiteWithIgnored.class) + public static class TestSuiteWithIgnored { + /** **/ + private static final AtomicBoolean alreadyRun = new AtomicBoolean(false); + + /** */ + @BeforeClass + public static void init() { + Assume.assumeFalse("This test already has run.", alreadyRun.getAndSet(true)); + } - assertEquals(dfltSuite.countTestCases() / 2, filteredSuite.countTestCases()); + /** */ + @AfterClass + public static void verify() { + assertEquals(8, SuiteWithIgnored.cntr.get()); + } } /** */ - @SuppressWarnings("serial") - @Test - public void testCacheConfigFilter() { - TestSuite dfltSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class) - .withBasicCacheParams() - .build(); - - final AtomicInteger cnt = new AtomicInteger(); - - TestSuite filteredSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class) - .withBasicCacheParams() - .withCacheConfigFilters(new IgnitePredicate() { - @Override public boolean apply(CacheConfiguration configuration) { - return cnt.getAndIncrement() % 2 == 0; - } - }) - .build(); + @RunWith(ConfigVariationsTestSuiteBuilderTest.SuiteWithExtendsIgnored.class) + public static class TestSuiteWithExtendsIgnored { + /** **/ + private static final AtomicBoolean alreadyRun = new AtomicBoolean(false); + + /** */ + @BeforeClass + public static void init() { + Assume.assumeFalse("This test already has run.", alreadyRun.getAndSet(true)); + } + + /** */ + @AfterClass + public static void verify() { + assertEquals(4, SuiteWithExtendsIgnored.cntr.get()); + } + } + + /** IMPL NOTE derived from {@code IgniteComputeBasicConfigVariationsFullApiTestSuite}. */ + @RunWith(ConfigVariationsTestSuiteBuilderTest.SuiteDummy.class) + public static class TestSuiteDummy { + /** **/ + private static final AtomicBoolean alreadyRun = new AtomicBoolean(false); + + /** */ + @BeforeClass + public static void init() { + Assume.assumeFalse("This test already has run.", alreadyRun.getAndSet(true)); + } + } + + /** */ + public static class SuiteBasic extends Suite { + /** */ + private static final AtomicInteger cntr = new AtomicInteger(0); + + /** */ + public SuiteBasic(Class cls) throws InitializationError { + super(cls, basicBuild(NoopTest.class).toArray(new Class[] {null})); + } + + /** */ + @Override protected void runChild(Runner runner, RunNotifier ntf) { + cntr.getAndIncrement(); + + super.runChild(runner, ntf); + } + } + + /** */ + public static class SuiteWithIgnored extends Suite { + /** */ + private static final AtomicInteger cntr = new AtomicInteger(0); + + /** + * + */ + public SuiteWithIgnored(Class cls) throws InitializationError { + super(cls, Stream + .concat(basicBuild(NoopTest.class).stream(), basicBuild(NoopTestIgnored.class).stream()) + .collect(Collectors.toList()).toArray(new Class[] {null})); + } + + /** */ + @Override protected void runChild(Runner runner, RunNotifier ntf) { + cntr.getAndIncrement(); - assertEquals(dfltSuite.countTestCases() / 2, filteredSuite.countTestCases()); + super.runChild(runner, ntf); + } + } + + /** */ + public static class SuiteWithExtendsIgnored extends Suite { + /** */ + private static final AtomicInteger cntr = new AtomicInteger(0); + + /** */ + public SuiteWithExtendsIgnored(Class cls) throws InitializationError { + super(cls, basicBuild(NoopTestExtendsIgnored.class).toArray(new Class[] {null})); + } + + /** */ + @Override protected void runChild(Runner runner, RunNotifier ntf) { + cntr.getAndIncrement(); + + super.runChild(runner, ntf); + } + } + + /** */ + public static class SuiteDummy extends Suite { + /** */ + public SuiteDummy(Class cls) throws InitializationError { + super(cls, basicBuild(DummyTest.class).toArray(new Class[] {null})); + } } /** */ @@ -105,4 +272,106 @@ public void test1() { // No-op. } } + + /** */ + @Ignore + public static class NoopTestIgnored extends IgniteConfigVariationsAbstractTest { + /** */ + @Test + public void test1() { + // No-op. + } + } + + /** */ + public static class NoopTestExtendsIgnored extends NoopTestIgnored { + // No-op. + } + + /** */ + public static class DummyTest extends IgniteConfigVariationsAbstractTest { + /** + * @throws Exception If failed. + */ + @Test + public void testDummyExecution() throws Exception { + runInAllDataModes(new TestRunnable() { + @Override public void run() throws Exception { + info("Running dummy test."); + + beforeTest(); + + afterTest(); + } + }); + } + + /** + * Override the base method to return {@code null} value in case the valId is negative. + */ + @Nullable @Override public Object value(int valId) { + if (valId < 0) + return null; + + return super.value(valId); + } + } + + /** IMPL NOTE derived from {@code CacheContinuousQueryVariationsTest}. */ + @RunWith(SuiteCacheParams.class) + public static class TestSuiteCacheParams { + /** **/ + private static final AtomicBoolean alreadyRun = new AtomicBoolean(false); + + /** */ + @BeforeClass + public static void init() { + Assume.assumeFalse("This test already has run.", alreadyRun.getAndSet(true)); + } + } + + /** */ + public static class SuiteCacheParams extends Suite { + /** */ + private static List> suiteSingleNode() { + return new ConfigVariationsTestSuiteBuilder(CacheParamsTest.class) + .withBasicCacheParams() + .gridsCount(1) + .classes(); + } + + /** */ + public SuiteCacheParams(Class cls) throws InitializationError { + super(cls, suiteSingleNode().toArray(new Class[] {null})); + } + + /** */ + @BeforeClass + public static void init(){ + System.setProperty(IGNITE_DISCOVERY_HISTORY_SIZE, "100"); + } + } + + /** */ + public static class CacheParamsTest extends IgniteCacheConfigVariationsAbstractTest { + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); + + cfg.setClientMode(false); + + return cfg; + } + + /** */ + @Test(timeout = 10_000) + public void testRandomOperationJCacheApiKeepBinary() { + // No-op. + } + + /** {@inheritDoc} */ + @Override protected long getTestTimeout() { + return TimeUnit.SECONDS.toMillis(20); + } + } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java index 211ba3dc2714b..a102526169cfb 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java @@ -38,14 +38,13 @@ import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest; import org.apache.ignite.internal.processors.cache.expiry.IgniteCacheAtomicLocalExpiryPolicyTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Cache suite with binary marshaller. */ -@RunWith(IgniteBinaryCacheTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteBinaryCacheTestSuite { /** * @return Suite. @@ -87,12 +86,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java index 843245f1cb269..e6a0a50b53cf9 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java @@ -24,9 +24,8 @@ import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.config.GridTestProperties; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * IgniteBinaryObjectsCacheTestSuite3 is kept together with {@link IgniteCacheTestSuite3} @@ -44,7 +43,7 @@ * In future this suite may be merged with {@link IgniteCacheTestSuite3} * */ -@RunWith(IgniteBinaryObjectsCacheTestSuite3.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteBinaryObjectsCacheTestSuite3 { /** * @return Test suite. @@ -63,17 +62,9 @@ public static List> suite(Collection ignoredTests) { List> suite = new ArrayList<>(IgniteCacheTestSuite3.suite(ignoredTests)); - GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests); return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBasicConfigVariationsFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBasicConfigVariationsFullApiTestSuite.java index af7b42612642f..f346fa64cd1b6 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBasicConfigVariationsFullApiTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBasicConfigVariationsFullApiTestSuite.java @@ -17,27 +17,23 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; import org.apache.ignite.internal.processors.cache.IgniteCacheConfigVariationsFullApiTest; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Test suite for cache API. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class IgniteCacheBasicConfigVariationsFullApiTestSuite { - /** - * @return Cache API test suite. - */ - public static TestSuite suite() { - return new ConfigVariationsTestSuiteBuilder( - "Cache New Full API Test Suite", - IgniteCacheConfigVariationsFullApiTest.class) + /** */ + public static List> suite() { + return new ConfigVariationsTestSuiteBuilder(IgniteCacheConfigVariationsFullApiTest.class) .withBasicCacheParams() .gridsCount(5).backups(1) .testedNodesCount(3).withClients() - .build(); + .classes(); } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBlockExchangeOnReadOperationsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBlockExchangeOnReadOperationsTestSuite.java index 8687390a2d674..deda29c2885d6 100755 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBlockExchangeOnReadOperationsTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheBlockExchangeOnReadOperationsTestSuite.java @@ -23,14 +23,13 @@ import org.apache.ignite.internal.processors.cache.distributed.CacheBlockOnGetAllTest; import org.apache.ignite.internal.processors.cache.distributed.CacheBlockOnScanTest; import org.apache.ignite.internal.processors.cache.distributed.CacheBlockOnSingleGetTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheBlockExchangeOnReadOperationsTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheBlockExchangeOnReadOperationsTestSuite { /** * @return IgniteCache test suite. @@ -52,12 +51,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite1.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite1.java index 6e8cde9521bda..2769ab855ac17 100755 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite1.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite1.java @@ -111,14 +111,13 @@ import org.apache.ignite.internal.processors.cache.expiry.IgniteCacheAtomicLocalExpiryPolicyTest; import org.apache.ignite.internal.processors.cache.query.continuous.CacheEntryProcessorExternalizableFailedTest; import org.apache.ignite.internal.processors.cache.query.continuous.CacheEntryProcessorNonSerializableTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheMvccTestSuite1.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite1 { /** * @return IgniteCache test suite. @@ -245,12 +244,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite2.java index 4393e1f34cf27..c7467e78e0d8f 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite2.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite2.java @@ -89,14 +89,13 @@ import org.apache.ignite.internal.processors.cache.persistence.MemoryPolicyInitializationTest; import org.apache.ignite.internal.processors.continuous.IgniteContinuousQueryMetadataUpdateTest; import org.apache.ignite.internal.processors.continuous.IgniteNoCustomEventsOnNodeStart; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheMvccTestSuite2.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite2 { /** * @return IgniteCache test suite. @@ -199,12 +198,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite3.java index 340a8088f4db5..58995046ec3f2 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite3.java @@ -57,14 +57,13 @@ import org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStoreSelfTest; import org.apache.ignite.internal.processors.cache.store.IgnteCacheClientWriteBehindStoreAtomicTest; import org.apache.ignite.internal.processors.cache.store.IgnteCacheClientWriteBehindStoreNonCoalescingTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheMvccTestSuite3.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite3 { /** * @return IgniteCache test suite. @@ -133,12 +132,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite4.java index 893c544293b0d..c2e74dd2db649 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite4.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite4.java @@ -91,14 +91,11 @@ import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryLocalAtomicSwapDisabledSelfTest; import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedAtomicSelfTest; import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedAtomicSelfTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgniteCacheMvccTestSuite4.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite4 { /** * @return IgniteCache test suite. @@ -197,12 +194,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite5.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite5.java index a5abdc6634be4..ec4f981abfece 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite5.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite5.java @@ -43,14 +43,13 @@ import org.apache.ignite.internal.processors.cache.distributed.rebalancing.CacheManualRebalancingTest; import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheSyncRebalanceModeSelfTest; import org.apache.ignite.internal.processors.cache.store.IgniteCacheWriteBehindNoUpdateSelfTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheMvccTestSuite5.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite5 { /** * @return IgniteCache test suite. @@ -91,12 +90,4 @@ public static List> suite() { return IgniteCacheTestSuite5.suite(ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java index 5f803bdfa7b86..707244d4805c9 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java @@ -40,14 +40,13 @@ import org.apache.ignite.internal.processors.cache.transactions.TxOptimisticPrepareOnUnstableTopologyTest; import org.apache.ignite.internal.processors.cache.transactions.TxRollbackOnTimeoutOnePhaseCommitTest; import org.apache.ignite.internal.processors.cache.transactions.TxStateChangeEventTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheMvccTestSuite6.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite6 { /** * @return IgniteCache test suite. @@ -92,12 +91,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite7.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite7.java index c4b486c9af36d..de1238fe5a30b 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite7.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite7.java @@ -35,14 +35,11 @@ import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingWithAsyncClearingMvccTest; import org.apache.ignite.internal.processors.cache.eviction.paged.PageEvictionMultinodeMixedRegionsTest; import org.apache.ignite.internal.processors.cache.persistence.db.CheckpointBufferDeadlockTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgniteCacheMvccTestSuite7.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite7 { /** * @return IgniteCache test suite. @@ -78,15 +75,6 @@ public static List> suite() { suite.add(GridCacheRebalancingPartitionCountersMvccTest.class); suite.add(GridCacheRebalancingWithAsyncClearingMvccTest.class); - return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite8.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite8.java index 79a9b9a20d83c..670935088a257 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite8.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite8.java @@ -58,14 +58,11 @@ import org.apache.ignite.internal.processors.cache.local.GridCacheAtomicLocalMetricsSelfTest; import org.apache.ignite.internal.processors.cache.local.GridCacheAtomicLocalTckMetricsSelfTestImpl; import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicMetricsNoReadThroughSelfTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgniteCacheMvccTestSuite8.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite8 { /** * @return IgniteCache test suite. @@ -130,12 +127,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite9.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite9.java index b75656853382a..82c778cbe87b7 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite9.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite9.java @@ -29,14 +29,13 @@ import org.apache.ignite.internal.processors.cache.distributed.IgniteTxConcurrentRemoveObjectsTest; import org.apache.ignite.internal.stat.IoStatisticsCachePersistenceSelfTest; import org.apache.ignite.internal.stat.IoStatisticsCacheSelfTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheMvccTestSuite9.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheMvccTestSuite9 { /** * @return IgniteCache test suite. @@ -65,12 +64,4 @@ public static List> suite() { return new ArrayList<>(IgniteCacheTestSuite9.suite(ignoredTests)); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheNearOnlySelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheNearOnlySelfTestSuite.java index c17517e1ec7c2..b84eda03892ab 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheNearOnlySelfTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheNearOnlySelfTestSuite.java @@ -24,14 +24,13 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheNearOnlySelfTest; import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheNearOnlyTopologySelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite for near-only cache. */ -@RunWith(IgniteCacheNearOnlySelfTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheNearOnlySelfTestSuite { /** * @return Suite. @@ -47,26 +46,18 @@ public static List> suite() { public static List> suite(Collection ignoredTests) { List> suite = new ArrayList<>(); - GridTestUtils.addTestIfNeeded(suite,GridCacheClientOnlySelfTest.CasePartitionedAtomic.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheClientOnlySelfTest.CasePartitionedTransactional.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheClientOnlySelfTest.CaseReplicatedAtomic.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheClientOnlySelfTest.CaseReplicatedTransactional.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheClientOnlySelfTest.CasePartitionedAtomic.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheClientOnlySelfTest.CasePartitionedTransactional.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheClientOnlySelfTest.CaseReplicatedAtomic.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheClientOnlySelfTest.CaseReplicatedTransactional.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearOnlyTopologySelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearOnlyTopologySelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearOnlySelfTest.CasePartitionedAtomic.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearOnlySelfTest.CasePartitionedTransactional.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearOnlySelfTest.CaseReplicatedAtomic.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearOnlySelfTest.CaseReplicatedTransactional.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearOnlySelfTest.CasePartitionedAtomic.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearOnlySelfTest.CasePartitionedTransactional.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearOnlySelfTest.CaseReplicatedAtomic.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearOnlySelfTest.CaseReplicatedTransactional.class, ignoredTests); return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTcpClientDiscoveryTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTcpClientDiscoveryTestSuite.java index df66c0c3b2c4b..8fcda42c9c377 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTcpClientDiscoveryTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTcpClientDiscoveryTestSuite.java @@ -22,9 +22,8 @@ import java.util.List; import org.apache.ignite.internal.processors.cache.GridCacheTcpClientDiscoveryMultiThreadedTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; import static org.apache.ignite.internal.processors.cache.distributed.GridCacheClientModesTcpClientDiscoveryAbstractTest.CaseClientPartitionedAtomic; import static org.apache.ignite.internal.processors.cache.distributed.GridCacheClientModesTcpClientDiscoveryAbstractTest.CaseClientPartitionedTransactional; @@ -38,7 +37,7 @@ /** * Tests a cache with TcpClientDiscovery SPI being enabled. */ -@RunWith(IgniteCacheTcpClientDiscoveryTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTcpClientDiscoveryTestSuite { /** * @return Suite. @@ -66,12 +65,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java index 250d84801ee62..891cd7b601913 100755 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java @@ -152,14 +152,13 @@ import org.apache.ignite.internal.processors.datastreamer.DataStreamerTimeoutTest; import org.apache.ignite.internal.processors.datastreamer.DataStreamerUpdateAfterLoadTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite { /** * @return IgniteCache test suite. @@ -231,7 +230,7 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, GridCacheMvccPartitionedSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheMvccManagerSelfTest.class, ignoredTests); // TODO GG-11141. - // GridTestUtils.addTestIfNeeded(suite,GridCacheP2PUndeploySelfTest.class, ignoredTests); + // GridTestUtils.addTestIfNeeded(suite, GridCacheP2PUndeploySelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheConfigurationValidationSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheConfigurationConsistencySelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridDataStorageConfigurationConsistencySelfTest.class, ignoredTests); @@ -319,7 +318,7 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, CacheTxFastFinishTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridIoManagerSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridIoManagerSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteVariousConnectionNumberTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteCommunicationBalanceTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteCommunicationBalancePairedConnectionsTest.class, ignoredTests); @@ -334,30 +333,30 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, CacheStoreWriteErrorTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, CacheTransactionalStoreReadFromBackupTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,CacheAtomicSingleMessageCountSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheAtomicUsersAffinityMapperSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheClearLocallySelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheConcurrentGetCacheOnClientTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheFullTextQueryMultithreadedSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheKeyCheckNearEnabledSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheKeyCheckSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheLeakTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheMultiUpdateLockSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheMvccFlagsTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedUsersAffinityMapperSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReturnValueTransferSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheSlowTxWarnTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheTtlManagerLoadTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheTxUsersAffinityMapperSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteInternalCacheRemoveTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheBinaryEntryProcessorSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheObjectPutSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheSerializationSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheStartStopLoadTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCachingProviderSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteOnePhaseCommitNearSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteStaticCacheStartSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,InterceptorWithKeepBinaryCacheFullApiTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, CacheAtomicSingleMessageCountSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheAtomicUsersAffinityMapperSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheClearLocallySelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheConcurrentGetCacheOnClientTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheFullTextQueryMultithreadedSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheKeyCheckNearEnabledSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheKeyCheckSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheLeakTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheMultiUpdateLockSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheMvccFlagsTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedUsersAffinityMapperSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReturnValueTransferSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheSlowTxWarnTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheTtlManagerLoadTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheTxUsersAffinityMapperSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteInternalCacheRemoveTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheBinaryEntryProcessorSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheObjectPutSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheSerializationSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheStartStopLoadTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCachingProviderSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteOnePhaseCommitNearSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteStaticCacheStartSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, InterceptorWithKeepBinaryCacheFullApiTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, BinaryMetadataRegistrationInsideEntryProcessorTest.class, ignoredTests); @@ -365,12 +364,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java index 0257bdeb87d79..4d271d2c6fcc6 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java @@ -149,14 +149,13 @@ import org.apache.ignite.internal.processors.continuous.IgniteContinuousQueryMetadataUpdateTest; import org.apache.ignite.internal.processors.continuous.IgniteNoCustomEventsOnNodeStart; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite2.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite2 { /** * @return IgniteCache test suite. @@ -175,7 +174,7 @@ public static List> suite(Collection ignoredTests) { // Local cache. GridTestUtils.addTestIfNeeded(suite, GridCacheLocalBasicApiSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalBasicStoreSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheLocalBasicStoreMultithreadedSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheLocalBasicStoreMultithreadedSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalAtomicBasicStoreSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalGetAndTransformStoreSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalAtomicGetAndTransformStoreSelfTest.class, ignoredTests); @@ -183,7 +182,7 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, GridCacheLocalLockSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalMultithreadedSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalTxSingleThreadedSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheLocalTxReadTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheLocalTxReadTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalTxTimeoutSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalEventSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheLocalEvictionEventSelfTest.class, ignoredTests); @@ -219,11 +218,11 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedNodeFailureSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedExplicitLockNodeFailureSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, CacheLockReleaseNodeLeaveTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedEntryLockSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedNestedTxTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedTxConcurrentGetTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedTxMultiNodeSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedTxReadTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedEntryLockSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedNestedTxTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTxConcurrentGetTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTxMultiNodeSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTxReadTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTxSingleThreadedSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheColocatedTxSingleThreadedSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTxTimeoutSelfTest.class, ignoredTests); @@ -259,7 +258,7 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, GridCacheDhtEvictionsDisabledSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheNearEvictionEventSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheAtomicNearEvictionEventSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedEvictionSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedEvictionSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTopologyChangeSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedUnloadEventsSelfTest.class, ignoredTests); @@ -294,14 +293,14 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, CacheExchangeMessageDuplicatedStateTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteContinuousQueryMetadataUpdateTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,NearCacheMultithreadedUpdateTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,NearCachePutAllMultinodeTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, NearCacheMultithreadedUpdateTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, NearCachePutAllMultinodeTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteOnePhaseCommitInvokeTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteCacheNoSyncForGetTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheContainsKeyNearSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheNearTxRollbackTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheContainsKeyNearSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheNearTxRollbackTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteOnePhaseCommitNearReadersTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgniteNearClientCacheCloseTest.class, ignoredTests); @@ -314,16 +313,16 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, IgniteCacheClearDuringRebalanceTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheColocatedDebugTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheColocatedDebugTest.class, ignoredTests); //GridTestUtils.addTestIfNeeded(suite, GridCacheDhtAtomicEvictionNearReadersSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheDhtEntrySetSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheDhtEvictionNearReadersSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheDhtMultiBackupTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheDhtPreloadMessageCountTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedNearDisabledMetricsSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheContainsKeyColocatedSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCrossCacheTxNearEnabledSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteTxConsistencyColocatedRestartSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheDhtEntrySetSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheDhtEvictionNearReadersSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheDhtMultiBackupTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheDhtPreloadMessageCountTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedNearDisabledMetricsSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheContainsKeyColocatedSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCrossCacheTxNearEnabledSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteTxConsistencyColocatedRestartSelfTest.class, ignoredTests); // Configuration validation GridTestUtils.addTestIfNeeded(suite, CacheConfigurationLeakTest.class, ignoredTests); @@ -339,7 +338,7 @@ public static List> suite(Collection ignoredTests) { GridTestUtils.addTestIfNeeded(suite, GridCacheNearJobExecutionSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedJobExecutionTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,RendezvousAffinityFunctionSelfTest.class), ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, RendezvousAffinityFunctionSelfTest.class), ignoredTests); GridTestUtils.addTestIfNeeded(suite, RendezvousAffinityFunctionExcludeNeighborsSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, RendezvousAffinityFunctionFastPowerOfTwoHashSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, RendezvousAffinityFunctionStandardHashSelfTest.class, ignoredTests); @@ -355,12 +354,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java index 81e0749c0ec7c..fab71d3ce1fae 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java @@ -78,14 +78,13 @@ import org.apache.ignite.internal.processors.cache.local.GridCacheDaemonNodeLocalSelfTest; import org.apache.ignite.internal.processors.cache.local.GridCacheLocalByteArrayValuesSelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite3.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite3 { /** * @return IgniteCache test suite. @@ -101,113 +100,105 @@ public static List> suite() { public static List> suite(Collection ignoredTests) { List> suite = new ArrayList<>(); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheGroupsTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheGroupsTest.class, ignoredTests); // Value consistency tests. - GridTestUtils.addTestIfNeeded(suite,GridCacheValueConsistencyAtomicSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheValueConsistencyAtomicNearEnabledSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheValueConsistencyTransactionalSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheValueConsistencyTransactionalNearEnabledSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheValueBytesPreloadingSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyAtomicSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyAtomicNearEnabledSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyTransactionalSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheValueConsistencyTransactionalNearEnabledSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheValueBytesPreloadingSelfTest.class, ignoredTests); // Replicated cache. - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedBasicApiTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedBasicOpSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedBasicStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedGetAndTransformStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedAtomicGetAndTransformStoreSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedEventSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedEventDisabledSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedSynchronousCommitTest.class, ignoredTests); - - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedLockSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedMultiNodeLockSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedMultiNodeSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedNodeFailureSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedTxSingleThreadedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedTxTimeoutSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedPreloadSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedPreloadLifecycleSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheSyncReplicatedPreloadSelfTest.class, ignoredTests); - - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedEntrySetSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedMarshallerTxTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedOnheapFullApiSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedTxConcurrentGetTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedTxMultiNodeBasicTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedTxReadTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedBasicApiTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedBasicOpSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedBasicStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedGetAndTransformStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedAtomicGetAndTransformStoreSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEventSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEventDisabledSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedSynchronousCommitTest.class, ignoredTests); + + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedLockSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedMultiNodeLockSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedMultiNodeSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedNodeFailureSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxSingleThreadedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxTimeoutSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadLifecycleSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheSyncReplicatedPreloadSelfTest.class, ignoredTests); + + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEntrySetSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedMarshallerTxTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedOnheapFullApiSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxConcurrentGetTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxMultiNodeBasicTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxReadTest.class, ignoredTests); // TODO GG-11141. -// GridTestUtils.addTestIfNeeded(suite,GridCacheDeploymentSelfTest.class, ignoredTests); -// GridTestUtils.addTestIfNeeded(suite,GridCacheDeploymentOffHeapSelfTest.class, ignoredTests); -// GridTestUtils.addTestIfNeeded(suite,GridCacheDeploymentOffHeapValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheStartupInDeploymentModesTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheConditionalDeploymentSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheScanPredicateDeploymentSelfTest.class, ignoredTests); - - GridTestUtils.addTestIfNeeded(suite,GridCachePutArrayValueSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedEvictionEventSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedTxMultiThreadedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedPreloadEventsSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedPreloadStartStopEventsSelfTest.class, ignoredTests); - - GridTestUtils.addTestIfNeeded(suite,IgniteTxReentryNearSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteTxReentryColocatedSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheDeploymentSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheDeploymentOffHeapSelfTest.class, ignoredTests); +// GridTestUtils.addTestIfNeeded(suite, GridCacheDeploymentOffHeapValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheStartupInDeploymentModesTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheConditionalDeploymentSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheScanPredicateDeploymentSelfTest.class, ignoredTests); + + GridTestUtils.addTestIfNeeded(suite, GridCachePutArrayValueSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedEvictionEventSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedTxMultiThreadedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadEventsSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedPreloadStartStopEventsSelfTest.class, ignoredTests); + + GridTestUtils.addTestIfNeeded(suite, IgniteTxReentryNearSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteTxReentryColocatedSelfTest.class, ignoredTests); // Test for byte array value special case. - GridTestUtils.addTestIfNeeded(suite,GridCacheLocalByteArrayValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheLocalByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.class, ignoredTests); // Near-only cache. suite.addAll(IgniteCacheNearOnlySelfTestSuite.suite(ignoredTests)); // Test cache with daemon nodes. - GridTestUtils.addTestIfNeeded(suite,GridCacheDaemonNodeLocalSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheDaemonNodePartitionedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheDaemonNodeReplicatedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheDaemonNodeLocalSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheDaemonNodePartitionedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheDaemonNodeReplicatedSelfTest.class, ignoredTests); // Write-behind. suite.addAll(IgniteCacheWriteBehindTestSuite.suite(ignoredTests)); // Transform. - GridTestUtils.addTestIfNeeded(suite,GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheEntryVersionSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheVersionSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheVersionTopologyChangeTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheEntryVersionSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheVersionSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheVersionTopologyChangeTest.class, ignoredTests); // Memory leak tests. - GridTestUtils.addTestIfNeeded(suite,GridCacheReferenceCleanupSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheReloadSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReferenceCleanupSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheReloadSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCacheMixedModeSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheMixedModeSelfTest.class, ignoredTests); // Cache interceptor tests. suite.addAll(IgniteCacheInterceptorSelfTestSuite.suite(ignoredTests)); - GridTestUtils.addTestIfNeeded(suite,IgniteTxGetAfterStopTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteTxGetAfterStopTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheAsyncOperationsTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheAsyncOperationsTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteTxRemoveTimeoutObjectsTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteTxRemoveTimeoutObjectsNearTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteTxRemoveTimeoutObjectsTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteTxRemoveTimeoutObjectsNearTest.class, ignoredTests); return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java index 6cfa534972888..5a23158455f8a 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java @@ -158,14 +158,13 @@ import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedAtomicSelfTest; import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedTransactionalSelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite4.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite4 { /** * @return IgniteCache test suite. @@ -361,12 +360,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java index 740f2ce55ac78..f344e67ccca36 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java @@ -51,14 +51,13 @@ import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheSyncRebalanceModeSelfTest; import org.apache.ignite.internal.processors.cache.store.IgniteCacheWriteBehindNoUpdateSelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite5.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite5 { /** * @return IgniteCache test suite. @@ -74,62 +73,54 @@ public static List> suite() { public static List> suite(Collection ignoredTests) { List> suite = new ArrayList<>(); - GridTestUtils.addTestIfNeeded(suite,CacheSerializableTransactionsTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheNearReaderUpdateTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheStoreCollectionTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheWriteBehindNoUpdateSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCachePutStackOverflowSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheKeepBinaryTransactionTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheSerializableTransactionsTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheNearReaderUpdateTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheStoreCollectionTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheWriteBehindNoUpdateSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCachePutStackOverflowSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheKeepBinaryTransactionTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheLateAffinityAssignmentTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheLateAffinityAssignmentNodeJoinValidationTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,EntryVersionConsistencyReadThroughTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheSyncRebalanceModeSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheLateAffinityAssignmentTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheLateAffinityAssignmentNodeJoinValidationTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, EntryVersionConsistencyReadThroughTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheSyncRebalanceModeSelfTest.class, ignoredTests); suite.add(IgniteCacheReadThroughEvictionsVariationsSuite.class); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheTxIteratorSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheTxIteratorSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,ClusterStatePartitionedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,ClusterStateReplicatedSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,ClusterReadOnlyModeTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCachePartitionLossPolicySelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheGroupsPartitionLossPolicySelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, ClusterStatePartitionedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, ClusterStateReplicatedSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, ClusterReadOnlyModeTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCachePartitionLossPolicySelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheGroupsPartitionLossPolicySelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheRebalancingSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,CacheManualRebalancingTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheRebalancingSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, CacheManualRebalancingTest.class, ignoredTests); // Affinity tests. - GridTestUtils.addTestIfNeeded(suite,GridCacheAffinityBackupsSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheAffinitySelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,AffinityClientNodeSelfTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,LocalAffinityFunctionTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,AffinityHistoryCleanupTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCacheAffinityBackupsSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheAffinitySelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, AffinityClientNodeSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, LocalAffinityFunctionTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, AffinityHistoryCleanupTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,AffinityDistributionLoggingTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, AffinityDistributionLoggingTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,IgniteCacheAtomicProtocolTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, IgniteCacheAtomicProtocolTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,PartitionsExchangeOnDiscoveryHistoryOverflowTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, PartitionsExchangeOnDiscoveryHistoryOverflowTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,GridCachePartitionExchangeManagerHistSizeTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, GridCachePartitionExchangeManagerHistSizeTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,NotMappedPartitionInTxTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, NotMappedPartitionInTxTest.class, ignoredTests); - GridTestUtils.addTestIfNeeded(suite,ConcurrentCacheStartTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, ConcurrentCacheStartTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,GridCacheAtomicPreloadSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheContainsKeyColocatedAtomicSelfTest.class, ignoredTests); - //GridTestUtils.addTestIfNeeded(suite,IgniteCacheContainsKeyNearAtomicSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, GridCacheAtomicPreloadSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheContainsKeyColocatedAtomicSelfTest.class, ignoredTests); + //GridTestUtils.addTestIfNeeded(suite, IgniteCacheContainsKeyNearAtomicSelfTest.class, ignoredTests); return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite6.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite6.java index 1db0d25b272eb..2388cfb8b936f 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite6.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite6.java @@ -52,14 +52,13 @@ import org.apache.ignite.internal.processors.cache.transactions.TxRollbackOnTopologyChangeTest; import org.apache.ignite.internal.processors.cache.transactions.TxStateChangeEventTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite6.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite6 { /** * @return IgniteCache test suite. @@ -130,12 +129,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite7.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite7.java index 3702ddb1ab5fc..0f6cdbc17ccbc 100755 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite7.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite7.java @@ -46,14 +46,13 @@ import org.apache.ignite.internal.processors.cache.transactions.TxRollbackAsyncWithPersistenceTest; import org.apache.ignite.internal.processors.cache.transactions.TxWithSmallTimeoutAndContentionOneKeyTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite7.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite7 { /** * @return IgniteCache test suite. @@ -107,12 +106,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite8.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite8.java index 2f13e61875152..a4f6f2f38897e 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite8.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite8.java @@ -28,14 +28,13 @@ import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingSyncSelfTest; import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingUnmarshallingFailedSelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite8.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite8 { /** * @return IgniteCache test suite. @@ -74,12 +73,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite9.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite9.java index 35fd395c50a57..5e31aa8aec60a 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite9.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite9.java @@ -35,14 +35,13 @@ import org.apache.ignite.internal.stat.IoStatisticsManagerSelfTest; import org.apache.ignite.internal.stat.IoStatisticsMetricsLocalMXBeanImplSelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite. */ -@RunWith(IgniteCacheTestSuite9.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheTestSuite9 { /** * @return IgniteCache test suite. @@ -81,12 +80,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java index e4390576de81d..7476ce78100a3 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java @@ -31,14 +31,13 @@ import org.apache.ignite.internal.processors.cache.store.IgnteCacheClientWriteBehindStoreNonCoalescingTest; import org.apache.ignite.internal.processors.cache.store.IgnteCacheClientWriteBehindStoreTxTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Test suite that contains all tests for {@link org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore}. */ -@RunWith(IgniteCacheWriteBehindTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteCacheWriteBehindTestSuite { /** * @return Ignite Bamboo in-memory data grid test suite. @@ -68,12 +67,4 @@ public static List> suite(Collection ignoredTests) { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteComputeBasicConfigVariationsFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteComputeBasicConfigVariationsFullApiTestSuite.java index 83d923c66edf9..ad9ace24db7b2 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteComputeBasicConfigVariationsFullApiTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteComputeBasicConfigVariationsFullApiTestSuite.java @@ -17,7 +17,9 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.processors.compute.IgniteComputeConfigVariationsFullApiTest; @@ -26,13 +28,13 @@ import org.apache.ignite.testframework.configvariations.ConfigVariations; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; import org.apache.ignite.testframework.configvariations.Parameters; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Full API compute test. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class IgniteComputeBasicConfigVariationsFullApiTestSuite { /** */ @SuppressWarnings("unchecked") @@ -46,29 +48,22 @@ public class IgniteComputeBasicConfigVariationsFullApiTestSuite { Parameters.booleanParameters("setMarshalLocalJobs"), }; - /** - * @return Compute API test suite. - */ - public static TestSuite suite() { - TestSuite suite = new TestSuite("Compute New Full API Test Suite"); - - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "Single server", - IgniteComputeConfigVariationsFullApiTest.class) - .igniteParams(BASIC_COMPUTE_SET) - .gridsCount(1) - .build()); + /** */ + public static List> suite() { + return Stream.concat( - // Tests run on server (node#0) & client(node#1). - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "3 servers, 1 client", - IgniteComputeConfigVariationsFullApiTest.class) - .igniteParams(BASIC_COMPUTE_SET) - .gridsCount(4) - .testedNodesCount(2) - .withClients() - .build()); + new ConfigVariationsTestSuiteBuilder(IgniteComputeConfigVariationsFullApiTest.class) + .igniteParams(BASIC_COMPUTE_SET) + .gridsCount(1) + .classes().stream(), - return suite; + // Tests run on server (node#0) & client(node#1). + new ConfigVariationsTestSuiteBuilder(IgniteComputeConfigVariationsFullApiTest.class) + .igniteParams(BASIC_COMPUTE_SET) + .gridsCount(4) + .testedNodesCount(2) + .withClients() + .classes().stream()) + .collect(Collectors.toList()); } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteContinuousQueryConfigVariationsSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteContinuousQueryConfigVariationsSuite.java index 24b5d520c3714..f189704f4d474 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteContinuousQueryConfigVariationsSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteContinuousQueryConfigVariationsSuite.java @@ -17,46 +17,84 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryVariationsTest; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; +import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.Suite; +import org.junit.runners.model.InitializationError; import static org.apache.ignite.IgniteSystemProperties.IGNITE_DISCOVERY_HISTORY_SIZE; /** * Test suite for cache queries. */ -@RunWith(AllTests.class) +@RunWith(Suite.class) +@Suite.SuiteClasses({ + IgniteContinuousQueryConfigVariationsSuite.SingleNodeTest.class, + IgniteContinuousQueryConfigVariationsSuite.MultiNodeTest.class +}) public class IgniteContinuousQueryConfigVariationsSuite { - /** - * @return Test suite. - */ - public static TestSuite suite() { - System.setProperty(IGNITE_DISCOVERY_HISTORY_SIZE, "100"); - - TestSuite suite = new TestSuite("Ignite Continuous Query Config Variations Suite"); - - CacheContinuousQueryVariationsTest.singleNode = false; + /** */ + private static List> suiteSingleNode() { + return new ConfigVariationsTestSuiteBuilder(CacheContinuousQueryVariationsTest.class) + .withBasicCacheParams() + .gridsCount(1) + .classes(); + } - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "5 nodes 1 backup", - CacheContinuousQueryVariationsTest.class) + /** */ + private static List> suiteMultiNode() { + return new ConfigVariationsTestSuiteBuilder(CacheContinuousQueryVariationsTest.class) .withBasicCacheParams() .gridsCount(5) .backups(2) - .build()); + .classes(); + } - CacheContinuousQueryVariationsTest.singleNode = true; + /** */ + @RunWith(IgniteContinuousQueryConfigVariationsSuite.SuiteSingleNode.class) + public static class SingleNodeTest { + } - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "Single node", - CacheContinuousQueryVariationsTest.class) - .withBasicCacheParams() - .gridsCount(1) - .build()); + /** */ + @RunWith(IgniteContinuousQueryConfigVariationsSuite.SuiteMultiNode.class) + public static class MultiNodeTest { + } + + /** {@inheritDoc} */ + public static class SuiteSingleNode extends Suite { + /** */ + public SuiteSingleNode(Class cls) throws InitializationError { + super(cls, suiteSingleNode().toArray(new Class[] {null})); + } + + /** {@inheritDoc} */ + @Override protected void runChild(Runner runner, RunNotifier ntf) { + System.setProperty(IGNITE_DISCOVERY_HISTORY_SIZE, "100"); + + CacheContinuousQueryVariationsTest.singleNode = true; + + super.runChild(runner, ntf); + } + } + + /** {@inheritDoc} */ + public static class SuiteMultiNode extends Suite { + /** */ + public SuiteMultiNode(Class cls) throws InitializationError { + super(cls, suiteMultiNode().toArray(new Class[] {null})); + } + + /** {@inheritDoc} */ + @Override protected void runChild(Runner runner, RunNotifier ntf) { + System.setProperty(IGNITE_DISCOVERY_HISTORY_SIZE, "100"); + + CacheContinuousQueryVariationsTest.singleNode = false; - return suite; + super.runChild(runner, ntf); + } } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMessagingConfigVariationFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMessagingConfigVariationFullApiTestSuite.java index 788ca7a4ee168..a0855d87975d0 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMessagingConfigVariationFullApiTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMessagingConfigVariationFullApiTestSuite.java @@ -17,7 +17,9 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.processors.messaging.IgniteMessagingConfigVariationFullApiTest; @@ -26,13 +28,13 @@ import org.apache.ignite.testframework.configvariations.ConfigVariations; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; import org.apache.ignite.testframework.configvariations.Parameters; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Test sute for Messaging process. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class IgniteMessagingConfigVariationFullApiTestSuite { /** */ @SuppressWarnings("unchecked") @@ -45,28 +47,19 @@ public class IgniteMessagingConfigVariationFullApiTestSuite { Parameters.booleanParameters("setPeerClassLoadingEnabled") }; - /** - * @return Messaging test suite. - */ - public static TestSuite suite() { - TestSuite suite = new TestSuite("Compute New Full API Test Suite"); - - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "Single server", - IgniteMessagingConfigVariationFullApiTest.class) - .gridsCount(1) - .igniteParams(GRID_PARAMETER_VARIATION) - .build()); - - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "Multiple servers and client", - IgniteMessagingConfigVariationFullApiTest.class) - .testedNodesCount(2) - .gridsCount(6) - .withClients() - .igniteParams(GRID_PARAMETER_VARIATION) - .build()); - - return suite; + /** */ + public static List> suite() { + return Stream.concat( + new ConfigVariationsTestSuiteBuilder(IgniteMessagingConfigVariationFullApiTest.class) + .gridsCount(1) + .igniteParams(GRID_PARAMETER_VARIATION) + .classes().stream(), + new ConfigVariationsTestSuiteBuilder(IgniteMessagingConfigVariationFullApiTest.class) + .testedNodesCount(2) + .gridsCount(6) + .withClients() + .igniteParams(GRID_PARAMETER_VARIATION) + .classes().stream()) + .collect(Collectors.toList()); } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite.java index 9045f3655d80e..220c41ff9d620 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite.java @@ -41,14 +41,11 @@ import org.apache.ignite.internal.processors.cache.persistence.pagemem.PagesWriteThrottleSmokeTest; import org.apache.ignite.internal.processors.cache.persistence.wal.SegmentedRingByteBufferTest; import org.apache.ignite.internal.processors.cache.persistence.wal.aware.SegmentAwareTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgnitePdsMvccTestSuite.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsMvccTestSuite { /** * @return Suite. @@ -88,12 +85,4 @@ public static List> suite() { return new ArrayList<>(IgnitePdsTestSuite.suite(ignoredTests)); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite2.java index 09f6ff11a9fde..7dd5ec1cce8c5 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite2.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite2.java @@ -45,14 +45,11 @@ import org.apache.ignite.internal.processors.cache.persistence.db.wal.crc.IgniteReplayWalIteratorInvalidCrcTest; import org.apache.ignite.internal.processors.cache.persistence.db.wal.crc.IgniteStandaloneWalIteratorInvalidCrcTest; import org.apache.ignite.internal.processors.cache.persistence.wal.reader.StandaloneWalRecordsIteratorTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgnitePdsMvccTestSuite2.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsMvccTestSuite2 { /** * @return Suite. @@ -96,12 +93,4 @@ public static List> suite() { return IgnitePdsTestSuite2.suite(ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite3.java index 26dffc10ac28a..e9792db051bef 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite3.java @@ -19,14 +19,13 @@ import java.util.HashSet; import java.util.List; import org.apache.ignite.IgniteSystemProperties; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Mvcc version of {@link IgnitePdsTestSuite3}. */ -@RunWith(IgnitePdsMvccTestSuite3.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgnitePdsMvccTestSuite3 { /** * @return Suite. @@ -40,12 +39,4 @@ public static List> suite() { return IgnitePdsTestSuite3.suite(ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java index 2b20c41dc642f..239372c0ad925 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java @@ -23,14 +23,13 @@ import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsTaskCancelingTest; import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsPartitionPreloadTest; import org.apache.ignite.internal.processors.cache.persistence.file.FileDownloaderTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Mvcc variant of {@link IgnitePdsTestSuite4}. */ -@RunWith(IgnitePdsMvccTestSuite4.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgnitePdsMvccTestSuite4 { /** * @return Suite. @@ -49,12 +48,4 @@ public static List> suite() { return IgnitePdsTestSuite4.suite(ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java index 8a31d966b3a24..0f8e036281910 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java @@ -56,14 +56,11 @@ import org.apache.ignite.internal.processors.metastorage.DistributedMetaStoragePersistentTest; import org.apache.ignite.internal.processors.metastorage.DistributedMetaStorageTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgnitePdsTestSuite.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsTestSuite { /** * @return IgniteCache test suite. @@ -175,12 +172,4 @@ public static void addRealPageStoreTests(List> suite, Collection GridTestUtils.addTestIfNeeded(suite, DistributedMetaStorageTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, DistributedMetaStoragePersistentTest.class, ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java index 767ea94f4fa4a..49a56dc29e2b9 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java @@ -72,14 +72,11 @@ import org.apache.ignite.internal.processors.cache.persistence.db.wal.reader.IgniteWalReaderTest; import org.apache.ignite.internal.processors.cache.persistence.wal.reader.StandaloneWalRecordsIteratorTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgnitePdsTestSuite2.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsTestSuite2 { /** * @return Suite. @@ -220,12 +217,4 @@ public static void addRealPageStoreTests(List> suite, Collection GridTestUtils.addTestIfNeeded(suite, IgnitePdsPartitionsStateRecoveryTest.class, ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite3.java index f068b9b51980a..d99cb823def5a 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite3.java @@ -23,14 +23,11 @@ import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsContinuousRestartTest; import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsContinuousRestartTestWithExpiryPolicy; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgnitePdsTestSuite3.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsTestSuite3 { /** * @return IgniteCache test suite. @@ -62,12 +59,4 @@ private static void addRealPageStoreTestsNotForDirectIo(List> suite, Co GridTestUtils.addTestIfNeeded(suite, IgnitePdsContinuousRestartTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, IgnitePdsContinuousRestartTestWithExpiryPolicy.class, ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java index 5ff6d6aa25e7c..5e48ee43e5c4d 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java @@ -33,14 +33,11 @@ import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsTransactionsHangTest; import org.apache.ignite.internal.processors.cache.persistence.file.FileDownloaderTest; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -/** - * - */ -@RunWith(IgnitePdsTestSuite4.DynamicSuite.class) +/** */ +@RunWith(DynamicSuite.class) public class IgnitePdsTestSuite4 { /** * @return Suite. @@ -86,12 +83,4 @@ private static void addRealPageStoreTestsNotForDirectIo(List> suite, Co // Integrity test. GridTestUtils.addTestIfNeeded(suite, IgnitePdsRecoveryAfterFileCorruptionTest.class, ignoredTests); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteReproducingSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteReproducingSuite.java index dbf1a4b03ac14..3696cf9c67753 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteReproducingSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteReproducingSuite.java @@ -35,10 +35,10 @@ * * This suite is not included into main build. */ -@RunWith(IgniteReproducingSuite.DynamicSuite.class) +@RunWith(IgniteReproducingSuite.DynamicReproducingSuite.class) public class IgniteReproducingSuite { /** */ - public static class DynamicSuite extends Suite { + public static class DynamicReproducingSuite extends Suite { /** * @return List of test(s) for reproduction some problem. */ @@ -55,7 +55,7 @@ private static List> classes() { } /** */ - public DynamicSuite(Class cls) throws InitializationError { + public DynamicReproducingSuite(Class cls) throws InitializationError { super(cls, classes().toArray(new Class[] {null})); } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteServiceConfigVariationsFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteServiceConfigVariationsFullApiTestSuite.java index 24086cdcafbf4..35d6e5557021c 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteServiceConfigVariationsFullApiTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteServiceConfigVariationsFullApiTestSuite.java @@ -17,19 +17,22 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.processors.service.IgniteServiceConfigVariationsFullApiTest; import org.apache.ignite.testframework.configvariations.ConfigParameter; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; import org.apache.ignite.testframework.configvariations.Parameters; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Full API service test suit. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class IgniteServiceConfigVariationsFullApiTestSuite { /** */ @SuppressWarnings("unchecked") @@ -37,49 +40,38 @@ public class IgniteServiceConfigVariationsFullApiTestSuite { Parameters.booleanParameters("setPeerClassLoadingEnabled") }; - /** - * @return Compute API test suite. - */ - public static TestSuite suite() { - TestSuite suite = new TestSuite("Service Deployment New Full API Test Suite"); - - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "Single server", - IgniteServiceConfigVariationsFullApiTest.class) - .igniteParams(PARAMS) - .gridsCount(1) - .build()); + /** */ + public static List> suite() { + return Stream.of( + new ConfigVariationsTestSuiteBuilder(IgniteServiceConfigVariationsFullApiTest.class) + .igniteParams(PARAMS) + .gridsCount(1) + .classes(), - // Tests run on server (node#0) & client(node#1). - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "1 server, 1 client", - IgniteServiceConfigVariationsFullApiTest.class) - .igniteParams(PARAMS) - .gridsCount(2) - .testedNodesCount(2) - .withClients() - .build()); + // Tests run on server (node#0) & client(node#1). + new ConfigVariationsTestSuiteBuilder(IgniteServiceConfigVariationsFullApiTest.class) + .igniteParams(PARAMS) + .gridsCount(2) + .testedNodesCount(2) + .withClients() + .classes(), - // Tests run on servers (node#0,node#2,node#3) & client(node#1). - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "3 servers, 1 client", - IgniteServiceConfigVariationsFullApiTest.class) - .igniteParams(PARAMS) - .gridsCount(4) - .testedNodesCount(2) - .withClients() - .build()); + // Tests run on servers (node#0,node#2,node#3) & client(node#1). + new ConfigVariationsTestSuiteBuilder(IgniteServiceConfigVariationsFullApiTest.class) + .igniteParams(PARAMS) + .gridsCount(4) + .testedNodesCount(2) + .withClients() + .classes(), - // Tests run on servers (node#0,node#2,node#3) & client(node#1,node#4). - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "3 servers, 2 clients", - IgniteServiceConfigVariationsFullApiTest.class) - .igniteParams(PARAMS) - .gridsCount(5) - .testedNodesCount(2) - .withClients() - .build()); + // Tests run on servers (node#0,node#2,node#3) & client(node#1,node#4). + new ConfigVariationsTestSuiteBuilder(IgniteServiceConfigVariationsFullApiTest.class) + .igniteParams(PARAMS) + .gridsCount(5) + .testedNodesCount(2) + .withClients() + .classes()) - return suite; + .flatMap(Collection::stream).collect(Collectors.toList()); } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/InterceptorCacheConfigVariationsFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/InterceptorCacheConfigVariationsFullApiTestSuite.java index f25225c191c53..af7b098ed9e50 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/InterceptorCacheConfigVariationsFullApiTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/InterceptorCacheConfigVariationsFullApiTestSuite.java @@ -17,27 +17,23 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; import org.apache.ignite.internal.processors.cache.InterceptorCacheConfigVariationsFullApiTest; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Test suite for cache API. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class InterceptorCacheConfigVariationsFullApiTestSuite { - /** - * @return Cache API test suite. - */ - public static TestSuite suite() { - return new ConfigVariationsTestSuiteBuilder( - "Cache New Full API Test Suite with Interceptor", - InterceptorCacheConfigVariationsFullApiTest.class) + /** */ + public static List> suite() { + return new ConfigVariationsTestSuiteBuilder(InterceptorCacheConfigVariationsFullApiTest.class) .withBasicCacheParams() .gridsCount(5).backups(1) .testedNodesCount(3).withClients() - .build(); + .classes(); } } diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/WithKeepBinaryCacheConfigVariationsFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/WithKeepBinaryCacheConfigVariationsFullApiTestSuite.java index 069274c25809b..cc072ec311f0f 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/WithKeepBinaryCacheConfigVariationsFullApiTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/WithKeepBinaryCacheConfigVariationsFullApiTestSuite.java @@ -17,57 +17,49 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.processors.cache.WithKeepBinaryCacheFullApiTest; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Test suite for cache API. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class WithKeepBinaryCacheConfigVariationsFullApiTestSuite { - /** - * @return Cache API test suite. - */ + /** */ @SuppressWarnings("serial") - public static TestSuite suite() { - TestSuite suite = new TestSuite("With Keep Binary Cache Config Variations Full API Test Suite"); + public static List> suite() { + return Stream.concat( + new ConfigVariationsTestSuiteBuilder(WithKeepBinaryCacheFullApiTest.class) + .withBasicCacheParams() + .withIgniteConfigFilters(new IgnitePredicate() { + @Override public boolean apply(IgniteConfiguration cfg) { + return cfg.getMarshaller() instanceof BinaryMarshaller; + } + }) + .gridsCount(5) + .backups(1) + .testedNodesCount(3).withClients() + .classes().stream(), - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "With Keep Binary Cache Test Suite", - WithKeepBinaryCacheFullApiTest.class) - .withBasicCacheParams() - .withIgniteConfigFilters(new IgnitePredicate() { - @Override public boolean apply(IgniteConfiguration cfg) { - return cfg.getMarshaller() instanceof BinaryMarshaller; - } - }) - .gridsCount(5) - .backups(1) - .testedNodesCount(3).withClients() - .build() - ); - - suite.addTest(new ConfigVariationsTestSuiteBuilder( - "With Keep Binary Cache with Interceptor Test Suite", - WithKeepBinaryCacheFullApiTest.class) - .withBasicCacheParams() - .withIgniteConfigFilters(new IgnitePredicate() { - @Override public boolean apply(IgniteConfiguration cfg) { - return cfg.getMarshaller() instanceof BinaryMarshaller; - } - }) - .gridsCount(5) - .backups(1) - .testedNodesCount(3).withClients() - .build() - ); - - return suite; + new ConfigVariationsTestSuiteBuilder(WithKeepBinaryCacheFullApiTest.class) + .withBasicCacheParams() + .withIgniteConfigFilters(new IgnitePredicate() { + @Override public boolean apply(IgniteConfiguration cfg) { + return cfg.getMarshaller() instanceof BinaryMarshaller; + } + }) + .gridsCount(5) + .backups(1) + .testedNodesCount(3).withClients() + .classes().stream()) + .collect(Collectors.toList()); } } diff --git a/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite.java b/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite.java index 6bf7ab6e0ed5c..4ccffd72c234f 100644 --- a/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite.java +++ b/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite.java @@ -19,14 +19,13 @@ import java.util.ArrayList; import java.util.List; import org.apache.ignite.internal.processors.cache.persistence.file.IgniteNativeIoWithNoPersistenceTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Subset of {@link IgnitePdsTestSuite} suite test, started with direct-oi jar in classpath. */ -@RunWith(IgnitePdsNativeIoTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgnitePdsNativeIoTestSuite { /** * @return Suite. @@ -43,12 +42,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite2.java b/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite2.java index cc38ff4e69def..714b562146a39 100644 --- a/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite2.java +++ b/modules/direct-io/src/test/java/org/apache/ignite/testsuites/IgnitePdsNativeIoTestSuite2.java @@ -22,14 +22,13 @@ import org.apache.ignite.internal.processors.cache.persistence.IgniteNativeIoLocalWalModeChangeDuringRebalancingSelfTest; import org.apache.ignite.internal.processors.cache.persistence.IgniteNativeIoPdsRecoveryAfterFileCorruptionTest; import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteNativeIoWalFlushFsyncSelfTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; /** * Same as {@link IgnitePdsTestSuite2} but is started with direct-oi jar in classpath. */ -@RunWith(IgnitePdsNativeIoTestSuite2.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgnitePdsNativeIoTestSuite2 { /** * @return Suite. @@ -51,12 +50,4 @@ public static List> suite() { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java index b3d806607eaad..eb8524f3b2860 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java @@ -31,6 +31,7 @@ import org.apache.ignite.igfs.IgfsMode; import org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint; import org.apache.ignite.internal.util.typedef.G; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.jetbrains.annotations.Nullable; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -43,7 +44,7 @@ /** * Test suite for IGFS event tests. */ -@RunWith(IgfsEventsTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgfsEventsTestSuite { /** * @return Test suite. @@ -81,14 +82,6 @@ private static List> suiteNoarchOnly() throws ClassNotFoundException { return suite; } - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws ClassNotFoundException, InitializationError { - super(cls, suite().toArray(new Class[] {null})); - } - } - /** */ @RunWith(IgfsEventsTestSuite.IgfsEventsNoarchOnlyTestSuite.class) public static class IgfsEventsNoarchOnlyTest { diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java index 4aa876cc4ec85..168e04e867ec4 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java @@ -103,15 +103,15 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; import static org.apache.ignite.testframework.GridTestUtils.modeToPermissionSet; /** * Test suite for Hadoop Map Reduce engine. */ -@RunWith(IgniteHadoopTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteHadoopTestSuite { /** * @return Test suite. @@ -377,12 +377,4 @@ else if (entry.isSymbolicLink()) { throw new IllegalStateException("Failed to install " + appName + "."); } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws Exception { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteIgfsLinuxAndMacOSTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteIgfsLinuxAndMacOSTestSuite.java index 6694dec4d34fb..f1788827567e6 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteIgfsLinuxAndMacOSTestSuite.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteIgfsLinuxAndMacOSTestSuite.java @@ -33,8 +33,8 @@ import org.apache.ignite.internal.processors.hadoop.impl.igfs.IgniteHadoopFileSystemShmemExternalToClientPrimarySelfTest; import org.apache.ignite.internal.processors.hadoop.impl.igfs.IgniteHadoopFileSystemShmemExternalToClientProxySelfTest; import org.apache.ignite.internal.processors.igfs.IgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.Suite; import static org.apache.ignite.testsuites.IgniteHadoopTestSuite.downloadHadoop; @@ -42,7 +42,7 @@ * Test suite for Hadoop file system over Ignite cache. * Contains tests which works on Linux and Mac OS platform only. */ -@RunWith(IgniteIgfsLinuxAndMacOSTestSuite.DynamicSuite.class) +@RunWith(DynamicSuite.class) public class IgniteIgfsLinuxAndMacOSTestSuite { /** * @return Test suite. @@ -76,12 +76,4 @@ public static List> suite() throws Exception { return suite; } - - /** */ - public static class DynamicSuite extends Suite { - /** */ - public DynamicSuite(Class cls) throws Exception { - super(cls, suite().toArray(new Class[] {null})); - } - } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheConfigVariationQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheConfigVariationQueryTestSuite.java index a8e9c1c4832e0..b34b34bf28083 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheConfigVariationQueryTestSuite.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheConfigVariationQueryTestSuite.java @@ -17,27 +17,23 @@ package org.apache.ignite.testsuites; -import junit.framework.TestSuite; +import java.util.List; import org.apache.ignite.internal.processors.cache.IgniteCacheConfigVariationsQueryTest; import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder; +import org.apache.ignite.testframework.junits.DynamicSuite; import org.junit.runner.RunWith; -import org.junit.runners.AllTests; /** * Test suite for cache queries. */ -@RunWith(AllTests.class) +@RunWith(DynamicSuite.class) public class IgniteCacheConfigVariationQueryTestSuite { - /** - * @return Test suite. - */ - public static TestSuite suite() { - return new ConfigVariationsTestSuiteBuilder( - "Cache Config Variations Query Test Suite", - IgniteCacheConfigVariationsQueryTest.class) + /** */ + public static List> suite() { + return new ConfigVariationsTestSuiteBuilder(IgniteCacheConfigVariationsQueryTest.class) .withBasicCacheParams() .gridsCount(5).backups(1) .testedNodesCount(3).withClients() - .build(); + .classes(); } } diff --git a/parent/pom.xml b/parent/pom.xml index ce3cff6a13a2d..a8128d91416aa 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -253,6 +253,13 @@ 4.11 test + + + org.javassist + javassist + ${javassist.version} + test +