Repository: ignite
Updated Branches:
  refs/heads/master 7256e5752 -> 94fce9743


IGNITE-10820 Clean up static Ignite instances in tests - Fixes #5752.

Signed-off-by: Alexey Goncharuk <alexey.goncha...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/94fce974
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/94fce974
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/94fce974

Branch: refs/heads/master
Commit: 94fce9743b89b2fc5f603fb9eb46671393af55e2
Parents: 7256e57
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
Authored: Sat Dec 29 11:22:47 2018 +0300
Committer: Alexey Goncharuk <alexey.goncha...@gmail.com>
Committed: Sat Dec 29 11:22:47 2018 +0300

----------------------------------------------------------------------
 .../RendezvousAffinityFunctionSelfTest.java     |   7 ++
 ...ndezvousAffinityFunctionSimpleBenchmark.java |   7 ++
 .../ignite/internal/ClusterGroupSelfTest.java   |   7 ++
 .../internal/GridCommunicationSelfTest.java     |   7 ++
 .../ignite/internal/GridDiscoverySelfTest.java  |   7 ++
 .../internal/GridEventStorageSelfTest.java      |   8 ++
 .../GridFailedInputParametersSelfTest.java      |   7 ++
 .../GridJobStealingZeroActiveJobsSelfTest.java  |   1 +
 ...ProjectionForCachesOnDaemonNodeSelfTest.java |   8 ++
 .../distributed/GridCacheLockAbstractTest.java  |  11 ++
 .../SortedEvictionPolicyPerformanceTest.java    |   7 ++
 .../GridCacheLocalByteArrayValuesSelfTest.java  |   1 +
 .../GridInternalTasksLoadBalancingSelfTest.java |   7 ++
 .../cache/IgniteCacheDistributedJoinTest.java   |   2 +
 .../cache/IgniteCacheOffheapIndexScanTest.java  |   7 ++
 .../cache/IgniteCacheUnionDuplicatesTest.java   |   7 ++
 .../IgniteCacheReplicatedQuerySelfTest.java     |  13 ++
 ...teSqlSkipReducerOnUpdateDmlFlagSelfTest.java | 118 ++++++++-----------
 ...IgniteSqlSkipReducerOnUpdateDmlSelfTest.java |   2 +
 .../processors/query/RunningQueriesTest.java    |   2 +
 .../processors/query/SqlSchemaSelfTest.java     |   2 +
 .../query/h2/sql/ExplainSelfTest.java           |   3 +
 .../h2/twostep/TableViewSubquerySelfTest.java   |   8 ++
 23 files changed, 183 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSelfTest.java
