http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java index 7f9989d..3a478ed 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java @@ -27,12 +27,16 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; import org.apache.ignite.internal.processors.cache.IgniteCacheAbstractFieldsQuerySelfTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.PARTITIONED; /** * Tests for fields queries. */ +@RunWith(JUnit4.class) public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstractFieldsQuerySelfTest { /** {@inheritDoc} */ @Override protected CacheMode cacheMode() { @@ -62,11 +66,13 @@ public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstra } /** @throws Exception If failed. */ + @Test public void testLocalQuery() throws Exception { doTestLocalQuery(intCache, new SqlFieldsQuery("select _key, _val from Integer")); } /** @throws Exception If failed. */ + @Test public void testLocalQueryNoOpCache() throws Exception { doTestLocalQuery(noOpCache, new SqlFieldsQuery("select _key, _val from \"Integer-Integer\".Integer")); } @@ -90,4 +96,4 @@ public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstra assertEquals(exp, qry.getAll().size()); } -} \ No newline at end of file +}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java index fd2ca76..301e6f9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java @@ -217,4 +217,4 @@ public class IgniteCachePartitionedQuerySelfTest extends IgniteCacheAbstractQuer super.sendMessage(node, msg, ackC); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNoRebalanceSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNoRebalanceSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNoRebalanceSelfTest.java index 7b4d400..1739562 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNoRebalanceSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNoRebalanceSelfTest.java @@ -28,10 +28,14 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test added to check for https://issues.apache.org/jira/browse/IGNITE-3326. */ +@RunWith(JUnit4.class) public class IgniteCacheQueryNoRebalanceSelfTest extends GridCommonAbstractTest { /** */ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); @@ -62,6 +66,7 @@ public class IgniteCacheQueryNoRebalanceSelfTest extends GridCommonAbstractTest /** * Tests correct query execution with disabled re-balancing. */ + @Test public void testQueryNoRebalance() { IgniteCache<Object, Object> cache = grid().cache(DEFAULT_CACHE_NAME); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeFailTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeFailTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeFailTest.java index 6e47399..d756d16 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeFailTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeFailTest.java @@ -32,10 +32,14 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test added to check for https://issues.apache.org/jira/browse/IGNITE-2542. */ +@RunWith(JUnit4.class) public class IgniteCacheQueryNodeFailTest extends GridCommonAbstractTest { /** */ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); @@ -76,6 +80,7 @@ public class IgniteCacheQueryNodeFailTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeFailedSimpleQuery()throws Exception { checkNodeFailed("select _key from Integer"); } @@ -83,6 +88,7 @@ public class IgniteCacheQueryNodeFailTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNodeFailedReduceQuery()throws Exception { checkNodeFailed("select avg(_key) from Integer"); } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java index bad5303..634af06 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java @@ -33,10 +33,14 @@ import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicIntegerArray; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for distributed queries with node restarts. */ +@RunWith(JUnit4.class) public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCacheQueryAbstractDistributedJoinSelfTest { /** Total nodes. */ private int totalNodes = 6; @@ -64,6 +68,7 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa /** * @throws Exception If failed. */ + @Test public void testRestarts() throws Exception { restarts(false); } @@ -71,6 +76,7 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa /** * @throws Exception If failed. */ + @Test public void testRestartsBroadcast() throws Exception { restarts(true); } @@ -278,4 +284,4 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa info("Stopped."); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java index dd495cf..841bd5c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java @@ -41,6 +41,9 @@ import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -49,6 +52,7 @@ import static org.apache.ignite.cache.CacheRebalanceMode.SYNC; /** * Test for distributed queries with node restarts. */ +@RunWith(JUnit4.class) public class IgniteCacheQueryNodeRestartSelfTest extends GridCacheAbstractSelfTest { /** */ private static final int GRID_CNT = 3; @@ -104,6 +108,7 @@ public class IgniteCacheQueryNodeRestartSelfTest extends GridCacheAbstractSelfTe * @throws Exception If failed. */ @SuppressWarnings({"TooBroadScope"}) + @Test public void testRestarts() throws Exception { int duration = 60 * 1000; int qryThreadNum = 10; @@ -259,4 +264,4 @@ public class IgniteCacheQueryNodeRestartSelfTest extends GridCacheAbstractSelfTe return false; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java index 834a732..6b78c21 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java @@ -51,6 +51,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.transactions.TransactionException; import org.apache.ignite.transactions.TransactionTimeoutException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -61,6 +64,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * Test for distributed queries with node restarts. */ +@RunWith(JUnit4.class) public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest { /** */ private static final String PARTITIONED_QRY = "select co.id, count(*) cnt\n" + @@ -199,6 +203,7 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testRestarts() throws Exception { int duration = 90 * 1000; int qryThreadNum = 4; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java index 6c989dd..24516c8 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java @@ -33,47 +33,59 @@ import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.GridProcessor; import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing; import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for cancel of query containing distributed joins. */ +@RunWith(JUnit4.class) public class IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest extends IgniteCacheQueryAbstractDistributedJoinSelfTest { /** */ + @Test public void testCancel1() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 1, TimeUnit.MILLISECONDS, false); } /** */ + @Test public void testCancel2() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 50, TimeUnit.MILLISECONDS, false); } /** */ + @Test public void testCancel3() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 100, TimeUnit.MILLISECONDS, false); } /** */ + @Test public void testCancel4() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 500, TimeUnit.MILLISECONDS, false); } /** */ + @Test public void testTimeout1() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 1, TimeUnit.MILLISECONDS, true); } /** */ + @Test public void testTimeout2() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 50, TimeUnit.MILLISECONDS, true); } /** */ + @Test public void testTimeout3() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 100, TimeUnit.MILLISECONDS, true); } /** */ + @Test public void testTimeout4() throws Exception { testQueryCancel(grid(0), "pe", QRY_0, 500, TimeUnit.MILLISECONDS, true); } http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java index 203a319..5c0f38d 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java @@ -33,10 +33,14 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import javax.cache.Cache; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class IgniteSqlQueryWithBaselineTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -110,6 +114,7 @@ public class IgniteSqlQueryWithBaselineTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryWithNodeNotInBLT() throws Exception { startGrids(2); @@ -123,6 +128,7 @@ public class IgniteSqlQueryWithBaselineTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryWithoutBLTNode() throws Exception { startGrids(2); @@ -137,6 +143,7 @@ public class IgniteSqlQueryWithBaselineTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testQueryFromNotBLTNode() throws Exception { startGrid(1); @@ -181,4 +188,4 @@ public class IgniteSqlQueryWithBaselineTest extends GridCommonAbstractTest { log.info("result size: " + res.size()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest.java index a5b3706..d97e50b 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest.java @@ -26,6 +26,9 @@ import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -36,6 +39,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; * Tests non-collocated join with REPLICATED cache and no primary partitions for that cache on some nodes. */ @SuppressWarnings("unused") +@RunWith(JUnit4.class) public class IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest extends GridCommonAbstractTest { /** Client node name. */ public static final String NODE_CLI = "client"; @@ -103,6 +107,7 @@ public class IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest ext * * @throws Exception If failed. */ + @Test public void testJoinNonCollocated() throws Exception { SqlFieldsQuery qry = new SqlFieldsQuery("SELECT COUNT(*) FROM PartValue p, RepValue r WHERE p.repId=r.id"); @@ -148,4 +153,4 @@ public class IgniteCacheReplicatedFieldsQueryJoinNoPrimaryPartitionsSelfTest ext this.id = id; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQuerySelfTest.java index 953e5fa..c4b5c05 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedFieldsQuerySelfTest.java @@ -27,12 +27,16 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.processors.cache.IgniteCacheAbstractFieldsQuerySelfTest; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.REPLICATED; /** * Tests for fields queries. */ +@RunWith(JUnit4.class) public class IgniteCacheReplicatedFieldsQuerySelfTest extends IgniteCacheAbstractFieldsQuerySelfTest { /** {@inheritDoc} */ @Override protected CacheMode cacheMode() { @@ -47,6 +51,7 @@ public class IgniteCacheReplicatedFieldsQuerySelfTest extends IgniteCacheAbstrac /** * @throws Exception If failed. */ + @Test public void testLostIterator() throws Exception { IgniteCache<Integer, Integer> cache = intCache; @@ -77,4 +82,4 @@ public class IgniteCacheReplicatedFieldsQuerySelfTest extends IgniteCacheAbstrac } }, IgniteException.class, null); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java index feb330b..6425dbf 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java @@ -42,10 +42,14 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * A set of basic tests for caches with indexes. */ +@RunWith(JUnit4.class) public class BasicIndexTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -145,6 +149,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testNoIndexesNoPersistence() throws Exception { indexes = Collections.emptyList(); @@ -168,6 +173,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testAllIndexesNoPersistence() throws Exception { indexes = Arrays.asList( new QueryIndex("keyStr"), @@ -198,6 +204,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testDynamicIndexesNoPersistence() throws Exception { indexes = Collections.emptyList(); @@ -230,6 +237,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testNoIndexesWithPersistence() throws Exception { indexes = Collections.emptyList(); @@ -265,6 +273,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testAllIndexesWithPersistence() throws Exception { indexes = Arrays.asList( new QueryIndex("keyStr"), @@ -307,6 +316,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testDynamicIndexesWithPersistence() throws Exception { indexes = Collections.emptyList(); @@ -351,6 +361,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testNoIndexesWithPersistenceIndexRebuild() throws Exception { indexes = Collections.emptyList(); @@ -396,6 +407,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testAllIndexesWithPersistenceIndexRebuild() throws Exception { indexes = Arrays.asList( new QueryIndex("keyStr"), @@ -448,6 +460,7 @@ public class BasicIndexTest extends GridCommonAbstractTest { } /** */ + @Test public void testDynamicIndexesWithPersistenceIndexRebuild() throws Exception { indexes = Collections.emptyList(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexPrimaryKeyUnwrapSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexPrimaryKeyUnwrapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexPrimaryKeyUnwrapSelfTest.java index 376a0d4..b17ea33 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexPrimaryKeyUnwrapSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexPrimaryKeyUnwrapSelfTest.java @@ -27,11 +27,15 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test of creating and using PK indexes for tables created through SQL. */ @SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"}) +@RunWith(JUnit4.class) public class ComplexPrimaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** Counter to generate unique table names. */ @@ -54,6 +58,7 @@ public class ComplexPrimaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test using PK indexes for complex primary key. */ + @Test public void testComplexPk() { String tblName = createTableName(); @@ -66,6 +71,7 @@ public class ComplexPrimaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test using PK indexes for simple primary key. */ + @Test public void testSimplePk() { //ToDo: IGNITE-8386: need to add DATE type into the test. HashMap<String, String> types = new HashMap() { @@ -107,6 +113,7 @@ public class ComplexPrimaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test using PK indexes for simple primary key and affinity key. */ + @Test public void testSimplePkWithAffinityKey() { //ToDo: IGNITE-8386: need to add DATE type into the test. HashMap<String, String> types = new HashMap() { @@ -148,6 +155,7 @@ public class ComplexPrimaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test using PK indexes for wrapped primary key. */ + @Test public void testWrappedPk() { String tblName = createTableName(); @@ -181,6 +189,7 @@ public class ComplexPrimaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test don't using PK indexes for table created through cache API. */ + @Test public void testIndexesForCachesCreatedThroughCashApi() { String tblName = TestValue.class.getSimpleName(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java index fe3cbfa..e54c514 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ComplexSecondaryKeyUnwrapSelfTest.java @@ -25,11 +25,15 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test of creating and using secondary indexes for tables created through SQL. */ @SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"}) +@RunWith(JUnit4.class) public class ComplexSecondaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** Counter to generate unique table names. */ @@ -52,6 +56,7 @@ public class ComplexSecondaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test secondary index with complex PK. Columns for secondary and PK indexes are intersect. */ + @Test public void testSecondaryIndexWithIntersectColumnsComplexPk() { String tblName = createTableName(); @@ -66,6 +71,7 @@ public class ComplexSecondaryKeyUnwrapSelfTest extends GridCommonAbstractTest { /** * Test using secondary index with simple PK. */ + @Test public void testSecondaryIndexSimplePk() { HashMap<String, String> types = new HashMap() { { http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DuplicateKeyValueClassesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DuplicateKeyValueClassesSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DuplicateKeyValueClassesSelfTest.java index 6eb1bb9..2b67214 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DuplicateKeyValueClassesSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DuplicateKeyValueClassesSelfTest.java @@ -22,11 +22,15 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Make sure that cache can start with multiple key-value classes of the same type. */ @SuppressWarnings("unchecked") +@RunWith(JUnit4.class) public class DuplicateKeyValueClassesSelfTest extends GridCommonAbstractTest { /** Cache name. */ private static final String CACHE_NAME = "cache"; @@ -48,6 +52,7 @@ public class DuplicateKeyValueClassesSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testDuplicateKeyClass() throws Exception { CacheConfiguration ccfg = new CacheConfiguration() .setName(CACHE_NAME) @@ -61,6 +66,7 @@ public class DuplicateKeyValueClassesSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testDuplicateValueClass() throws Exception { CacheConfiguration ccfg = new CacheConfiguration() .setName(CACHE_NAME) http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java index e6fd321..3bf0525 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java @@ -59,6 +59,9 @@ import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.T3; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgnitePredicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi; @@ -66,6 +69,7 @@ import static org.apache.ignite.internal.IgniteClientReconnectAbstractTest.TestT * Concurrency tests for dynamic index create/drop. */ @SuppressWarnings("unchecked") +@RunWith(JUnit4.class) public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicColumnsAbstractTest { /** Test duration. */ private static final long TEST_DUR = 10_000L; @@ -155,6 +159,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testAddColumnCoordinatorChange() throws Exception { checkCoordinatorChange(true); } @@ -164,6 +169,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testDropColumnCoordinatorChange() throws Exception { checkCoordinatorChange(false); } @@ -241,6 +247,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testOperationChaining() throws Exception { // 7 nodes * 2 columns = 14 latch countdowns. CountDownLatch finishLatch = new CountDownLatch(14); @@ -295,6 +302,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testNodeJoinOnPendingAddOperation() throws Exception { checkNodeJoinOnPendingOperation(true); } @@ -304,6 +312,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testNodeJoinOnPendingDropOperation() throws Exception { checkNodeJoinOnPendingOperation(false); } @@ -351,6 +360,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed, */ + @Test public void testConcurrentPutRemove() throws Exception { CountDownLatch finishLatch = new CountDownLatch(4); @@ -481,6 +491,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testAddConcurrentRebalance() throws Exception { checkConcurrentRebalance(true); } @@ -490,6 +501,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testDropConcurrentRebalance() throws Exception { checkConcurrentRebalance(false); } @@ -557,6 +569,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testAddConcurrentCacheDestroy() throws Exception { checkConcurrentCacheDestroy(true); } @@ -566,6 +579,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testDropConcurrentCacheDestroy() throws Exception { checkConcurrentCacheDestroy(false); } @@ -626,6 +640,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testQueryConsistencyMultithreaded() throws Exception { // Start complex topology. ignitionStart(serverConfiguration(1)); @@ -717,6 +732,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testClientReconnect() throws Exception { checkClientReconnect(false, true); } @@ -726,6 +742,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testClientReconnectWithCacheRestart() throws Exception { checkClientReconnect(true, true); } @@ -735,6 +752,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testClientReconnectWithNonDynamicCache() throws Exception { checkClientReconnect(false, false); } @@ -744,6 +762,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * * @throws Exception If failed. */ + @Test public void testClientReconnectWithNonDynamicCacheRestart() throws Exception { checkClientReconnect(true, false); } @@ -842,6 +861,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends DynamicCo * @throws Exception If failed. */ @SuppressWarnings("StringConcatenationInLoop") + @Test public void testConcurrentOperationsAndNodeStartStopMultithreaded() throws Exception { // Start several stable nodes. ignitionStart(serverConfiguration(1)); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java index dfc353b..176744b 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java @@ -38,6 +38,9 @@ import org.apache.ignite.internal.processors.query.IgniteSQLException; import org.apache.ignite.internal.processors.query.schema.SchemaOperationException; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; @@ -48,6 +51,7 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED; * Tests for dynamic index creation. */ @SuppressWarnings({"unchecked"}) +@RunWith(JUnit4.class) public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbstractSelfTest { /** Node index for regular server (coordinator). */ protected static final int IDX_SRV_CRD = 0; @@ -136,6 +140,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreatePartitionedAtomic() throws Exception { checkCreate(PARTITIONED, ATOMIC, false); } @@ -145,6 +150,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreatePartitionedAtomicNear() throws Exception { checkCreate(PARTITIONED, ATOMIC, true); } @@ -154,6 +160,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreatePartitionedTransactional() throws Exception { checkCreate(PARTITIONED, TRANSACTIONAL, false); } @@ -163,6 +170,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreatePartitionedTransactionalNear() throws Exception { checkCreate(PARTITIONED, TRANSACTIONAL, true); } @@ -172,6 +180,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateReplicatedAtomic() throws Exception { checkCreate(REPLICATED, ATOMIC, false); } @@ -181,6 +190,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateReplicatedTransactional() throws Exception { checkCreate(REPLICATED, TRANSACTIONAL, false); } @@ -220,6 +230,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateCompositePartitionedAtomic() throws Exception { checkCreateComposite(PARTITIONED, ATOMIC, false); } @@ -229,6 +240,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateCompositePartitionedAtomicNear() throws Exception { checkCreateComposite(PARTITIONED, ATOMIC, true); } @@ -238,6 +250,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateCompositePartitionedTransactional() throws Exception { checkCreateComposite(PARTITIONED, TRANSACTIONAL, false); } @@ -247,6 +260,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateCompositePartitionedTransactionalNear() throws Exception { checkCreateComposite(PARTITIONED, TRANSACTIONAL, true); } @@ -256,6 +270,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateCompositeReplicatedAtomic() throws Exception { checkCreateComposite(REPLICATED, ATOMIC, false); } @@ -265,6 +280,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateCompositeReplicatedTransactional() throws Exception { checkCreateComposite(REPLICATED, TRANSACTIONAL, false); } @@ -296,6 +312,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoCachePartitionedAtomic() throws Exception { checkCreateNotCache(PARTITIONED, ATOMIC, false); } @@ -305,6 +322,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoCachePartitionedAtomicNear() throws Exception { checkCreateNotCache(PARTITIONED, ATOMIC, true); } @@ -314,6 +332,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoCachePartitionedTransactional() throws Exception { checkCreateNotCache(PARTITIONED, TRANSACTIONAL, false); } @@ -323,6 +342,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoCachePartitionedTransactionalNear() throws Exception { checkCreateNotCache(PARTITIONED, TRANSACTIONAL, true); } @@ -332,6 +352,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoCacheReplicatedAtomic() throws Exception { checkCreateNotCache(REPLICATED, ATOMIC, false); } @@ -341,6 +362,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoCacheReplicatedTransactional() throws Exception { checkCreateNotCache(REPLICATED, TRANSACTIONAL, false); } @@ -382,6 +404,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateNoTablePartitionedAtomic() throws Exception { checkCreateNoTable(PARTITIONED, ATOMIC, false); } @@ -391,6 +414,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateNoTablePartitionedAtomicNear() throws Exception { checkCreateNoTable(PARTITIONED, ATOMIC, true); } @@ -400,6 +424,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateNoTablePartitionedTransactional() throws Exception { checkCreateNoTable(PARTITIONED, TRANSACTIONAL, false); } @@ -409,6 +434,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateNoTablePartitionedTransactionalNear() throws Exception { checkCreateNoTable(PARTITIONED, TRANSACTIONAL, true); } @@ -418,6 +444,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateNoTableReplicatedAtomic() throws Exception { checkCreateNoTable(REPLICATED, ATOMIC, false); } @@ -427,6 +454,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateNoTableReplicatedTransactional() throws Exception { checkCreateNoTable(REPLICATED, TRANSACTIONAL, false); } @@ -458,6 +486,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoColumnPartitionedAtomic() throws Exception { checkCreateIndexNoColumn(PARTITIONED, ATOMIC, false); } @@ -467,6 +496,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoColumnPartitionedAtomicNear() throws Exception { checkCreateIndexNoColumn(PARTITIONED, ATOMIC, true); } @@ -476,6 +506,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoColumnPartitionedTransactional() throws Exception { checkCreateIndexNoColumn(PARTITIONED, TRANSACTIONAL, false); } @@ -485,6 +516,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoColumnPartitionedTransactionalNear() throws Exception { checkCreateIndexNoColumn(PARTITIONED, TRANSACTIONAL, true); } @@ -494,6 +526,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoColumnReplicatedAtomic() throws Exception { checkCreateIndexNoColumn(REPLICATED, ATOMIC, false); } @@ -503,6 +536,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexNoColumnReplicatedTransactional() throws Exception { checkCreateIndexNoColumn(REPLICATED, TRANSACTIONAL, false); } @@ -534,6 +568,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexOnColumnWithAliasPartitionedAtomic() throws Exception { checkCreateIndexOnColumnWithAlias(PARTITIONED, ATOMIC, false); } @@ -543,6 +578,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexOnColumnWithAliasPartitionedAtomicNear() throws Exception { checkCreateIndexOnColumnWithAlias(PARTITIONED, ATOMIC, true); } @@ -552,6 +588,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexOnColumnWithAliasPartitionedTransactional() throws Exception { checkCreateIndexOnColumnWithAlias(PARTITIONED, TRANSACTIONAL, false); } @@ -561,6 +598,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateColumnWithAliasPartitionedTransactionalNear() throws Exception { checkCreateIndexOnColumnWithAlias(PARTITIONED, TRANSACTIONAL, true); } @@ -570,6 +608,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateColumnWithAliasReplicatedAtomic() throws Exception { checkCreateIndexOnColumnWithAlias(REPLICATED, ATOMIC, false); } @@ -579,6 +618,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateColumnWithAliasReplicatedTransactional() throws Exception { checkCreateIndexOnColumnWithAlias(REPLICATED, TRANSACTIONAL, false); } @@ -620,6 +660,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithInlineSizePartitionedAtomic() throws Exception { checkCreateIndexWithInlineSize(PARTITIONED, ATOMIC, false); } @@ -629,6 +670,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithInlineSizePartitionedAtomicNear() throws Exception { checkCreateIndexWithInlineSize(PARTITIONED, ATOMIC, true); } @@ -638,6 +680,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithInlineSizePartitionedTransactional() throws Exception { checkCreateIndexWithInlineSize(PARTITIONED, TRANSACTIONAL, false); } @@ -647,6 +690,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithInlineSizePartitionedTransactionalNear() throws Exception { checkCreateIndexWithInlineSize(PARTITIONED, TRANSACTIONAL, true); } @@ -656,6 +700,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithInlineSizeReplicatedAtomic() throws Exception { checkCreateIndexWithInlineSize(REPLICATED, ATOMIC, false); } @@ -665,6 +710,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithInlineSizeReplicatedTransactional() throws Exception { checkCreateIndexWithInlineSize(REPLICATED, TRANSACTIONAL, false); } @@ -750,6 +796,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithParallelismPartitionedAtomic() throws Exception { checkCreateIndexWithParallelism(PARTITIONED, ATOMIC, false); } @@ -759,6 +806,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithParallelismPartitionedAtomicNear() throws Exception { checkCreateIndexWithParallelism(PARTITIONED, ATOMIC, true); } @@ -768,6 +816,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithParallelismPartitionedTransactional() throws Exception { checkCreateIndexWithParallelism(PARTITIONED, TRANSACTIONAL, false); } @@ -777,6 +826,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithParallelismPartitionedTransactionalNear() throws Exception { checkCreateIndexWithParallelism(PARTITIONED, TRANSACTIONAL, true); } @@ -786,6 +836,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithParallelismReplicatedAtomic() throws Exception { checkCreateIndexWithParallelism(REPLICATED, ATOMIC, false); } @@ -795,6 +846,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testCreateIndexWithParallelismReplicatedTransactional() throws Exception { checkCreateIndexWithParallelism(REPLICATED, TRANSACTIONAL, false); } @@ -879,6 +931,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropPartitionedAtomic() throws Exception { checkDrop(PARTITIONED, ATOMIC, false); } @@ -888,6 +941,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropPartitionedAtomicNear() throws Exception { checkDrop(PARTITIONED, ATOMIC, true); } @@ -897,6 +951,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropPartitionedTransactional() throws Exception { checkDrop(PARTITIONED, TRANSACTIONAL, false); } @@ -906,6 +961,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropPartitionedTransactionalNear() throws Exception { checkDrop(PARTITIONED, TRANSACTIONAL, true); } @@ -915,6 +971,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropReplicatedAtomic() throws Exception { checkDrop(REPLICATED, ATOMIC, false); } @@ -924,6 +981,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropReplicatedTransactional() throws Exception { checkDrop(REPLICATED, TRANSACTIONAL, false); } @@ -975,6 +1033,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoIndexPartitionedAtomic() throws Exception { checkDropNoIndex(PARTITIONED, ATOMIC, false); } @@ -984,6 +1043,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoIndexPartitionedAtomicNear() throws Exception { checkDropNoIndex(PARTITIONED, ATOMIC, true); } @@ -993,6 +1053,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoIndexPartitionedTransactional() throws Exception { checkDropNoIndex(PARTITIONED, TRANSACTIONAL, false); } @@ -1002,6 +1063,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoIndexPartitionedTransactionalNear() throws Exception { checkDropNoIndex(PARTITIONED, TRANSACTIONAL, true); } @@ -1011,6 +1073,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoIndexReplicatedAtomic() throws Exception { checkDropNoIndex(REPLICATED, ATOMIC, false); } @@ -1020,6 +1083,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoIndexReplicatedTransactional() throws Exception { checkDropNoIndex(REPLICATED, TRANSACTIONAL, false); } @@ -1050,6 +1114,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoCachePartitionedAtomic() throws Exception { checkDropNoCache(PARTITIONED, ATOMIC, false); } @@ -1059,6 +1124,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoCachePartitionedAtomicNear() throws Exception { checkDropNoCache(PARTITIONED, ATOMIC, true); } @@ -1068,6 +1134,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoCachePartitionedTransactional() throws Exception { checkDropNoCache(PARTITIONED, TRANSACTIONAL, false); } @@ -1077,6 +1144,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoCachePartitionedTransactionalNear() throws Exception { checkDropNoCache(PARTITIONED, TRANSACTIONAL, true); } @@ -1086,6 +1154,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoCacheReplicatedAtomic() throws Exception { checkDropNoCache(REPLICATED, ATOMIC, false); } @@ -1095,6 +1164,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testDropNoCacheReplicatedTransactional() throws Exception { checkDropNoCache(REPLICATED, TRANSACTIONAL, false); } @@ -1136,6 +1206,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testFailOnLocalCache() throws Exception { for (Ignite node : Ignition.allGrids()) { if (!node.configuration().isClientMode()) @@ -1164,6 +1235,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst * * @throws Exception If failed. */ + @Test public void testNonSqlCache() throws Exception { final QueryIndex idx = index(IDX_NAME_2, field(FIELD_NAME_1)); @@ -1177,6 +1249,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst /** * Test behavior depending on index name case sensitivity. */ + @Test public void testIndexNameCaseSensitivity() throws Exception { doTestIndexNameCaseSensitivity("myIdx", false); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java index ca47c7f..807e01b 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java @@ -51,6 +51,9 @@ import org.apache.ignite.internal.processors.query.schema.SchemaOperationExcepti import org.apache.ignite.internal.util.typedef.T3; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi; @@ -58,6 +61,7 @@ import static org.apache.ignite.internal.IgniteClientReconnectAbstractTest.TestT * Concurrency tests for dynamic index create/drop. */ @SuppressWarnings("unchecked") +@RunWith(JUnit4.class) public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicIndexAbstractSelfTest { /** Test duration. */ private static final long TEST_DUR = 10_000L; @@ -136,6 +140,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testCoordinatorChange() throws Exception { // Start servers. Ignite srv1 = ignitionStart(serverConfiguration(1)); @@ -201,6 +206,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testOperationChaining() throws Exception { Ignite srv1 = ignitionStart(serverConfiguration(1)); @@ -253,6 +259,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testNodeJoinOnPendingOperation() throws Exception { Ignite srv1 = ignitionStart(serverConfiguration(1)); @@ -290,6 +297,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed, */ + @Test public void testConcurrentPutRemove() throws Exception { // Start several nodes. Ignite srv1 = ignitionStart(serverConfiguration(1)); @@ -387,6 +395,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testConcurrentRebalance() throws Exception { // Start cache and populate it with data. Ignite srv1 = ignitionStart(serverConfiguration(1)); @@ -434,6 +443,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testConcurrentCacheDestroy() throws Exception { // Start complex topology. Ignite srv1 = ignitionStart(serverConfiguration(1)); @@ -479,6 +489,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testConcurrentOperationsMultithreaded() throws Exception { // Start complex topology. ignitionStart(serverConfiguration(1)); @@ -553,6 +564,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testQueryConsistencyMultithreaded() throws Exception { // Start complex topology. ignitionStart(serverConfiguration(1)); @@ -631,6 +643,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testClientReconnect() throws Exception { checkClientReconnect(false); } @@ -640,6 +653,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testClientReconnectWithCacheRestart() throws Exception { checkClientReconnect(true); } @@ -753,6 +767,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testConcurrentOperationsAndNodeStartStopMultithreaded() throws Exception { // Start several stable nodes. ignitionStart(serverConfiguration(1)); @@ -878,6 +893,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde * * @throws Exception If failed. */ + @Test public void testConcurrentOperationsAndCacheStartStopMultithreaded() throws Exception { // Start complex topology. ignitionStart(serverConfiguration(1)); @@ -1096,7 +1112,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde /** * Start a node. - * + * * @param cfg Configuration. * @return Ignite instance. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java index d8d6735..8dc0b62 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java @@ -28,10 +28,14 @@ import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing; import org.apache.ignite.internal.util.lang.GridAbsPredicate; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test for leaks JdbcConnection on SqlFieldsQuery execute. */ +@RunWith(JUnit4.class) public class H2ConnectionLeaksSelfTest extends GridCommonAbstractTest { /** Cache name. */ private static final String CACHE_NAME = "cache"; @@ -73,6 +77,7 @@ public class H2ConnectionLeaksSelfTest extends GridCommonAbstractTest { /** * @throws Exception On failed. */ + @Test public void testConnectionLeaks() throws Exception { final IgniteCache cache = grid(1).cache(CACHE_NAME); @@ -98,6 +103,7 @@ public class H2ConnectionLeaksSelfTest extends GridCommonAbstractTest { /** * @throws Exception On failed. */ + @Test public void testConnectionLeaksOnSqlException() throws Exception { final CountDownLatch latch = new CountDownLatch(THREAD_CNT); final CountDownLatch latch2 = new CountDownLatch(1); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java index ef7b150..846e9f1 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java @@ -33,12 +33,16 @@ import org.apache.ignite.internal.processors.query.QueryField; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.testframework.config.GridTestProperties; import org.h2.jdbc.JdbcSQLException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.testframework.config.GridTestProperties.BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER; /** * Test to check dynamic columns related features. */ +@RunWith(JUnit4.class) public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColumnsAbstractTest { /** * Index of coordinator node. @@ -105,6 +109,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test column addition to the end of the columns list. */ + @Test public void testAddColumnSimple() throws SQLException { run("ALTER TABLE Person ADD COLUMN age int"); @@ -118,6 +123,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test column addition to the end of the columns list. */ + @Test public void testAddFewColumnsSimple() throws SQLException { run("ALTER TABLE Person ADD COLUMN (age int, \"city\" varchar)"); @@ -130,6 +136,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test {@code IF EXISTS} handling. */ + @Test public void testIfTableExists() { run("ALTER TABLE if exists City ADD COLUMN population int"); } @@ -137,6 +144,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test {@code IF NOT EXISTS} handling. */ + @Test public void testIfColumnNotExists() { run("ALTER TABLE Person ADD COLUMN if not exists name varchar"); } @@ -144,6 +152,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test {@code IF NOT EXISTS} handling. */ + @Test public void testDuplicateColumnName() { assertThrows("ALTER TABLE Person ADD COLUMN name varchar", "Column already exists: NAME"); } @@ -151,12 +160,14 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test behavior in case of missing table. */ + @Test public void testMissingTable() { assertThrows("ALTER TABLE City ADD COLUMN name varchar", "Table doesn't exist: CITY"); } /** */ @SuppressWarnings("unchecked") + @Test public void testComplexOperations() { IgniteCache<BinaryObject, BinaryObject> cache = ignite(nodeIndex()) .cache(QueryUtils.createTableCacheName(QueryUtils.DFLT_SCHEMA, "PERSON")); @@ -229,6 +240,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test that we can add columns dynamically to tables associated with non dynamic caches as well. */ + @Test public void testAddColumnToNonDynamicCache() throws SQLException { run("ALTER TABLE \"idx\".PERSON ADD COLUMN CITY varchar"); @@ -243,6 +255,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * Test that we can add columns dynamically to tables associated with non dynamic caches storing user types as well. */ @SuppressWarnings("unchecked") + @Test public void testAddColumnToNonDynamicCacheWithRealValueType() throws SQLException { CacheConfiguration<Integer, City> ccfg = defaultCacheConfiguration().setName("City") .setIndexedTypes(Integer.class, City.class); @@ -289,6 +302,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * @throws SQLException If failed. */ @SuppressWarnings("unchecked") + @Test public void testAddColumnUUID() throws SQLException { CacheConfiguration<Integer, Object> ccfg = defaultCacheConfiguration().setName("GuidTest") .setIndexedTypes(Integer.class, GuidTest.class); @@ -356,6 +370,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test addition of column with not null constraint. */ + @Test public void testAddNotNullColumn() throws SQLException { run("ALTER TABLE Person ADD COLUMN age int NOT NULL"); @@ -369,6 +384,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test addition of column explicitly defined as nullable. */ + @Test public void testAddNullColumn() throws SQLException { run("ALTER TABLE Person ADD COLUMN age int NULL"); @@ -383,6 +399,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * Test that {@code ADD COLUMN} fails for non dynamic table that has flat value. */ @SuppressWarnings({"unchecked"}) + @Test public void testTestAlterTableOnFlatValueNonDynamicTable() { CacheConfiguration c = new CacheConfiguration("ints").setIndexedTypes(Integer.class, Integer.class) @@ -401,6 +418,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum /** * Test that {@code ADD COLUMN} fails for dynamic table that has flat value. */ + @Test public void testTestAlterTableOnFlatValueDynamicTable() { try { run("CREATE TABLE TEST (id int primary key, x varchar) with \"wrap_value=false\""); @@ -416,6 +434,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumn() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT, b CHAR)"); @@ -444,6 +463,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDroppedColumnMeta() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT, b CHAR)"); @@ -466,6 +486,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropMultipleColumns() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT, b CHAR, c INT)"); @@ -491,6 +512,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropNonExistingColumn() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT)"); @@ -506,6 +528,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnNonExistingTable() throws Exception { assertThrowsAnyCause("ALTER TABLE nosuchtable DROP COLUMN a", JdbcSQLException.class, "Table \"NOSUCHTABLE\" not found"); @@ -515,6 +538,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnIfTableExists() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT, b CHAR)"); @@ -534,6 +558,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnIfExists() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT)"); @@ -554,6 +579,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnIndexPresent() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, a INT, b INT)"); @@ -580,6 +606,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnOnRealClassValuedTable() throws Exception { try { run("CREATE TABLE test (id INT PRIMARY KEY, x VARCHAR) with \"wrap_value=false\""); @@ -596,6 +623,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnThatIsPartOfKey() throws Exception { try { run("CREATE TABLE test(id INT, a INT, b CHAR, PRIMARY KEY(id, a))"); @@ -612,6 +640,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnThatIsKey() throws Exception { try { run("CREATE TABLE test(id INT PRIMARY KEY, a INT, b CHAR)"); @@ -628,6 +657,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnThatIsValue() throws Exception { try { run("CREATE TABLE test(id INT PRIMARY KEY, a INT, b CHAR)"); @@ -647,6 +677,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * @throws SQLException if failed. */ @SuppressWarnings("unchecked") + @Test public void testDropColumnFromNonDynamicCacheWithRealValueType() throws SQLException { CacheConfiguration<Integer, City> ccfg = defaultCacheConfiguration().setName("City") .setIndexedTypes(Integer.class, City.class); @@ -712,6 +743,7 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum * * @throws Exception if failed. */ + @Test public void testDropColumnPriorToIndexedColumn() throws Exception { try { run("CREATE TABLE test(id INT PRIMARY KEY, a CHAR, b INT)"); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexAbstractSelfTest.java index 2d7a636..d8e6a70 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexAbstractSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexAbstractSelfTest.java @@ -34,10 +34,14 @@ import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode; import org.apache.ignite.internal.util.typedef.F; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Test that checks indexes handling on H2 side. */ +@RunWith(JUnit4.class) public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfTest { /** Client node index. */ private static final int CLIENT = 2; @@ -75,6 +79,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that after index creation index is used by queries. */ + @Test public void testCreateIndex() throws Exception { IgniteCache<KeyClass, ValueClass> cache = cache(); @@ -114,6 +119,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that creating an index with duplicate name yields an error. */ + @Test public void testCreateIndexWithDuplicateName() { final IgniteCache<KeyClass, ValueClass> cache = cache(); @@ -131,6 +137,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that creating an index with duplicate name does not yield an error with {@code IF NOT EXISTS}. */ + @Test public void testCreateIndexIfNotExists() { final IgniteCache<KeyClass, ValueClass> cache = cache(); @@ -144,6 +151,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that after index drop there are no attempts to use it, and data state remains intact. */ + @Test public void testDropIndex() { IgniteCache<KeyClass, ValueClass> cache = cache(); @@ -179,6 +187,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that dropping a non-existent index yields an error. */ + @Test public void testDropMissingIndex() { final IgniteCache<KeyClass, ValueClass> cache = cache(); @@ -192,6 +201,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that dropping a non-existent index does not yield an error with {@code IF EXISTS}. */ + @Test public void testDropMissingIndexIfExists() { final IgniteCache<KeyClass, ValueClass> cache = cache(); @@ -201,6 +211,7 @@ public abstract class H2DynamicIndexAbstractSelfTest extends AbstractSchemaSelfT /** * Test that changes in cache affect index, and vice versa. */ + @Test public void testIndexState() { IgniteCache<KeyClass, ValueClass> cache = cache(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexAbstractTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexAbstractTest.java index 6fa595f..fd6728f 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexAbstractTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexAbstractTest.java @@ -31,10 +31,14 @@ import org.apache.ignite.internal.processors.query.IgniteSQLException; import org.apache.ignite.lang.IgniteCallable; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Base class for testing work of combinations of DML and DDL operations. */ +@RunWith(JUnit4.class) public abstract class H2DynamicIndexingComplexAbstractTest extends DynamicIndexAbstractSelfTest { /** Cache mode to test with. */ private final CacheMode cacheMode; @@ -88,6 +92,7 @@ public abstract class H2DynamicIndexingComplexAbstractTest extends DynamicIndexA } /** Do test. */ + @Test public void testOperations() { executeSql("CREATE TABLE person (id int, name varchar, age int, company varchar, city varchar, " + "primary key (id, name, city)) WITH \"template=" + cacheMode.name() + ",atomicity=" + atomicityMode.name() +
