You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/27 07:13:30 UTC

[14/36] ignite git commit: IGNITE-3488: Prohibited null as cache name. This closes #1790.

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
index 91e6cf6..55d7fe4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java
@@ -61,6 +61,7 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
+import org.jetbrains.annotations.NotNull;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_ASYNC;
@@ -139,13 +140,13 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testSingleKeyCommitFromPrimary() throws Exception {
-        singleKeyCommitFromPrimary(cacheConfiguration(null, PRIMARY_SYNC, 1, true, false));
+        singleKeyCommitFromPrimary(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 1, true, false));
 
-        singleKeyCommitFromPrimary(cacheConfiguration(null, PRIMARY_SYNC, 2, false, false));
+        singleKeyCommitFromPrimary(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, false));
 
-        singleKeyCommitFromPrimary(cacheConfiguration(null, PRIMARY_SYNC, 2, false, true));
+        singleKeyCommitFromPrimary(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, true));
 
-        singleKeyCommitFromPrimary(cacheConfiguration(null, PRIMARY_SYNC, 3, false, false));
+        singleKeyCommitFromPrimary(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 3, false, false));
     }
 
     /**
@@ -228,7 +229,7 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
             Ignite node = ignite(i);
 
             if (node != ignite)
-                assertNull(node.cache(null).localPeek(key));
+                assertNull(node.cache(DEFAULT_CACHE_NAME).localPeek(key));
         }
 
         commSpi0.stopBlock(true);
@@ -252,18 +253,18 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testSingleKeyPrimaryNodeFail1() throws Exception {
-        singleKeyPrimaryNodeLeft(cacheConfiguration(null, PRIMARY_SYNC, 1, true, false));
+        singleKeyPrimaryNodeLeft(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 1, true, false));
 
-        singleKeyPrimaryNodeLeft(cacheConfiguration(null, PRIMARY_SYNC, 2, false, false));
+        singleKeyPrimaryNodeLeft(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, false));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testSingleKeyPrimaryNodeFail2() throws Exception {
-        singleKeyPrimaryNodeLeft(cacheConfiguration(null, PRIMARY_SYNC, 2, true, false));
+        singleKeyPrimaryNodeLeft(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, true, false));
 
-        singleKeyPrimaryNodeLeft(cacheConfiguration(null, PRIMARY_SYNC, 3, false, false));
+        singleKeyPrimaryNodeLeft(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 3, false, false));
     }
 
     /**
@@ -377,13 +378,13 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testSingleKeyCommit() throws Exception {
-        singleKeyCommit(cacheConfiguration(null, PRIMARY_SYNC, 1, true, false));
+        singleKeyCommit(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 1, true, false));
 
-        singleKeyCommit(cacheConfiguration(null, PRIMARY_SYNC, 2, false, false));
+        singleKeyCommit(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, false));
 
-        singleKeyCommit(cacheConfiguration(null, PRIMARY_SYNC, 2, false, true));
+        singleKeyCommit(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, true));
 
-        singleKeyCommit(cacheConfiguration(null, PRIMARY_SYNC, 3, false, false));
+        singleKeyCommit(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 3, false, false));
     }
 
     /**
@@ -485,9 +486,9 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
             if (nearCache
                 && node == client &&
                 !node.affinity(ccfg.getName()).isPrimaryOrBackup(node.cluster().localNode(), key))
-                assertEquals("Invalid value for node: " + i, key, ignite(i).cache(null).localPeek(key));
+                assertEquals("Invalid value for node: " + i, key, ignite(i).cache(DEFAULT_CACHE_NAME).localPeek(key));
             else
-                assertNull("Invalid value for node: " + i, ignite(i).cache(null).localPeek(key));
+                assertNull("Invalid value for node: " + i, ignite(i).cache(DEFAULT_CACHE_NAME).localPeek(key));
         }
 
         commSpi0.stopBlock(true);
@@ -519,13 +520,13 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testWaitPrimaryResponse() throws Exception {
-        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 1, true, false));
+        checkWaitPrimaryResponse(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 1, true, false));
 
-        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 2, false, false));
+        checkWaitPrimaryResponse(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, false));
 
-        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 2, false, true));
+        checkWaitPrimaryResponse(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 2, false, true));
 
-        checkWaitPrimaryResponse(cacheConfiguration(null, PRIMARY_SYNC, 3, false, false));
+        checkWaitPrimaryResponse(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 3, false, false));
     }
 
     /**
@@ -657,7 +658,7 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testOnePhaseMessages() throws Exception {
-        checkOnePhaseMessages(cacheConfiguration(null, PRIMARY_SYNC, 1, false, false));
+        checkOnePhaseMessages(cacheConfiguration(DEFAULT_CACHE_NAME, PRIMARY_SYNC, 1, false, false));
     }
 
     /**
@@ -1071,12 +1072,12 @@ public class IgniteTxCachePrimarySyncTest extends GridCommonAbstractTest {
      * @param nearCache If {@code true} configures near cache.
      * @return Cache configuration.
      */
-    private CacheConfiguration<Object, Object> cacheConfiguration(String name,
+    private CacheConfiguration<Object, Object> cacheConfiguration(@NotNull String name,
         CacheWriteSynchronizationMode syncMode,
         int backups,
         boolean store,
         boolean nearCache) {
-        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
 
         ccfg.setName(name);
         ccfg.setAtomicityMode(TRANSACTIONAL);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
index 403aed8..d23e870 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
@@ -51,6 +51,7 @@ import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionOptimisticException;
+import org.jetbrains.annotations.NotNull;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_ASYNC;
@@ -195,7 +196,7 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
         boolean restart) throws Exception {
         final Ignite ignite = ignite(0);
 
-        createCache(ignite, cacheConfiguration(null, syncMode, backups, store), nearCache);
+        createCache(ignite, cacheConfiguration(DEFAULT_CACHE_NAME, syncMode, backups, store), nearCache);
 
         final AtomicBoolean stop = new AtomicBoolean();
 
@@ -303,7 +304,7 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
         finally {
             stop.set(true);
 
-            ignite.destroyCache(null);
+            ignite.destroyCache(DEFAULT_CACHE_NAME);
 
             if (restartFut != null)
                 restartFut.get();
@@ -325,14 +326,14 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
 
                 Ignite ignite = ignite(nodeIdx);
 
-                IgniteCache<Integer, Integer> cache = ignite.cache(null);
+                IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
                 while (System.currentTimeMillis() < stopTime)
                     c.apply(ignite, cache);
             }
         }, NODES * 3, "tx-thread");
 