index 7fa2dc7..d26f883 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSelfTest.java
@@ -35,6 +35,13 @@ public class RendezvousAffinityFunctionSelfTest extends 
AbstractAffinityFunction
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected AffinityFunction affinityFunction() {
         AffinityFunction aff = new RendezvousAffinityFunction();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
 
b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
index abc6455..44963cc 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
@@ -97,6 +97,13 @@ public class RendezvousAffinityFunctionSimpleBenchmark 
extends GridCommonAbstrac
         ignite = startGrid();
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
     /**
      * @param nodesCnt Count of nodes to generate.
      * @return Nodes list.

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/ClusterGroupSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/ClusterGroupSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/ClusterGroupSelfTest.java
index 3816513..54834ad 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/ClusterGroupSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/ClusterGroupSelfTest.java
@@ -80,6 +80,13 @@ public class ClusterGroupSelfTest extends 
ClusterGroupAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected ClusterGroup projection() {
         return grid(0).cluster().forPredicate(F.nodeForNodeIds(ids));
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/GridCommunicationSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridCommunicationSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/GridCommunicationSelfTest.java
index 2bfd979..11060af 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/GridCommunicationSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/GridCommunicationSelfTest.java
@@ -50,6 +50,13 @@ public class GridCommunicationSelfTest extends 
GridCommonAbstractTest {
         ignite = G.ignite(getTestIgniteInstanceName());
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoverySelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoverySelfTest.java
index d07e06b..f0d6fff 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoverySelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoverySelfTest.java
@@ -90,6 +90,13 @@ public class GridDiscoverySelfTest extends 
GridCommonAbstractTest {
         ignite = G.ignite(getTestIgniteInstanceName());
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageSelfTest.java
index 1218598..a2c4718 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageSelfTest.java
@@ -83,6 +83,14 @@ public class GridEventStorageSelfTest extends 
GridCommonAbstractTest {
         stopAllGrids();
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite1 = null;
+        ignite2 = null;
+    }
+
     /**
      * @throws Exception In case of error.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/GridFailedInputParametersSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridFailedInputParametersSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/GridFailedInputParametersSelfTest.java
index a8437f9..024732f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/GridFailedInputParametersSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/GridFailedInputParametersSelfTest.java
@@ -48,6 +48,13 @@ public class GridFailedInputParametersSelfTest extends 
GridCommonAbstractTest {
         ignite = G.ignite(getTestIgniteInstanceName());
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
     /**
      * @throws Exception Thrown in case of any errors.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
index aee0e48..7ff11df 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
@@ -69,6 +69,7 @@ public class GridJobStealingZeroActiveJobsSelfTest extends 
GridCommonAbstractTes
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         ignite1 = null;
+        ignite2 = null;
 
         stopGrid(1);
         stopGrid(2);

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
index 068ebcf..15dab07 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
@@ -61,6 +61,14 @@ public class GridProjectionForCachesOnDaemonNodeSelfTest 
extends GridCommonAbstr
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+        daemon = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
         ignite.getOrCreateCache(DEFAULT_CACHE_NAME);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheLockAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheLockAbstractTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheLockAbstractTest.java
index 6d5ac30..bae5948 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheLockAbstractTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheLockAbstractTest.java
@@ -116,6 +116,17 @@ public abstract class GridCacheLockAbstractTest extends 
GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite1 = null;
+        ignite2 = null;
+
+        cache1 = null;
+        cache2 = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         super.afterTest();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java
index 554bbbe..419e947 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java
@@ -66,6 +66,13 @@ public class SortedEvictionPolicyPerformanceTest extends 
GridCommonAbstractTest
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalByteArrayValuesSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalByteArrayValuesSelfTest.java
index 8a76f6d..4949943 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalByteArrayValuesSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalByteArrayValuesSelfTest.java
@@ -86,6 +86,7 @@ public class GridCacheLocalByteArrayValuesSelfTest extends 
GridCacheAbstractByte
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         cache = null;
+        ignite = null;
 
         stopAllGrids();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/internal/GridInternalTasksLoadBalancingSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/internal/GridInternalTasksLoadBalancingSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/internal/GridInternalTasksLoadBalancingSelfTest.java
index 59c1df6..640d71f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/internal/GridInternalTasksLoadBalancingSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/internal/GridInternalTasksLoadBalancingSelfTest.java
@@ -72,6 +72,13 @@ public class GridInternalTasksLoadBalancingSelfTest extends 
GridCommonAbstractTe
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java
index 40e261d..67414d1 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java
@@ -221,6 +221,8 @@ public class IgniteCacheDistributedJoinTest extends 
GridCommonAbstractTest {
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         U.closeQuiet(conn);
+
+        conn = null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
index 4cf7d77..50461b5 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
@@ -64,6 +64,13 @@ public class IgniteCacheOffheapIndexScanTest extends 
GridCommonAbstractTest {
         cache = grid(0).cache(DEFAULT_CACHE_NAME);
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        cache = null;
+    }
+
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUnionDuplicatesTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUnionDuplicatesTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUnionDuplicatesTest.java
index dfb65f5..0157736 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUnionDuplicatesTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUnionDuplicatesTest.java
@@ -74,6 +74,13 @@ public class IgniteCacheUnionDuplicatesTest extends 
AbstractH2CompareQueryTest {
         // No-op.
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        pCache = null;
+    }
+
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
index e2602ad..11205f3 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
@@ -117,6 +117,19 @@ public class IgniteCacheReplicatedQuerySelfTest extends 
IgniteCacheAbstractQuery
         cache3 = jcache(ignite3, CacheKey.class, CacheValue.class);
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        ignite1 = null;
+        ignite2 = null;
+        ignite3 = null;
+
+        cache1 = null;
+        cache2 = null;
+        cache3 = null;
+    }
+
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest.java
index 3b4c761..42cfc1b 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest.java
@@ -43,25 +43,25 @@ import org.junit.runners.JUnit4;
 @RunWith(JUnit4.class)
 public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest extends 
GridCommonAbstractTest {
     /** */
-    private static int NODE_COUNT = 4;
+    private static final int NODE_COUNT = 4;
 
     /** */
-    private static String NODE_CLIENT = "client";
+    private static final String NODE_CLIENT = "client";
 
     /** */
-    private static String CACHE_ACCOUNT = "acc";
+    private static final String CACHE_ACCOUNT = "acc";
 
     /** */
-    private static String CACHE_REPORT = "rep";
+    private static final String CACHE_REPORT = "rep";
 
     /** */
-    private static String CACHE_STOCK = "stock";
+    private static final String CACHE_STOCK = "stock";
 
     /** */
-    private static String CACHE_TRADE = "trade";
+    private static final String CACHE_TRADE = "trade";
 
     /** */
-    private static String CACHE_LIST = "list";
+    private static final String CACHE_LIST = "list";
 
     /** */
     private static IgniteEx client;
@@ -160,7 +160,7 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
         startGrids(NODE_COUNT);
 
-        client = (IgniteEx)startGrid(NODE_CLIENT);
+        client = startGrid(NODE_CLIENT);
 
         awaitPartitionMapExchange();
     }