-        final IgniteCache<Integer, Integer> cache = ignite(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = ignite(0).cache(DEFAULT_CACHE_NAME);
 
         for (int key = 0; key < MULTITHREADED_TEST_KEYS; key++) {
             final Integer key0 = key;
@@ -342,7 +343,7 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
                     final Integer val = cache.get(key0);
 
                     for (int i = 1; i < NODES; i++) {
-                        IgniteCache<Integer, Integer> cache = ignite(i).cache(null);
+                        IgniteCache<Integer, Integer> cache = ignite(i).cache(DEFAULT_CACHE_NAME);
 
                         if (!Objects.equals(val, cache.get(key0)))
                             return false;
@@ -378,11 +379,11 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
      * @param store If {@code true} configures cache store.
      * @return Cache configuration.
      */
-    private CacheConfiguration<Object, Object> cacheConfiguration(String name,
+    private CacheConfiguration<Object, Object> cacheConfiguration(@NotNull String name,
         CacheWriteSynchronizationMode syncMode,
         int backups,
         boolean store) {
-        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
 
         ccfg.setName(name);
         ccfg.setAtomicityMode(TRANSACTIONAL);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxConsistencyRestartAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxConsistencyRestartAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxConsistencyRestartAbstractSelfTest.java
index cb43275..a530cab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxConsistencyRestartAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxConsistencyRestartAbstractSelfTest.java
@@ -78,7 +78,7 @@ public abstract class IgniteTxConsistencyRestartAbstractSelfTest extends GridCom
      * @return Cache configuration.
      */
     public CacheConfiguration cacheConfiguration(String igniteInstanceName) {
-        CacheConfiguration ccfg = new CacheConfiguration();
+        CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfg.setAtomicityMode(TRANSACTIONAL);
         ccfg.setCacheMode(cacheMode());
@@ -108,7 +108,7 @@ public abstract class IgniteTxConsistencyRestartAbstractSelfTest extends GridCom
     public void testTxConsistency() throws Exception {
         startGridsMultiThreaded(GRID_CNT);
 
-        IgniteDataStreamer<Object, Object> ldr = grid(0).dataStreamer(null);
+        IgniteDataStreamer<Object, Object> ldr = grid(0).dataStreamer(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < RANGE; i++) {
             ldr.addData(i, 0);
@@ -154,7 +154,7 @@ public abstract class IgniteTxConsistencyRestartAbstractSelfTest extends GridCom
             try {
                 IgniteKernal grid = (IgniteKernal)grid(idx);
 
-                IgniteCache<Integer, Integer> cache = grid.cache(null);
+                IgniteCache<Integer, Integer> cache = grid.cache(DEFAULT_CACHE_NAME);
 
                 List<Integer> keys = new ArrayList<>();
 
@@ -192,9 +192,9 @@ public abstract class IgniteTxConsistencyRestartAbstractSelfTest extends GridCom
             for (int i = 0; i < GRID_CNT; i++) {
                 IgniteEx grid = grid(i);
 
-                IgniteCache<Integer, Integer> cache = grid.cache(null);
+                IgniteCache<Integer, Integer> cache = grid.cache(DEFAULT_CACHE_NAME);
 
-                if (grid.affinity(null).isPrimaryOrBackup(grid.localNode(), k)) {
+                if (grid.affinity(DEFAULT_CACHE_NAME).isPrimaryOrBackup(grid.localNode(), k)) {
                     if (val == null) {
                         val = cache.localPeek(k, CachePeekMode.ONHEAP);
 
@@ -202,7 +202,7 @@ public abstract class IgniteTxConsistencyRestartAbstractSelfTest extends GridCom
                     }
                     else
                         assertEquals("Failed to find value in cache [primary=" +
-                            grid.affinity(null).isPrimary(grid.localNode(), k) + ']',
+                            grid.affinity(DEFAULT_CACHE_NAME).isPrimary(grid.localNode(), k) + ']',
                             val, cache.localPeek(k, CachePeekMode.ONHEAP));
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
index 982dc13..8bdfafe 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
@@ -133,7 +133,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
         final String initVal = "initialValue";
 
         for (Integer key : keys) {
-            grid(originatingNode()).cache(null).put(key, initVal);
+            grid(originatingNode()).cache(DEFAULT_CACHE_NAME).put(key, initVal);
 
             map.put(key, String.valueOf(key));
         }
@@ -145,7 +145,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
         for (Integer key : keys) {
             Collection<ClusterNode> nodes = new ArrayList<>();
 
-            nodes.addAll(grid(1).affinity(null).mapKeyToPrimaryAndBackups(key));
+            nodes.addAll(grid(1).affinity(DEFAULT_CACHE_NAME).mapKeyToPrimaryAndBackups(key));
 
             nodes.remove(txNode);
 
@@ -162,7 +162,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
 
         GridTestUtils.runAsync(new Callable<Object>() {
             @Override public Object call() throws Exception {
-                IgniteCache<Integer, String> cache = txIgniteNode.cache(null);
+                IgniteCache<Integer, String> cache = txIgniteNode.cache(DEFAULT_CACHE_NAME);
 
                 assertNotNull(cache);
 
@@ -224,7 +224,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
                     private Ignite ignite;
 
                     @Override public Void call() throws Exception {
-                        IgniteCache<Integer, String> cache = ignite.cache(null);
+                        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
                         assertNotNull(cache);
 
@@ -241,7 +241,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
                 UUID locNodeId = g.cluster().localNode().id();
 
                 assertEquals("Check failed for node: " + locNodeId, partial ? initVal : e.getValue(),
-                    g.cache(null).get(e.getKey()));
+                    g.cache(DEFAULT_CACHE_NAME).get(e.getKey()));
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
index 636eb9f..0463c46 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
@@ -161,7 +161,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
         final String initVal = "initialValue";
 
         for (Integer key : keys) {
-            grid(originatingNode()).cache(null).put(key, initVal);
+            grid(originatingNode()).cache(DEFAULT_CACHE_NAME).put(key, initVal);
 
             map.put(key, String.valueOf(key));
         }
@@ -173,7 +173,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
         for (Integer key : keys) {
             Collection<ClusterNode> nodes = new ArrayList<>();
 
-            nodes.addAll(grid(1).affinity(null).mapKeyToPrimaryAndBackups(key));
+            nodes.addAll(grid(1).affinity(DEFAULT_CACHE_NAME).mapKeyToPrimaryAndBackups(key));
 
             nodes.remove(txNode);
 
@@ -190,7 +190,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
 
         GridTestUtils.runAsync(new Callable<Void>() {
             @Override public Void call() throws Exception {
-                IgniteCache<Integer, String> cache = originatingNodeGrid.cache(null);
+                IgniteCache<Integer, String> cache = originatingNodeGrid.cache(DEFAULT_CACHE_NAME);
 
                 assertNotNull(cache);
 
@@ -228,7 +228,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
         boolean txFinished = GridTestUtils.waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
                 for (IgniteKernal g : grids) {
-                    GridCacheAdapter<?, ?> cache = g.internalCache();
+                    GridCacheAdapter<?, ?> cache = g.internalCache(DEFAULT_CACHE_NAME);
 
                     IgniteTxManager txMgr = cache.isNear() ?
                         ((GridNearCacheAdapter)cache).dht().context().tm() :
@@ -264,7 +264,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
                     private Ignite ignite;
 
                     @Override public Void call() throws Exception {
-                        IgniteCache<Integer, String> cache = ignite.cache(null);
+                        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
                         assertNotNull(cache);
 
@@ -279,7 +279,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
 
         for (Map.Entry<Integer, String> e : map.entrySet()) {
             for (Ignite g : G.allGrids())
-                assertEquals(fullFailure ? initVal : e.getValue(), g.cache(null).get(e.getKey()));
+                assertEquals(fullFailure ? initVal : e.getValue(), g.cache(DEFAULT_CACHE_NAME).get(e.getKey()));
         }
     }
 
@@ -311,14 +311,14 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
         final String initVal = "initialValue";
 
         for (Integer key : keys) {
-            grid(originatingNode()).cache(null).put(key, initVal);
+            grid(originatingNode()).cache(DEFAULT_CACHE_NAME).put(key, initVal);
 
             map.put(key, String.valueOf(key));
         }
 
         Map<Integer, Collection<ClusterNode>> nodeMap = new HashMap<>();
 
-        IgniteCache<Integer, String> cache = grid(0).cache(null);
+        IgniteCache<Integer, String> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         info("Failing node ID: " + grid(1).localNode().id());
 
@@ -375,7 +375,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
         boolean txFinished = GridTestUtils.waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
                 for (IgniteKernal g : grids) {
-                    GridCacheAdapter<?, ?> cache = g.internalCache();
+                    GridCacheAdapter<?, ?> cache = g.internalCache(DEFAULT_CACHE_NAME);
 
                     IgniteTxManager txMgr = cache.isNear() ?
                         ((GridNearCacheAdapter)cache).dht().context().tm() :
@@ -411,7 +411,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
                     private Ignite ignite;
 
                     @Override public Void call() throws Exception {
-                        IgniteCache<Integer, String> cache = ignite.cache(null);
+                        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
                         assertNotNull(cache);
 
@@ -426,7 +426,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
 
         for (Map.Entry<Integer, String> e : map.entrySet()) {
             for (Ignite g : G.allGrids())
-                assertEquals(!commmit ? initVal : e.getValue(), g.cache(null).get(e.getKey()));
+                assertEquals(!commmit ? initVal : e.getValue(), g.cache(DEFAULT_CACHE_NAME).get(e.getKey()));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxTimeoutAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxTimeoutAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxTimeoutAbstractTest.java
index 8475175..0af84d6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxTimeoutAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxTimeoutAbstractTest.java
@@ -74,7 +74,7 @@ public class IgniteTxTimeoutAbstractTest extends GridCommonAbstractTest {
      * @return Cache.
      */
     @Override protected <K, V> IgniteCache<K, V> jcache(int i) {
-        return IGNITEs.get(i).cache(null);
+        return IGNITEs.get(i).cache(DEFAULT_CACHE_NAME);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
index 91790da..cc6b058 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
@@ -316,7 +316,7 @@ public abstract class GridCacheAbstractTransformWriteThroughSelfTest extends Gri
         while (keys.size() < 30) {
             String key = String.valueOf(numKey);
 
-            Affinity<Object> affinity = ignite(0).affinity(null);
+            Affinity<Object> affinity = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
             if (nodeType == NEAR_NODE) {
                 if (!affinity.isPrimaryOrBackup(grid(0).localNode(), key))

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
index 0c7bf3c..687a1bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
@@ -78,7 +78,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        CacheConfiguration ccfg = new CacheConfiguration();
+        CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfg.setCacheMode(PARTITIONED);
         ccfg.setAtomicityMode(ATOMIC);
@@ -146,9 +146,9 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
-        Affinity<Integer> aff = ignite0.affinity(null);
+        Affinity<Integer> aff = ignite0.affinity(DEFAULT_CACHE_NAME);
 
         UUID id0 = ignite0.cluster().localNode().id();
 
@@ -207,7 +207,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
         int val = 4;
 
         for (int i = 0; i < GRID_CNT; i++) {
-            IgniteCache<Integer, Integer> cache = grid(i).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(i).cache(DEFAULT_CACHE_NAME);
 
             for (Integer key : nearKeys.keySet())
                 nearKeys.put(key, val);
@@ -246,9 +246,9 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
-        Affinity<Object> aff = ignite0.affinity(null);
+        Affinity<Object> aff = ignite0.affinity(DEFAULT_CACHE_NAME);
 
         UUID id0 = ignite0.cluster().localNode().id();
 
@@ -291,7 +291,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
         int val = nearKey + 1;
 
         for (int i = 0; i < GRID_CNT; i++) {
-            IgniteCache<Integer, Integer> cache = grid(i).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(i).cache(DEFAULT_CACHE_NAME);
 
             log.info("Transform [igniteInstanceName=" + grid(i).name() + ", val=" + val + ']');
 
@@ -321,9 +321,9 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
-        Affinity<Object> aff = ignite0.affinity(null);
+        Affinity<Object> aff = ignite0.affinity(DEFAULT_CACHE_NAME);
 
         UUID id0 = ignite0.cluster().localNode().id();
 
@@ -382,7 +382,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
         int val = 4;
 
         for (int i = 0; i < GRID_CNT; i++) {
-            IgniteCache<Integer, Integer> cache = grid(i).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(i).cache(DEFAULT_CACHE_NAME);
 
             for (Integer key : nearKeys)
                 nearKeys.add(key);
@@ -418,21 +418,21 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
     private void checkPutRemoveGet() throws Exception {
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
         Integer key = key(ignite0, NOT_PRIMARY_AND_BACKUP);
 
         cache0.put(key, key);
 
         for (int i = 0; i < GRID_CNT; i++)
-            grid(i).cache(null).get(key);
+            grid(i).cache(DEFAULT_CACHE_NAME).get(key);
 
         cache0.remove(key);
 
         cache0.put(key, key);
 
         for (int i = 0; i < GRID_CNT; i++)
-            grid(i).cache(null).get(key);
+            grid(i).cache(DEFAULT_CACHE_NAME).get(key);
 
         cache0.remove(key);
     }
@@ -456,9 +456,9 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite ignite0 = grid(grid);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
-        Affinity<Integer> aff = ignite0.affinity(null);
+        Affinity<Integer> aff = ignite0.affinity(DEFAULT_CACHE_NAME);
 
         UUID id0 = ignite0.cluster().localNode().id();
 
@@ -501,7 +501,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
         int val = nearKey + 1;
 
         for (int i = 0; i < GRID_CNT; i++) {
-            IgniteCache<Integer, Integer> cache = grid(i).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(i).cache(DEFAULT_CACHE_NAME);
 
             log.info("Put [igniteInstanceName=" + grid(i).name() + ", val=" + val + ']');
 
@@ -531,7 +531,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
         Integer primaryKey = key(ignite0, PRIMARY);
 
@@ -577,9 +577,9 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
-        Affinity<Integer> aff = ignite0.affinity(null);
+        Affinity<Integer> aff = ignite0.affinity(DEFAULT_CACHE_NAME);
 
         UUID id0 = ignite0.cluster().localNode().id();
 
@@ -602,7 +602,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
         }
 
         IgniteCache<Integer, Integer> primaryCache = G.ignite(
-            (String)aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME)).cache(null);
+            (String)aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME)).cache(DEFAULT_CACHE_NAME);
 
         primaryCache.put(nearKey, 2); // This put should see that near entry evicted on grid0 and remove reader.
 
@@ -625,9 +625,9 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
     private void checkReaderRemove() throws Exception {
         Ignite ignite0 = grid(0);
 
-        IgniteCache<Integer, Integer> cache0 = ignite0.cache(null);
+        IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);
 
-        Affinity<Integer> aff = ignite0.affinity(null);
+        Affinity<Integer> aff = ignite0.affinity(DEFAULT_CACHE_NAME);
 
         UUID id0 = ignite0.cluster().localNode().id();
 
@@ -648,7 +648,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
 
         Ignite primaryNode = G.ignite((String)aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME));
 
-        IgniteCache<Integer, Integer> primaryCache = primaryNode.cache(null);
+        IgniteCache<Integer, Integer> primaryCache = primaryNode.cache(DEFAULT_CACHE_NAME);
 
         primaryCache.put(nearKey, 2); // Put from primary, check there are no readers.
 
@@ -670,7 +670,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
         boolean expectNear,
         final UUID... expReaders) throws Exception
     {
-        GridCacheAdapter<Integer, Integer> near = ((IgniteKernal)ignite).internalCache();
+        GridCacheAdapter<Integer, Integer> near = ((IgniteKernal)ignite).internalCache(DEFAULT_CACHE_NAME);
 
         assertTrue(near.isNear());
 
@@ -746,7 +746,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
      * @return Key with properties specified by the given mode.
      */
     private Integer key(Ignite ignite, int mode) {
-        Affinity<Integer> aff = ignite.affinity(null);
+        Affinity<Integer> aff = ignite.affinity(DEFAULT_CACHE_NAME);
 
         Integer key = null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index f034d13..282b792 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -327,7 +327,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             Thread.sleep(1000);
             // Check that all transactions are committed.
             for (int i = 0; i < 3; i++) {
-                GridCacheAdapter<Object, Object> cache = ((IgniteKernal)grid(i)).internalCache();
+                GridCacheAdapter<Object, Object> cache = ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME);
 
                 for (Integer key : keys) {
                     GridCacheEntryEx entry = cache.peekEx(key);
@@ -382,7 +382,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             final CountDownLatch lockLatch = new CountDownLatch(1);
             final CountDownLatch unlockLatch = new CountDownLatch(1);
 
-            final Lock lock = g0.cache(null).lock(key);
+            final Lock lock = g0.cache(DEFAULT_CACHE_NAME).lock(key);
 
             IgniteInternalFuture<?> unlockFut = multithreadedAsync(new Runnable() {
                 @Override public void run() {
@@ -407,13 +407,13 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             U.await(lockLatch);
 
-            assert g0.cache(null).isLocalLocked(key, false);
-            assert !g0.cache(null).isLocalLocked(key, true) : "Key can not be locked by current thread.";
+            assert g0.cache(DEFAULT_CACHE_NAME).isLocalLocked(key, false);
+            assert !g0.cache(DEFAULT_CACHE_NAME).isLocalLocked(key, true) : "Key can not be locked by current thread.";
 
             assert !lock.tryLock();
 
-            assert g0.cache(null).isLocalLocked(key, false);
-            assert !g0.cache(null).isLocalLocked(key, true) : "Key can not be locked by current thread.";
+            assert g0.cache(DEFAULT_CACHE_NAME).isLocalLocked(key, false);
+            assert !g0.cache(DEFAULT_CACHE_NAME).isLocalLocked(key, true) : "Key can not be locked by current thread.";
 
             unlockLatch.countDown();
             unlockFut.get();
@@ -439,11 +439,11 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
         try {
             for (int i = 0; i < 100; i++)
-                g0.cache(null).put(i, i);
+                g0.cache(DEFAULT_CACHE_NAME).put(i, i);
 
             for (int i = 0; i < 100; i++) {
                 try (Transaction tx = g0.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
-                    Integer val = (Integer) g0.cache(null).get(i);
+                    Integer val = (Integer) g0.cache(DEFAULT_CACHE_NAME).get(i);
 
                     assertEquals((Integer) i, val);
                 }
@@ -562,12 +562,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             try {
                 if (separate) {
-                    g0.cache(null).put(k0, "val" + k0);
-                    g0.cache(null).put(k1, "val" + k1);
-                    g0.cache(null).put(k2, "val" + k2);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k0, "val" + k0);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k1, "val" + k1);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k2, "val" + k2);
                 }
                 else
-                    g0.cache(null).putAll(map);
+                    g0.cache(DEFAULT_CACHE_NAME).putAll(map);
 
                 if (tx != null)
                     tx.commit();
@@ -578,12 +578,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             }
 
             if (separate) {
-                assertEquals("val" + k0, g0.cache(null).get(k0));
-                assertEquals("val" + k1, g0.cache(null).get(k1));
-                assertEquals("val" + k2, g0.cache(null).get(k2));
+                assertEquals("val" + k0, g0.cache(DEFAULT_CACHE_NAME).get(k0));
+                assertEquals("val" + k1, g0.cache(DEFAULT_CACHE_NAME).get(k1));
+                assertEquals("val" + k2, g0.cache(DEFAULT_CACHE_NAME).get(k2));
             }
             else {
-                Map<Object, Object> res = g0.cache(null).getAll(map.keySet());
+                Map<Object, Object> res = g0.cache(DEFAULT_CACHE_NAME).getAll(map.keySet());
 
                 assertEquals(map, res);
             }
@@ -592,12 +592,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             try {
                 if (separate) {
-                    g0.cache(null).remove(k0);
-                    g0.cache(null).remove(k1);
-                    g0.cache(null).remove(k2);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k0);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k1);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k2);
                 }
                 else
-                    g0.cache(null).removeAll(map.keySet());
+                    g0.cache(DEFAULT_CACHE_NAME).removeAll(map.keySet());
 
                 if (tx != null)
                     tx.commit();
@@ -608,12 +608,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             }
 
             if (separate) {
-                assertEquals(null, g0.cache(null).get(k0));
-                assertEquals(null, g0.cache(null).get(k1));
-                assertEquals(null, g0.cache(null).get(k2));
+                assertEquals(null, g0.cache(DEFAULT_CACHE_NAME).get(k0));
+                assertEquals(null, g0.cache(DEFAULT_CACHE_NAME).get(k1));
+                assertEquals(null, g0.cache(DEFAULT_CACHE_NAME).get(k2));
             }
             else {
-                Map<Object, Object> res = g0.cache(null).getAll(map.keySet());
+                Map<Object, Object> res = g0.cache(DEFAULT_CACHE_NAME).getAll(map.keySet());
 
                 assertTrue(res.isEmpty());
             }
@@ -651,11 +651,11 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             try {
                 if (separate) {
-                    g0.cache(null).put(k1, "val" + k1);
-                    g0.cache(null).put(k2, "val" + k2);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k1, "val" + k1);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k2, "val" + k2);
                 }
                 else
-                    g0.cache(null).putAll(map);
+                    g0.cache(DEFAULT_CACHE_NAME).putAll(map);
 
                 if (tx != null)
                     tx.commit();
@@ -666,11 +666,11 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             }
 
             if (separate) {
-                assertEquals("val" + k1, g0.cache(null).get(k1));
-                assertEquals("val" + k2, g0.cache(null).get(k2));
+                assertEquals("val" + k1, g0.cache(DEFAULT_CACHE_NAME).get(k1));
+                assertEquals("val" + k2, g0.cache(DEFAULT_CACHE_NAME).get(k2));
             }
             else {
-                Map<Object, Object> res = g0.cache(null).getAll(map.keySet());
+                Map<Object, Object> res = g0.cache(DEFAULT_CACHE_NAME).getAll(map.keySet());
 
                 assertEquals(map, res);
             }
@@ -679,11 +679,11 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             try {
                 if (separate) {
-                    g0.cache(null).remove(k1);
-                    g0.cache(null).remove(k2);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k1);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k2);
                 }
                 else
-                    g0.cache(null).removeAll(map.keySet());
+                    g0.cache(DEFAULT_CACHE_NAME).removeAll(map.keySet());
 
                 if (tx != null)
                     tx.commit();
@@ -694,11 +694,11 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             }
 
             if (separate) {
-                assertEquals(null, g0.cache(null).get(k1));
-                assertEquals(null, g0.cache(null).get(k2));
+                assertEquals(null, g0.cache(DEFAULT_CACHE_NAME).get(k1));
+                assertEquals(null, g0.cache(DEFAULT_CACHE_NAME).get(k2));
             }
             else {
-                Map<Object, Object> res = g0.cache(null).getAll(map.keySet());
+                Map<Object, Object> res = g0.cache(DEFAULT_CACHE_NAME).getAll(map.keySet());
 
                 assertTrue(res.isEmpty());
             }
@@ -752,7 +752,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
         Ignite g1 = grid(1);
         Ignite g2 = grid(2);
 
-        g0.cache(null).putAll(map);
+        g0.cache(DEFAULT_CACHE_NAME).putAll(map);
 
         checkStore(g0, map);
         checkStore(g1, Collections.<Integer, String>emptyMap());
@@ -761,7 +761,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
         clearStores(3);
 
         try (Transaction tx = g0.transactions().txStart(OPTIMISTIC, READ_COMMITTED)) {
-            g0.cache(null).putAll(map);
+            g0.cache(DEFAULT_CACHE_NAME).putAll(map);
 
             tx.commit();
 
@@ -829,7 +829,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             Map<Integer, String> map0 = F.asMap(k0, "val" + k0, k1, "val" + k1, k2, "val" + k2);
 
-            g0.cache(null).putAll(map0);
+            g0.cache(DEFAULT_CACHE_NAME).putAll(map0);
 
             Map<Integer, String> map = F.asMap(k0, "value" + k0, k1, "value" + k1, k2, "value" + k2);
 
@@ -837,12 +837,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             try {
                 if (separate) {
-                    g0.cache(null).put(k0, "value" + k0);
-                    g0.cache(null).put(k1, "value" + k1);
-                    g0.cache(null).put(k2, "value" + k2);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k0, "value" + k0);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k1, "value" + k1);
+                    g0.cache(DEFAULT_CACHE_NAME).put(k2, "value" + k2);
                 }
                 else
-                    g0.cache(null).putAll(map);
+                    g0.cache(DEFAULT_CACHE_NAME).putAll(map);
 
                 tx.rollback();
             }
@@ -851,12 +851,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             }
 
             if (separate) {
-                assertEquals("val" + k0, g0.cache(null).get(k0));
-                assertEquals("val" + k1, g0.cache(null).get(k1));
-                assertEquals("val" + k2, g0.cache(null).get(k2));
+                assertEquals("val" + k0, g0.cache(DEFAULT_CACHE_NAME).get(k0));
+                assertEquals("val" + k1, g0.cache(DEFAULT_CACHE_NAME).get(k1));
+                assertEquals("val" + k2, g0.cache(DEFAULT_CACHE_NAME).get(k2));
             }
             else {
-                Map<Object, Object> res = g0.cache(null).getAll(map.keySet());
+                Map<Object, Object> res = g0.cache(DEFAULT_CACHE_NAME).getAll(map.keySet());
 
                 assertEquals(map0, res);
             }
@@ -865,12 +865,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
 
             try {
                 if (separate) {
-                    g0.cache(null).remove(k0);
-                    g0.cache(null).remove(k1);
-                    g0.cache(null).remove(k2);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k0);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k1);
+                    g0.cache(DEFAULT_CACHE_NAME).remove(k2);
                 }
                 else
-                    g0.cache(null).removeAll(map.keySet());
+                    g0.cache(DEFAULT_CACHE_NAME).removeAll(map.keySet());
 
                 tx.rollback();
             }
@@ -879,12 +879,12 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
             }
 
             if (separate) {
-                assertEquals("val" + k0, g0.cache(null).get(k0));
-                assertEquals("val" + k1, g0.cache(null).get(k1));
-                assertEquals("val" + k2, g0.cache(null).get(k2));
+                assertEquals("val" + k0, g0.cache(DEFAULT_CACHE_NAME).get(k0));
+                assertEquals("val" + k1, g0.cache(DEFAULT_CACHE_NAME).get(k1));
+                assertEquals("val" + k2, g0.cache(DEFAULT_CACHE_NAME).get(k2));
             }
             else {
-                Map<Object, Object> res = g0.cache(null).getAll(map.keySet());
+                Map<Object, Object> res = g0.cache(DEFAULT_CACHE_NAME).getAll(map.keySet());
 
                 assertEquals(map0, res);
             }
@@ -983,7 +983,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
      */
     private static Integer forPrimary(Ignite g, int prev) {
         for (int i = prev + 1; i < 10000; i++) {
-            if (g.affinity(null).mapKeyToNode(i).id().equals(g.cluster().localNode().id()))
+            if (g.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(i).id().equals(g.cluster().localNode().id()))
                 return i;
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedOptimisticTransactionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedOptimisticTransactionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedOptimisticTransactionSelfTest.java
index e32d4a1..5ed6b38 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedOptimisticTransactionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedOptimisticTransactionSelfTest.java
@@ -69,7 +69,7 @@ public class GridCacheColocatedOptimisticTransactionSelfTest extends GridCommonA
 
         disco.setIpFinder(IP_FINDER);
 
-        CacheConfiguration cc = new CacheConfiguration();
+        CacheConfiguration cc = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         cc.setName(CACHE);
         cc.setCacheMode(PARTITIONED);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
index 58c3841..db8a3cb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
@@ -124,7 +124,7 @@ public class GridCacheDhtEntrySelfTest extends GridCommonAbstractTest {
      * @return Near cache.
      */
     private IgniteCache<Integer, String> near(Ignite g) {
-        return g.cache(null);
+        return g.cache(DEFAULT_CACHE_NAME);
     }
 
     /**
@@ -133,7 +133,7 @@ public class GridCacheDhtEntrySelfTest extends GridCommonAbstractTest {
      */
     @SuppressWarnings({"unchecked", "TypeMayBeWeakened"})
     private GridDhtCacheAdapter<Integer, String> dht(Ignite g) {
-        return ((GridNearCacheAdapter)((IgniteKernal)g).internalCache()).dht();
+        return ((GridNearCacheAdapter)((IgniteKernal)g).internalCache(DEFAULT_CACHE_NAME)).dht();
     }
 
     /**
@@ -302,7 +302,7 @@ public class GridCacheDhtEntrySelfTest extends GridCommonAbstractTest {
      * @return For the given key pair {primary node, some other node}.
      */
     private IgniteBiTuple<ClusterNode, ClusterNode> getNodes(Integer key) {
-        Affinity<Integer> aff = grid(0).affinity(null);
+        Affinity<Integer> aff = grid(0).affinity(DEFAULT_CACHE_NAME);
 
         int part = aff.partition(key);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
index 20162a7..dc5e3ac 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
@@ -154,7 +154,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
      */
     @SuppressWarnings({"unchecked"})
     private GridNearCacheAdapter<Integer, String> near(Ignite g) {
-        return (GridNearCacheAdapter)((IgniteKernal)g).internalCache();
+        return (GridNearCacheAdapter)((IgniteKernal)g).internalCache(DEFAULT_CACHE_NAME);
     }
 
     /**
@@ -163,7 +163,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
      */
     @SuppressWarnings({"unchecked", "TypeMayBeWeakened"})
     private GridDhtCacheAdapter<Integer, String> dht(Ignite g) {
-        return ((GridNearCacheAdapter)((IgniteKernal)g).internalCache()).dht();
+        return ((GridNearCacheAdapter)((IgniteKernal)g).internalCache(DEFAULT_CACHE_NAME)).dht();
     }
 
     /**
@@ -171,7 +171,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
      * @return Primary node for the given key.
      */
     private Collection<ClusterNode> keyNodes(Object key) {
-        return grid(0).affinity(null).mapKeyToPrimaryAndBackups(key);
+        return grid(0).affinity(DEFAULT_CACHE_NAME).mapKeyToPrimaryAndBackups(key);
     }
 
     /**
@@ -272,7 +272,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
 
         // Evict on primary node.
         // It will trigger dht eviction and eviction on backup node.
-        grid(primary).cache(null).localEvict(Collections.<Object>singleton(key));
+        grid(primary).cache(DEFAULT_CACHE_NAME).localEvict(Collections.<Object>singleton(key));
 
         futOther.get(3000);
         futBackup.get(3000);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
index c77ea8f..35ef4f0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
@@ -78,7 +78,7 @@ public class GridCacheDhtMappingSelfTest extends GridCommonAbstractTest {
 
         startGridsMultiThreaded(nodeCnt);
 
-        IgniteCache<Integer, Integer> cache = grid(nodeCnt - 1).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(nodeCnt - 1).cache(DEFAULT_CACHE_NAME);
 
         int kv = 1;
 
@@ -90,7 +90,7 @@ public class GridCacheDhtMappingSelfTest extends GridCommonAbstractTest {
             Ignite g = grid(i);
 
             GridDhtCacheAdapter<Integer, Integer> dht = ((GridNearCacheAdapter<Integer, Integer>)
-                ((IgniteKernal)g).<Integer, Integer>internalCache()).dht();
+                ((IgniteKernal)g).<Integer, Integer>internalCache(DEFAULT_CACHE_NAME)).dht();
 
             if (localPeek(dht, kv) != null) {
                 info("Key found on node: " + g.cluster().localNode().id());

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
index 2e7d4aa..86dbd4f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
@@ -133,7 +133,7 @@ public class GridCacheDhtPreloadBigDataSelfTest extends GridCommonAbstractTest {
 
             int cnt = 10000;
 
-            populate(grid(0).<Integer, byte[]>cache(null), cnt, KBSIZE);
+            populate(grid(0).<Integer, byte[]>cache(DEFAULT_CACHE_NAME), cnt, KBSIZE);
 
             int gridCnt = 3;
 
@@ -143,7 +143,7 @@ public class GridCacheDhtPreloadBigDataSelfTest extends GridCommonAbstractTest {
             Thread.sleep(10000);
 
             for (int i = 0; i < gridCnt; i++) {
-                IgniteCache<Integer, String> c = grid(i).cache(null);
+                IgniteCache<Integer, String> c = grid(i).cache(DEFAULT_CACHE_NAME);
 
                 if (backups + 1 <= gridCnt)
                     assert c.localSize() < cnt : "Cache size: " + c.localSize();
@@ -172,7 +172,7 @@ public class GridCacheDhtPreloadBigDataSelfTest extends GridCommonAbstractTest {
 
                 @Override public void onLifecycleEvent(LifecycleEventType evt) {
                     if (evt == LifecycleEventType.AFTER_NODE_START) {
-                        IgniteCache<Integer, byte[]> c = ignite.cache(null);
+                        IgniteCache<Integer, byte[]> c = ignite.cache(DEFAULT_CACHE_NAME);
 
                         if (c.putIfAbsent(-1, new byte[1])) {
                             populate(c, cnt, KBSIZE);
@@ -189,12 +189,12 @@ public class GridCacheDhtPreloadBigDataSelfTest extends GridCommonAbstractTest {
                 startGrid(i);
 
             for (int i = 0; i < gridCnt; i++)
-                info("Grid size [i=" + i + ", size=" + grid(i).cache(null).size() + ']');
+                info("Grid size [i=" + i + ", size=" + grid(i).cache(DEFAULT_CACHE_NAME).size() + ']');
 
             Thread.sleep(10000);
 
             for (int i = 0; i < gridCnt; i++) {
-                IgniteCache<Integer, String> c = grid(i).cache(null);
+                IgniteCache<Integer, String> c = grid(i).cache(DEFAULT_CACHE_NAME);
 
                 if (backups + 1 <= gridCnt)
                     assert c.localSize() < cnt;

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
index 3bdce46..0105ece 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
@@ -116,7 +116,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
 
         int cnt = KEY_CNT;
 
-        IgniteCache<String, Integer> c0 = g0.cache(null);
+        IgniteCache<String, Integer> c0 = g0.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < cnt; i++)
             c0.put(Integer.toString(i), i);
@@ -124,8 +124,8 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
         Ignite g1 = startGrid(1);
         Ignite g2 = startGrid(2);
 
-        IgniteCache<String, Integer> c1 = g1.cache(null);
-        IgniteCache<String, Integer> c2 = g2.cache(null);
+        IgniteCache<String, Integer> c1 = g1.cache(DEFAULT_CACHE_NAME);
+        IgniteCache<String, Integer> c2 = g2.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < cnt; i++)
             assertNull(c1.localPeek(Integer.toString(i), CachePeekMode.ONHEAP));
@@ -195,7 +195,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
 
         int cnt = KEY_CNT;
 
-        IgniteCache<String, Integer> c0 = g0.cache(null);
+        IgniteCache<String, Integer> c0 = g0.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < cnt; i++)
             c0.put(Integer.toString(i), i);
@@ -203,8 +203,8 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
         Ignite g1 = startGrid(1);
         Ignite g2 = startGrid(2);
 
-        IgniteCache<String, Integer> c1 = g1.cache(null);
-        IgniteCache<String, Integer> c2 = g2.cache(null);
+        IgniteCache<String, Integer> c1 = g1.cache(DEFAULT_CACHE_NAME);
+        IgniteCache<String, Integer> c2 = g2.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < cnt; i++)
             assertNull(c1.localPeek(Integer.toString(i), CachePeekMode.ONHEAP));
@@ -267,7 +267,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
 
         int cnt = KEY_CNT;
 
-        IgniteCache<String, Integer> c0 = g0.cache(null);
+        IgniteCache<String, Integer> c0 = g0.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < cnt; i++)
             c0.put(Integer.toString(i), i);
@@ -275,8 +275,8 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
         Ignite g1 = startGrid(1);
         Ignite g2 = startGrid(2);
 
-        IgniteCache<String, Integer> c1 = g1.cache(null);
-        IgniteCache<String, Integer> c2 = g2.cache(null);
+        IgniteCache<String, Integer> c1 = g1.cache(DEFAULT_CACHE_NAME);
+        IgniteCache<String, Integer> c2 = g2.cache(DEFAULT_CACHE_NAME);
 
         GridDhtCacheAdapter<String, Integer> d0 = dht(0);
         GridDhtCacheAdapter<String, Integer> d1 = dht(1);
@@ -375,7 +375,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
 
             long start = System.currentTimeMillis();
 
-            g.cache(null).rebalance().get();
+            g.cache(DEFAULT_CACHE_NAME).rebalance().get();
 
             info(">>> Finished preloading of empty cache in " + (System.currentTimeMillis() - start) + "ms.");
         }
@@ -389,7 +389,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
      * @return Topology.
      */
     private GridDhtPartitionTopology topology(Ignite g) {
-        return ((GridNearCacheAdapter<Integer, String>)((IgniteKernal)g).<Integer, String>internalCache()).dht().topology();
+        return ((GridNearCacheAdapter<Integer, String>)((IgniteKernal)g).<Integer, String>internalCache(DEFAULT_CACHE_NAME)).dht().topology();
     }
 
     /**
@@ -397,7 +397,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
      * @return Affinity.
      */
     private Affinity<Object> affinity(Ignite g) {
-        return g.affinity(null);
+        return g.affinity(DEFAULT_CACHE_NAME);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
index 9b34a80..7a80e87 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
@@ -120,7 +120,7 @@ public class GridCacheDhtPreloadDisabledSelfTest extends GridCommonAbstractTest
      * @return Topology.
      */
     private GridDhtPartitionTopology topology(int i) {
-        return near(grid(i).cache(null)).dht().topology();
+        return near(grid(i).cache(DEFAULT_CACHE_NAME)).dht().topology();
     }
 
     /** @throws Exception If failed. */
@@ -177,7 +177,7 @@ public class GridCacheDhtPreloadDisabledSelfTest extends GridCommonAbstractTest
         try {
             Ignite ignite1 = startGrid(0);
 
-            IgniteCache<Integer, String> cache1 = ignite1.cache(null);
+            IgniteCache<Integer, String> cache1 = ignite1.cache(DEFAULT_CACHE_NAME);
 
             int keyCnt = 10;
 
@@ -198,7 +198,7 @@ public class GridCacheDhtPreloadDisabledSelfTest extends GridCommonAbstractTest
 
             // Check all nodes.
             for (Ignite g : ignites) {
-                IgniteCache<Integer, String> c = g.cache(null);
+                IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME);
 
                 for (int i = 0; i < keyCnt; i++)
                     assertNull(c.localPeek(i));
@@ -207,7 +207,7 @@ public class GridCacheDhtPreloadDisabledSelfTest extends GridCommonAbstractTest
             Collection<Integer> keys = new LinkedList<>();
 
             for (int i = 0; i < keyCnt; i++)
-                if (ignite1.affinity(null).mapKeyToNode(i).equals(ignite1.cluster().localNode()))
+                if (ignite1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(i).equals(ignite1.cluster().localNode()))
                     keys.add(i);
 
             info(">>> Finished checking nodes [keyCnt=" + keyCnt + ", nodeCnt=" + nodeCnt + ", grids=" +
@@ -222,7 +222,7 @@ public class GridCacheDhtPreloadDisabledSelfTest extends GridCommonAbstractTest
 
                 // Check all nodes.
                 for (Ignite gg : ignites) {
-                    IgniteCache<Integer, String> c = gg.cache(null);
+                    IgniteCache<Integer, String> c = gg.cache(DEFAULT_CACHE_NAME);
 
                     for (int i = 0; i < keyCnt; i++)
                         assertNull(c.localPeek(i));

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
index af7aff4..e2a8009 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
@@ -93,7 +93,7 @@ public class GridCacheDhtPreloadMessageCountTest extends GridCommonAbstractTest
 
         int cnt = KEY_CNT;
 
-        IgniteCache<String, Integer> c0 = g0.cache(null);
+        IgniteCache<String, Integer> c0 = g0.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < cnt; i++)
             c0.put(Integer.toString(i), i);
@@ -103,8 +103,8 @@ public class GridCacheDhtPreloadMessageCountTest extends GridCommonAbstractTest
 
         U.sleep(1000);
 
-        IgniteCache<String, Integer> c1 = g1.cache(null);
-        IgniteCache<String, Integer> c2 = g2.cache(null);
+        IgniteCache<String, Integer> c1 = g1.cache(DEFAULT_CACHE_NAME);
+        IgniteCache<String, Integer> c2 = g2.cache(DEFAULT_CACHE_NAME);
 
         TestRecordingCommunicationSpi spi0 = (TestRecordingCommunicationSpi)g0.configuration().getCommunicationSpi();
         TestRecordingCommunicationSpi spi1 = (TestRecordingCommunicationSpi)g1.configuration().getCommunicationSpi();

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
index 2bbdff7..71911e8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
@@ -198,7 +198,7 @@ public class GridCacheDhtPreloadPutGetSelfTest extends GridCommonAbstractTest {
                         for (int i = 0; i < ITER_CNT; i++) {
                             info("Iteration # " + i);
 
-                            IgniteCache<Integer, Integer> cache = g2.cache(null);
+                            IgniteCache<Integer, Integer> cache = g2.cache(DEFAULT_CACHE_NAME);
 
                             for (int j = 0; j < KEY_CNT; j++) {
                                 Integer val = cache.get(j);
@@ -230,7 +230,7 @@ public class GridCacheDhtPreloadPutGetSelfTest extends GridCommonAbstractTest {
 
                             Ignite g1 = startGrid(1);
 
-                            IgniteCache<Integer, Integer> cache = g1.cache(null);
+                            IgniteCache<Integer, Integer> cache = g1.cache(DEFAULT_CACHE_NAME);
 
                             for (int j = 0; j < KEY_CNT; j++) {
                                 cache.put(j, j);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
index 43aa10b..05a9759 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
@@ -236,7 +236,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
         try {
             Ignite ignite1 = startGrid(0);
 
-            IgniteCache<Integer, String> cache1 = ignite1.cache(null);
+            IgniteCache<Integer, String> cache1 = ignite1.cache(DEFAULT_CACHE_NAME);
 
             putKeys(cache1, keyCnt);
             checkKeys(cache1, keyCnt, F.asList(ignite1));
@@ -247,7 +247,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
 
             // Check all nodes.
             for (Ignite g : ignites) {
-                IgniteCache<Integer, String> c = g.cache(null);
+                IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME);
 
                 checkKeys(c, keyCnt, ignites);
             }
@@ -322,7 +322,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
 
             assert last != null;
 
-            IgniteCache<Integer, String> lastCache = last.cache(null);
+            IgniteCache<Integer, String> lastCache = last.cache(DEFAULT_CACHE_NAME);
 
             GridDhtCacheAdapter<Integer, String> dht = dht(lastCache);
 
@@ -364,7 +364,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
     private void checkActiveState(Iterable<Ignite> grids) {
         // Check that nodes don't have non-active information about other nodes.
         for (Ignite g : grids) {
-            IgniteCache<Integer, String> c = g.cache(null);
+            IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME);
 
             GridDhtCacheAdapter<Integer, String> dht = dht(c);
 
@@ -506,7 +506,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
         try {
             Ignite ignite1 = startGrid(0);
 
-            IgniteCache<Integer, String> cache1 = ignite1.cache(null);
+            IgniteCache<Integer, String> cache1 = ignite1.cache(DEFAULT_CACHE_NAME);
 
             putKeys(cache1, keyCnt);
             checkKeys(cache1, keyCnt, F.asList(ignite1));
@@ -517,7 +517,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
 
             // Check all nodes.
             for (Ignite g : ignites) {
-                IgniteCache<Integer, String> c = g.cache(null);
+                IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME);
 
                 checkKeys(c, keyCnt, ignites);
             }
@@ -580,7 +580,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
 
                 // Check all left nodes.
                 for (Ignite gg : ignites) {
-                    IgniteCache<Integer, String> c = gg.cache(null);
+                    IgniteCache<Integer, String> c = gg.cache(DEFAULT_CACHE_NAME);
 
                     checkKeys(c, keyCnt, ignites);
                 }
@@ -588,7 +588,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
 
             assert last != null;
 
-            IgniteCache<Integer, String> lastCache = last.cache(null);
+            IgniteCache<Integer, String> lastCache = last.cache(DEFAULT_CACHE_NAME);
 
             GridDhtCacheAdapter<Integer, String> dht = dht(lastCache);
 
@@ -677,7 +677,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
         Map<String, String> map = new HashMap<>();
 
         for (Ignite g : grids) {
-            IgniteCache<Integer, String> c = g.cache(null);
+            IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME);
 
             GridDhtCacheAdapter<Integer, String> dht = dht(c);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
index 94918f6..407f69b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
@@ -185,7 +185,7 @@ public class GridCacheDhtPreloadStartStopSelfTest extends GridCommonAbstractTest
         try {
             Ignite g1 = startGrid(0);
 
-            IgniteCache<Integer, String> c1 = g1.cache(null);
+            IgniteCache<Integer, String> c1 = g1.cache(DEFAULT_CACHE_NAME);
 
             putKeys(c1, keyCnt);
             checkKeys(c1, keyCnt);
@@ -196,7 +196,7 @@ public class GridCacheDhtPreloadStartStopSelfTest extends GridCommonAbstractTest
 
             // Check all nodes.
             for (Ignite g : ignites) {
-                IgniteCache<Integer, String> c = g.cache(null);
+                IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME);
 
                 checkKeys(c, keyCnt);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
index 96078e2..bc5e3d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
@@ -131,7 +131,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
 
             int cnt = 1000;
 
-            populate(grid(0).<Integer, String>cache(null), cnt);
+            populate(grid(0).<Integer, String>cache(DEFAULT_CACHE_NAME), cnt);
 
             int gridCnt = 2;
 
@@ -158,7 +158,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
 
             int cnt = 1000;
 
-            populate(grid(0).<Integer, String>cache(null), cnt);
+            populate(grid(0).<Integer, String>cache(DEFAULT_CACHE_NAME), cnt);
 
             int gridCnt = 2;
 
@@ -173,10 +173,10 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
             Thread.sleep(wait);
 
             for (int i = 0; i < gridCnt; i++)
-                info("Grid size [i=" + i + ", size=" + grid(i).cache(null).localSize() + ']');
+                info("Grid size [i=" + i + ", size=" + grid(i).cache(DEFAULT_CACHE_NAME).localSize() + ']');
 
             for (int i = 0; i < gridCnt; i++) {
-                IgniteCache<Integer, String> c = grid(i).cache(null);
+                IgniteCache<Integer, String> c = grid(i).cache(DEFAULT_CACHE_NAME);
 
                 // Nothing should be unloaded since nodes are backing up each other.
                 assertEquals(cnt, c.localSize(CachePeekMode.ALL));
@@ -203,7 +203,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
             boolean err = false;
 
             for (int i = 0; i < gridCnt; i++) {
-                IgniteCache<Integer, String> c = grid(i).cache(null);
+                IgniteCache<Integer, String> c = grid(i).cache(DEFAULT_CACHE_NAME);
 
                 if (c.localSize() >= cnt)
                     err = true;
@@ -216,10 +216,10 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
         }
 
         for (int i = 0; i < gridCnt; i++)
-            info("Grid size [i=" + i + ", size=" + grid(i).cache(null).localSize() + ']');
+            info("Grid size [i=" + i + ", size=" + grid(i).cache(DEFAULT_CACHE_NAME).localSize() + ']');
 
         for (int i = 0; i < gridCnt; i++) {
-            IgniteCache<Integer, String> c = grid(i).cache(null);
+            IgniteCache<Integer, String> c = grid(i).cache(DEFAULT_CACHE_NAME);
 
             assert c.localSize() < cnt;
         }
@@ -237,7 +237,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
 
             int cnt = 1000;
 
-            populate(grid(0).<Integer, String>cache(null), cnt);
+            populate(grid(0).<Integer, String>cache(DEFAULT_CACHE_NAME), cnt);
 
             int gridCnt = 3;
 
@@ -245,7 +245,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
                 startGrid(i);
 
                 for (int j = 0; j <= i; j++)
-                    info("Grid size [i=" + i + ", size=" + grid(j).cache(null).localSize() + ']');
+                    info("Grid size [i=" + i + ", size=" + grid(j).cache(DEFAULT_CACHE_NAME).localSize() + ']');
             }
 
             long wait = 3000;
@@ -271,10 +271,10 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
 
                 @Override public void onLifecycleEvent(LifecycleEventType evt) {
                     if (evt == LifecycleEventType.AFTER_NODE_START) {
-                        IgniteCache<Integer, String> c = ignite.cache(null);
+                        IgniteCache<Integer, String> c = ignite.cache(DEFAULT_CACHE_NAME);
 
                         if (c.putIfAbsent(-1, "true")) {
-                            populate(ignite.<Integer, String>cache(null), cnt);
+                            populate(ignite.<Integer, String>cache(DEFAULT_CACHE_NAME), cnt);
 
                             info(">>> POPULATED GRID <<<");
                         }
@@ -288,7 +288,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
                 startGrid(i);
 
                 for (int j = 0; j < i; j++)
-                    info("Grid size [i=" + i + ", size=" + grid(j).cache(null).localSize() + ']');
+                    info("Grid size [i=" + i + ", size=" + grid(j).cache(DEFAULT_CACHE_NAME).localSize() + ']');
             }
 
             long wait = 3000;

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
index 7e9533f..6c2da72 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
@@ -80,7 +80,7 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
     public void testGettingRemovedKey() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-819");
 
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         cache.put(0, 0);
 
@@ -88,14 +88,14 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
             Ignite g = grid(i);
 
             // TODO: getting of removed key will produce 3 inner read operations.
-            g.cache(null).removeAll();
+            g.cache(DEFAULT_CACHE_NAME).removeAll();
 
             // TODO: getting of removed key will produce inner write and 4 inner read operations.
-            //((IgniteKernal)g).cache(null).remove(0);
+            //((IgniteKernal)g).cache(DEFAULT_CACHE_NAME).remove(0);
 
-            assert g.cache(null).localSize() == 0;
+            assert g.cache(DEFAULT_CACHE_NAME).localSize() == 0;
 
-            g.cache(null).mxBean().clear();
+            g.cache(DEFAULT_CACHE_NAME).mxBean().clear();
         }
 
         assertNull("Value is not null for key: " + 0, cache.get(0));
@@ -107,7 +107,7 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
         long misses = 0;
 
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).localMetrics();
+            CacheMetrics m = grid(i).cache(DEFAULT_CACHE_NAME).localMetrics();
 
             removes += m.getCacheRemovals();
             reads += m.getCacheGets();

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedPreloadEventsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedPreloadEventsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedPreloadEventsSelfTest.java
index 3e7645b..bc62a72 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedPreloadEventsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedPreloadEventsSelfTest.java
@@ -117,7 +117,7 @@ public class GridCachePartitionedPreloadEventsSelfTest extends GridCachePreloadE
 
         Collection<Integer> keys = new HashSet<>();
 
-        IgniteCache<Integer, String> cache = g1.cache(null);
+        IgniteCache<Integer, String> cache = g1.cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < 100; i++) {
             keys.add(i);
@@ -126,7 +126,7 @@ public class GridCachePartitionedPreloadEventsSelfTest extends GridCachePreloadE
 
         Ignite g2 = startGrid("g2");
 
-        Map<ClusterNode, Collection<Object>> keysMap = g1.affinity(null).mapKeysToNodes(keys);
+        Map<ClusterNode, Collection<Object>> keysMap = g1.affinity(DEFAULT_CACHE_NAME).mapKeysToNodes(keys);
         Collection<Object> g2Keys = keysMap.get(g2.cluster().localNode());
 
         assertNotNull(g2Keys);
@@ -134,7 +134,7 @@ public class GridCachePartitionedPreloadEventsSelfTest extends GridCachePreloadE
 
         for (Object key : g2Keys)
             // Need to force keys loading.
-            assertEquals("val", g2.cache(null).getAndPut(key, "changed val"));
+            assertEquals("val", g2.cache(DEFAULT_CACHE_NAME).getAndPut(key, "changed val"));
 
         Collection<Event> evts = g2.events().localQuery(F.<Event>alwaysTrue(), EVT_CACHE_REBALANCE_OBJECT_LOADED);