@@ -178,53 +178,56 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
         client.cache(CACHE_LIST).clear();
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        client = null;
+    }
+
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testUpdate() throws Exception {
+    public void testUpdate() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
 
         String text = "UPDATE \"acc\".Account SET depo = depo - ? WHERE depo > 
0";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts, 
new SqlFieldsQueryEx(text, false).setArgs(10));
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts, new 
SqlFieldsQueryEx(text, false).setArgs(10));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testUpdateFastKey() throws Exception {
+    public void testUpdateFastKey() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
 
         String text = "UPDATE \"acc\".Account SET depo = depo - ? WHERE _key = 
?";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts,
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts,
             new SqlFieldsQueryEx(text, false).setArgs(10, 1));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testUpdateLimit() throws Exception {
+    public void testUpdateLimit() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
 
         String text = "UPDATE \"acc\".Account SET depo = depo - ? WHERE sn >= 
? AND sn < ? LIMIT ?";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts,
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts,
             new SqlFieldsQueryEx(text, false).setArgs(10, 0, 10, 10));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testUpdateWhereSubquery() throws Exception {
+    public void testUpdateWhereSubquery() {
         Map<Integer, Account> accounts = getAccounts(100, 1, -100);
 
         Map<Integer, Trade> trades = getTrades(100, 2);
@@ -234,16 +237,15 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
         String text = "UPDATE \"trade\".Trade t SET qty = ? " +
             "WHERE accountId IN (SELECT p._key FROM \"acc\".Account p WHERE 
depo < ?)";
 
-        checkUpdate(client.<Integer, Trade>cache(CACHE_TRADE), trades,
+        checkUpdate(client.cache(CACHE_TRADE), trades,
             new SqlFieldsQueryEx(text, false).setArgs(0, 0));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testUpdateSetSubquery() throws Exception {
+    public void testUpdateSetSubquery() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
         Map<Integer, Trade> trades = getTrades(100, 2);
 
@@ -252,16 +254,15 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
         String text = "UPDATE \"trade\".Trade t SET qty = " +
             "(SELECT a.depo/t.price FROM \"acc\".Account a WHERE t.accountId = 
a._key)";
 
-        checkUpdate(client.<Integer, Trade>cache(CACHE_TRADE), trades,
+        checkUpdate(client.cache(CACHE_TRADE), trades,
             new SqlFieldsQueryEx(text, false));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testUpdateSetTableSubquery() throws Exception {
+    public void testUpdateSetTableSubquery() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
         Map<Integer, Trade> trades = getTrades(100, 2);
 
@@ -270,16 +271,15 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
         String text = "UPDATE \"trade\".Trade t SET (qty) = " +
             "(SELECT a.depo/t.price FROM \"acc\".Account a WHERE t.accountId = 
a._key)";
 
-        checkUpdate(client.<Integer, Trade>cache(CACHE_TRADE), trades,
+        checkUpdate(client.cache(CACHE_TRADE), trades,
             new SqlFieldsQueryEx(text, false));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertValues() throws Exception {
+    public void testInsertValues() {
         String text = "INSERT INTO \"acc\".Account (_key, name, sn, depo)" +
             " VALUES (?, ?, ?, ?), (?, ?, ?, ?)";
 
@@ -289,10 +289,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertFromSelect() throws Exception {
+    public void testInsertFromSelect() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
@@ -306,10 +305,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertFromSelectOrderBy() throws Exception {
+    public void testInsertFromSelectOrderBy() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
@@ -324,10 +322,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertFromSelectUnion() throws Exception {
+    public void testInsertFromSelectUnion() {
         Map<Integer, Account> accounts = getAccounts(20, 1, 1000);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
@@ -343,10 +340,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertFromSelectGroupBy() throws Exception {
+    public void testInsertFromSelectGroupBy() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
         Map<Integer, Trade> trades = getTrades(100, 2);
 
@@ -364,10 +360,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertFromSelectDistinct() throws Exception {
+    public void testInsertFromSelectDistinct() {
         Map<Integer, Account> accounts = getAccounts(100, 2, 100);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
@@ -381,10 +376,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testInsertFromSelectJoin() throws Exception {
+    public void testInsertFromSelectJoin() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
         Map<Integer, Stock> stocks = getStocks(5);
 
@@ -401,42 +395,39 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testDelete() throws Exception {
+    public void testDelete() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
 
         String text = "DELETE FROM \"acc\".Account WHERE sn > ?";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts,
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts,
             new SqlFieldsQueryEx(text, false).setArgs(10));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testDeleteTop() throws Exception {
+    public void testDeleteTop() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
 
         String text = "DELETE TOP ? FROM \"acc\".Account WHERE sn < ?";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts,
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts,
             new SqlFieldsQueryEx(text, false).setArgs(10, 10));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testDeleteWhereSubquery() throws Exception {
+    public void testDeleteWhereSubquery() {
         Map<Integer, Account> accounts = getAccounts(20, 1, 100);
         Map<Integer, Trade> trades = getTrades(10, 2);
 
@@ -446,31 +437,29 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
         String text = "DELETE FROM \"acc\".Account " +
             "WHERE _key IN (SELECT t.accountId FROM \"trade\".Trade t)";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts,
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts,
             new SqlFieldsQueryEx(text, false));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testMergeValues() throws Exception {
+    public void testMergeValues() {
         Map<Integer, Account> accounts = getAccounts(1, 1, 100);
 
         String text = "MERGE INTO \"acc\".Account (_key, name, sn, depo)" +
             " VALUES (?, ?, ?, ?), (?, ?, ?, ?)";
 
-        checkUpdate(client.<Integer, Account>cache(CACHE_ACCOUNT), accounts,
+        checkUpdate(client.cache(CACHE_ACCOUNT), accounts,
             new SqlFieldsQueryEx(text, false).setArgs(0, "John Marry", 11111, 
100, 1, "Marry John", 11112, 200));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testMergeFromSelectJoin() throws Exception {
+    public void testMergeFromSelectJoin() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 100);
         Map<Integer, Stock> stocks = getStocks(5);
 
@@ -485,16 +474,15 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
             "SELECT 5*a._key + s._key, a._key, s._key, ?, a.depo/? " +
             "FROM \"acc\".Account a JOIN \"stock\".Stock s ON 1=1";
 
-        checkUpdate(client.<Integer, Trade>cache(CACHE_TRADE), trades,
+        checkUpdate(client.cache(CACHE_TRADE), trades,
             new SqlFieldsQueryEx(text, false).setArgs(10, 10));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testMergeFromSelectOrderBy() throws Exception {
+    public void testMergeFromSelectOrderBy() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
 
         client.cache(CACHE_ACCOUNT).putAll(accounts);
@@ -507,16 +495,15 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
             "SELECT a._key, a._key, ?, a.depo/?, ? FROM \"acc\".Account a " +
             "ORDER BY a.sn DESC";
 
-        checkUpdate(client.<Integer, Trade>cache(CACHE_TRADE), trades,
+        checkUpdate(client.cache(CACHE_TRADE), trades,
             new SqlFieldsQueryEx(text, false).setArgs(1, 10, 10));
     }
 
     /**
      *
-     * @throws Exception If failed.
      */
     @Test
-    public void testMergeFromSelectGroupBy() throws Exception {
+    public void testMergeFromSelectGroupBy() {
         Map<Integer, Account> accounts = getAccounts(100, 1, 1000);
         Map<Integer, Trade> trades = getTrades(100, 2);
 
@@ -587,9 +574,8 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
         int count = 0;
 
         for (int i = 0; i < numAccounts; ++i) {
-            for (int j = 0; j < numStocks; ++j) {
+            for (int j = 0; j < numStocks; ++j)
                 res.put(count++, new Trade(i, j, 100, 100));
-            }
         }
 
         return res;
@@ -635,7 +621,7 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
     }
 
     /** */
-    public class Account {
+    public static class Account {
         /** */
         @QuerySqlField
         String name;
@@ -681,7 +667,7 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
     }
 
     /** */
-    public class Stock {
+    public static class Stock {
         /** */
         @QuerySqlField
         String ticker;
@@ -703,7 +689,7 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
     }
 
     /** */
-    public class Trade {
+    public static class Trade {
         /** */
         @QuerySqlField
         int accountId;
@@ -757,7 +743,7 @@ public class IgniteSqlSkipReducerOnUpdateDmlFlagSelfTest 
extends GridCommonAbstr
     }
 
     /** */
-    public class Report {
+    public static class Report {
         /** */
         @QuerySqlField
         int accountId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
index f41d52f..ad4102d 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
@@ -174,6 +174,8 @@ public class IgniteSqlSkipReducerOnUpdateDmlSelfTest 
extends GridCommonAbstractT
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         checkNoLeaks();
+
+        client = null;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
index a98bd66..810f418 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
@@ -122,6 +122,8 @@ public class RunningQueriesTest extends 
GridCommonAbstractTest {
         super.afterTestsStopped();
 
         stopAllGrids();
+
+        ignite = null;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
index b02ef49..19aa991 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
@@ -62,6 +62,8 @@ public class SqlSchemaSelfTest extends GridCommonAbstractTest 
{
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
+
+        node = null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/ExplainSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/ExplainSelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/ExplainSelfTest.java
index 8e3f881..53a68dd 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/ExplainSelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/ExplainSelfTest.java
@@ -57,6 +57,9 @@ public class ExplainSelfTest extends GridCommonAbstractTest {
             stopAllGrids();
         }
         finally {
+            ignite = null;
+            cache = null;
+
             super.afterTestsStopped();
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/94fce974/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/twostep/TableViewSubquerySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/twostep/TableViewSubquerySelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/twostep/TableViewSubquerySelfTest.java
index 677344d..d29f9ee 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/twostep/TableViewSubquerySelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/twostep/TableViewSubquerySelfTest.java
@@ -51,6 +51,14 @@ public class TableViewSubquerySelfTest extends 
GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ignite = null;
+        initCache = null;
+    }
+
+    /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
     }

Reply via email to