ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/64] [abbrv] ignite git commit: IGNITE-3488: Prohibited null as cache name. This closes #1790.
Date Fri, 28 Apr 2017 12:44:43 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index 68ba28f..b130ad9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -89,15 +89,15 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++) {
             Ignite g = grid(i);
 
-            g.cache(null).removeAll();
+            g.cache(DEFAULT_CACHE_NAME).removeAll();
 
-            assert g.cache(null).localSize() == 0;
+            assert g.cache(DEFAULT_CACHE_NAME).localSize() == 0;
         }
 
         for (int i = 0; i < gridCount(); i++) {
             Ignite g = grid(i);
 
-            g.cache(null).localMxBean().clear();
+            g.cache(DEFAULT_CACHE_NAME).localMxBean().clear();
 
             g.transactions().resetMetrics();
         }
@@ -110,7 +110,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++) {
             Ignite g = grid(i);
 
-            g.cache(null).getConfiguration(CacheConfiguration.class).setStatisticsEnabled(true);
+            g.cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).setStatisticsEnabled(true);
         }
     }
 
@@ -122,10 +122,10 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++) {
             Ignite g = grid(i);
 
-            g.cache(null).getConfiguration(CacheConfiguration.class).setStatisticsEnabled(false);
+            g.cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).setStatisticsEnabled(false);
         }
 
-        IgniteCache<Object, Object> jcache = grid(0).cache(null);
+        IgniteCache<Object, Object> jcache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         // Write to cache.
         for (int i = 0; i < KEY_CNT; i++)
@@ -141,7 +141,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         // Assert that statistics is clear.
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).localMetrics();
+            CacheMetrics m = grid(i).cache(DEFAULT_CACHE_NAME).localMetrics();
 
             assertEquals(m.getCacheGets(), 0);
             assertEquals(m.getCachePuts(), 0);
@@ -160,7 +160,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetMetricsSnapshot() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertNotSame("Method metrics() should return snapshot.", cache.localMetrics(), cache.localMetrics());
     }
@@ -169,7 +169,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetAndRemoveAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
@@ -186,7 +186,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testRemoveAsyncValAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         Integer key = 0;
 
@@ -213,7 +213,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testRemoveAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
@@ -230,7 +230,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testRemoveAllAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         cache.put(1, 1);
         cache.put(2, 2);
@@ -254,7 +254,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testRemoveAllAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         Set<Integer> keys = new LinkedHashSet<>();
 
@@ -283,7 +283,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         cache.put(1, 1);
 
@@ -304,7 +304,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetAllAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
@@ -328,7 +328,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetAllAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
@@ -356,7 +356,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testPutAvgTime() throws Exception {
-        final IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
         assertEquals(0, cache.localMetrics().getCachePuts());
@@ -373,7 +373,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testPutAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
         assertEquals(0, cache.localMetrics().getCachePuts());
@@ -389,7 +389,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetAndPutAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         Integer key = null;
 
@@ -416,7 +416,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testPutIfAbsentAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         Integer key = null;
 
@@ -441,7 +441,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testGetAndPutIfAbsentAsyncAvgTime() throws Exception {
-        IgniteCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         Integer key = null;
 
@@ -466,7 +466,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testPutAllAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
         assertEquals(0, cache.localMetrics().getCachePuts());
@@ -489,7 +489,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testPutsReads() throws Exception {
-        IgniteCache<Integer, Integer> cache0 = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache0 = grid(0).cache(DEFAULT_CACHE_NAME);
 
         int keyCnt = keyCount();
 
@@ -508,7 +508,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             info("Puts: " + cache0.localMetrics().getCachePuts());
 
             for (int j = 0; j < gridCount(); j++) {
-                IgniteCache<Integer, Integer> cache = grid(j).cache(null);
+                IgniteCache<Integer, Integer> cache = grid(j).cache(DEFAULT_CACHE_NAME);
 
                 int cacheWrites = (int)cache.localMetrics().getCachePuts();
 
@@ -527,7 +527,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         int 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();
 
             puts += m.getCachePuts();
             reads += m.getCacheGets();
@@ -547,7 +547,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testMissHitPercentage() throws Exception {
-        IgniteCache<Integer, Integer> cache0 = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache0 = grid(0).cache(DEFAULT_CACHE_NAME);
 
         final int keyCnt = keyCount();
 
@@ -558,7 +558,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             info("Puts: " + cache0.localMetrics().getCachePuts());
 
             for (int j = 0; j < gridCount(); j++) {
-                IgniteCache<Integer, Integer> cache = grid(j).cache(null);
+                IgniteCache<Integer, Integer> cache = grid(j).cache(DEFAULT_CACHE_NAME);
 
                 long cacheWrites = cache.localMetrics().getCachePuts();
 
@@ -570,7 +570,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         // Check metrics for the whole cache.
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).localMetrics();
+            CacheMetrics m = grid(i).cache(DEFAULT_CACHE_NAME).localMetrics();
 
             assertEquals(m.getCacheHits() * 100f / m.getCacheGets(), m.getCacheHitPercentage(), 0.1f);
             assertEquals(m.getCacheMisses() * 100f / m.getCacheGets(), m.getCacheMissPercentage(), 0.1f);
@@ -583,7 +583,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testMisses() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-4536");
 
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         int keyCnt = keyCount();
 
@@ -607,7 +607,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         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();
 
             puts += m.getCachePuts();
             reads += m.getCacheGets();
@@ -627,7 +627,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testMissesOnEmptyCache() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-4536");
 
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         assertEquals("Expected 0 read", 0, cache.localMetrics().getCacheGets());
         assertEquals("Expected 0 miss", 0, cache.localMetrics().getCacheMisses());
@@ -665,7 +665,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testRemoves() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         cache.put(1, 1);
 
@@ -681,7 +681,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testManualEvictions() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-4536");
 
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         if (cache.getConfiguration(CacheConfiguration.class).getCacheMode() == CacheMode.PARTITIONED)
             return;
@@ -698,7 +698,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testTxEvictions() throws Exception {
-        if (grid(0).cache(null).getConfiguration(CacheConfiguration.class).getAtomicityMode() != CacheAtomicityMode.ATOMIC)
+        if (grid(0).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getAtomicityMode() != CacheAtomicityMode.ATOMIC)
             checkTtl(true);
     }
 
@@ -706,7 +706,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testNonTxEvictions() throws Exception {
-        if (grid(0).cache(null).getConfiguration(CacheConfiguration.class).getAtomicityMode() == CacheAtomicityMode.ATOMIC)
+        if (grid(0).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getAtomicityMode() == CacheAtomicityMode.ATOMIC)
             checkTtl(false);
     }
 
@@ -719,13 +719,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(MILLISECONDS, ttl));
 
-        final IgniteCache<Integer, Integer> c = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> c = grid(0).cache(DEFAULT_CACHE_NAME);
 
         final Integer key = primaryKeys(jcache(0), 1, 0).get(0);
 
         c.put(key, 1);
 
-        GridCacheAdapter<Object, Object> c0 = ((IgniteKernal)grid(0)).internalCache();
+        GridCacheAdapter<Object, Object> c0 = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME);
 
         if (c0.isNear())
             c0 = c0.context().near().dht();
@@ -744,13 +744,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             Transaction tx = grid(0).transactions().txStart();
 
             try {
-                grid(0).cache(null).withExpiryPolicy(expiry).put(key, 1);
+                grid(0).cache(DEFAULT_CACHE_NAME).withExpiryPolicy(expiry).put(key, 1);
             }
             finally {
                 tx.rollback();
             }
 
-            entry = ((IgniteKernal)grid(0)).internalCache().entryEx(key);
+            entry = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME).entryEx(key);
 
             assertEquals(0, entry.ttl());
             assertEquals(0, entry.expireTime());
@@ -760,7 +760,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         Transaction tx = inTx ? grid(0).transactions().txStart() : null;
 
         try {
-            grid(0).cache(null).withExpiryPolicy(expiry).put(key, 1);
+            grid(0).cache(DEFAULT_CACHE_NAME).withExpiryPolicy(expiry).put(key, 1);
         }
         finally {
             if (tx != null)
@@ -770,8 +770,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         long[] expireTimes = new long[gridCount()];
 
         for (int i = 0; i < gridCount(); i++) {
-            if (grid(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key)) {
-                c0 = ((IgniteKernal)grid(i)).internalCache();
+            if (grid(i).affinity(DEFAULT_CACHE_NAME).isPrimaryOrBackup(grid(i).localNode(), key)) {
+                c0 = ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME);
 
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
@@ -792,7 +792,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         tx = inTx ? grid(0).transactions().txStart() : null;
 
         try {
-            grid(0).cache(null).withExpiryPolicy(expiry).put(key, 2);
+            grid(0).cache(DEFAULT_CACHE_NAME).withExpiryPolicy(expiry).put(key, 2);
         }
         finally {
             if (tx != null)
@@ -800,8 +800,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         }
 
         for (int i = 0; i < gridCount(); i++) {
-            if (grid(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key)) {
-                c0 = ((IgniteKernal)grid(i)).internalCache();
+            if (grid(i).affinity(DEFAULT_CACHE_NAME).isPrimaryOrBackup(grid(i).localNode(), key)) {
+                c0 = ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME);
 
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
@@ -822,7 +822,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         tx = inTx ? grid(0).transactions().txStart() : null;
 
         try {
-            grid(0).cache(null).withExpiryPolicy(expiry).put(key, 3);
+            grid(0).cache(DEFAULT_CACHE_NAME).withExpiryPolicy(expiry).put(key, 3);
         }
         finally {
             if (tx != null)
@@ -830,8 +830,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         }
 
         for (int i = 0; i < gridCount(); i++) {
-            if (grid(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key)) {
-                c0 = ((IgniteKernal)grid(i)).internalCache();
+            if (grid(i).affinity(DEFAULT_CACHE_NAME).isPrimaryOrBackup(grid(i).localNode(), key)) {
+                c0 = ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME);
 
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
@@ -864,8 +864,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         log.info("Put 4 done");
 
         for (int i = 0; i < gridCount(); i++) {
-            if (grid(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key)) {
-                c0 = ((IgniteKernal)grid(i)).internalCache();
+            if (grid(i).affinity(DEFAULT_CACHE_NAME).isPrimaryOrBackup(grid(i).localNode(), key)) {
+                c0 = ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME);
 
                 if (c0.isNear())
                     c0 = c0.context().near().dht();
@@ -905,7 +905,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }, Math.min(ttl * 10, getTestTimeout())));
 
-        c0 = ((IgniteKernal)grid(0)).internalCache();
+        c0 = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME);
 
         if (c0.isNear())
             c0 = c0.context().near().dht();

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
index 0a36b75..faa19dc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
@@ -190,9 +190,9 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCommonAbstr
         final TransactionIsolation txIsolation) throws Exception {
         assertEquals(testClientNode(), (boolean) grid(0).configuration().isClientMode());
 
-        grid(0).destroyCache(null);
+        grid(0).destroyCache(DEFAULT_CACHE_NAME);
 
-        CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>();
+        CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
 
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
@@ -446,7 +446,7 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCommonAbstr
         for (int i = 0; i < GRID_CNT; i++) {
             Ignite ignite = grid(i);
 
-            IgniteCache<Integer, Integer> cache = ignite.cache(null);
+            IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
             for (Map.Entry<Integer, GridTuple<Integer>> expVal : expVals.entrySet()) {
                 Integer val = cache.get(expVal.getKey());

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index c40d44d..822537c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -369,7 +369,7 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
      */
     @SuppressWarnings({"unchecked"})
     @Override protected IgniteCache<String, Integer> jcache(int idx) {
-        return ignite(idx).cache(null);
+        return ignite(idx).cache(DEFAULT_CACHE_NAME);
     }
 
     /**
@@ -381,7 +381,7 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
             throw new UnsupportedOperationException("Operation can't be done automatically via proxy. " +
                 "Send task with this logic on remote jvm instead.");
 
-        return ((IgniteKernal)grid(idx)).<String, Integer>internalCache().context();
+        return ((IgniteKernal)grid(idx)).<String, Integer>internalCache(DEFAULT_CACHE_NAME).context();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
index 1306319..37355f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
@@ -68,9 +68,8 @@ public abstract class GridCacheAbstractUsersAffinityMapperSelfTest extends GridC
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        CacheConfiguration cacheCfg = new CacheConfiguration();
+        CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
-        cacheCfg.setName(null);
         cacheCfg.setCacheMode(getCacheMode());
         cacheCfg.setAtomicityMode(getAtomicMode());
         cacheCfg.setNearConfiguration(nearConfiguration());
@@ -108,7 +107,7 @@ public abstract class GridCacheAbstractUsersAffinityMapperSelfTest extends GridC
      * @throws Exception If failed.
      */
     public void testAffinityMapper() throws Exception {
-        IgniteCache<Object, Object> cache = startGrid(0).cache(null);
+        IgniteCache<Object, Object> cache = startGrid(0).cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < KEY_CNT; i++) {
             cache.put(String.valueOf(i), String.valueOf(i));
@@ -121,7 +120,7 @@ public abstract class GridCacheAbstractUsersAffinityMapperSelfTest extends GridC
         startGrid(1);
 
         for (int i = 0; i < KEY_CNT; i++)
-            grid(i % 2).compute().affinityRun((String)null, new TestAffinityKey(1, "1"), new NoopClosure());
+            grid(i % 2).compute().affinityRun(DEFAULT_CACHE_NAME, new TestAffinityKey(1, "1"), new NoopClosure());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityApiSelfTest.java
index 8294b0d..c146525 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityApiSelfTest.java
@@ -70,14 +70,14 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
      * @return Affinity.
      */
     private AffinityFunction affinity() {
-        return ((IgniteKernal)grid(0)).internalCache().configuration().getAffinity();
+        return ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME).configuration().getAffinity();
     }
 
     /**
      * @return Affinity mapper.
      */
     private AffinityKeyMapper affinityMapper() {
-        return ((IgniteKernal)grid(0)).internalCache().configuration().getAffinityMapper();
+        return ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME).configuration().getAffinityMapper();
     }
 
     /**
@@ -86,7 +86,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
      * @throws Exception If failed.
      */
     public void testPartitions() throws Exception {
-        assertEquals(affinity().partitions(), grid(0).affinity(null).partitions());
+        assertEquals(affinity().partitions(), grid(0).affinity(DEFAULT_CACHE_NAME).partitions());
     }
 
     /**
@@ -97,7 +97,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
     public void testPartition() throws Exception {
         String key = "key";
 
-        assertEquals(affinity().partition(key), grid(0).affinity(null).partition(key));
+        assertEquals(affinity().partition(key), grid(0).affinity(DEFAULT_CACHE_NAME).partition(key));
     }
 
     /**
@@ -113,7 +113,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
         List<List<ClusterNode>> assignment = affinity().assignPartitions(ctx);
 
         for (ClusterNode node : grid(0).cluster().nodes()) {
-            int[] parts = grid(0).affinity(null).primaryPartitions(node);
+            int[] parts = grid(0).affinity(DEFAULT_CACHE_NAME).primaryPartitions(node);
 
             assert !F.isEmpty(parts);
 
@@ -138,7 +138,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
         // Pick 2 nodes and create a projection over them.
         ClusterNode n0 = grid(0).localNode();
 
-        int[] parts = grid(0).affinity(null).primaryPartitions(n0);
+        int[] parts = grid(0).affinity(DEFAULT_CACHE_NAME).primaryPartitions(n0);
 
         info("Primary partitions count: " + parts.length);
 
@@ -176,7 +176,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
         ClusterNode n0 = grid(0).localNode();
 
         // Get backup partitions without explicitly specified levels.
-        int[] parts = grid(0).affinity(null).backupPartitions(n0);
+        int[] parts = grid(0).affinity(DEFAULT_CACHE_NAME).backupPartitions(n0);
 
         assert !F.isEmpty(parts);
 
@@ -210,7 +210,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
         // Pick 2 nodes and create a projection over them.
         ClusterNode n0 = grid(0).localNode();
 
-        int[] parts = grid(0).affinity(null).allPartitions(n0);
+        int[] parts = grid(0).affinity(DEFAULT_CACHE_NAME).allPartitions(n0);
 
         assert !F.isEmpty(parts);
 
@@ -245,7 +245,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
 
         List<List<ClusterNode>> assignment = aff.assignPartitions(ctx);
 
-        assertEquals(F.first(nodes(assignment, aff, part)), grid(0).affinity(null).mapPartitionToNode(part));
+        assertEquals(F.first(nodes(assignment, aff, part)), grid(0).affinity(DEFAULT_CACHE_NAME).mapPartitionToNode(part));
     }
 
     /**
@@ -254,7 +254,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
      * @throws Exception If failed.
      */
     public void testMapPartitionsToNode() throws Exception {
-        Map<Integer, ClusterNode> map = grid(0).affinity(null).mapPartitionsToNodes(F.asList(0, 1, 5, 19, 12));
+        Map<Integer, ClusterNode> map = grid(0).affinity(DEFAULT_CACHE_NAME).mapPartitionsToNodes(F.asList(0, 1, 5, 19, 12));
 
         AffinityFunctionContext ctx =
             new GridAffinityFunctionContextImpl(new ArrayList<>(grid(0).cluster().nodes()), null, null,
@@ -274,7 +274,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
      * @throws Exception If failed.
      */
     public void testMapPartitionsToNodeArray() throws Exception {
-        Map<Integer, ClusterNode> map = grid(0).affinity(null).mapPartitionsToNodes(F.asList(0, 1, 5, 19, 12));
+        Map<Integer, ClusterNode> map = grid(0).affinity(DEFAULT_CACHE_NAME).mapPartitionsToNodes(F.asList(0, 1, 5, 19, 12));
 
         AffinityFunctionContext ctx =
             new GridAffinityFunctionContextImpl(new ArrayList<>(grid(0).cluster().nodes()), null, null,
@@ -299,7 +299,7 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
         for (int p = 0; p < affinity().partitions(); p++)
             parts.add(p);
 
-        Map<Integer, ClusterNode> map = grid(0).affinity(null).mapPartitionsToNodes(parts);
+        Map<Integer, ClusterNode> map = grid(0).affinity(DEFAULT_CACHE_NAME).mapPartitionsToNodes(parts);
 
         AffinityFunctionContext ctx =
             new GridAffinityFunctionContextImpl(new ArrayList<>(grid(0).cluster().nodes()), null, null,
@@ -343,6 +343,6 @@ public class GridCacheAffinityApiSelfTest extends GridCacheAbstractSelfTest {
         int expPart = affinity().partition(affinityMapper().affinityKey(key));
 
         for (int i = 0; i < gridCount(); i++)
-            assertEquals(expPart, grid(i).affinity(null).partition(key));
+            assertEquals(expPart, grid(i).affinity(DEFAULT_CACHE_NAME).partition(key));
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
index 901caa2..0df4887 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
@@ -118,7 +118,7 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
         assert G.allGrids().size() == GRID_CNT;
 
         for (int i = 0; i < KEY_CNT; i++) {
-            grid(0).cache(null).put(i, i);
+            grid(0).cache(DEFAULT_CACHE_NAME).put(i, i);
 
             grid(0).cache(NON_DFLT_CACHE_NAME).put(i, i);
         }
@@ -276,8 +276,8 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
 
         /** {@inheritDoc} */
         @Override public void applyx() throws IgniteCheckedException {
-            assert ignite.cluster().localNode().id().equals(ignite.affinity(null).mapKeyToNode(affKey).id());
-            assert ignite.cluster().localNode().id().equals(ignite.affinity(null).mapKeyToNode(key).id());
+            assert ignite.cluster().localNode().id().equals(ignite.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(affKey).id());
+            assert ignite.cluster().localNode().id().equals(ignite.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id());
         }
     }
 
@@ -412,8 +412,8 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
 
         /** {@inheritDoc} */
         @Override public Object call() throws IgniteCheckedException {
-            assert ignite.cluster().localNode().id().equals(ignite.affinity(null).mapKeyToNode(affKey).id());
-            assert ignite.cluster().localNode().id().equals(ignite.affinity(null).mapKeyToNode(key).id());
+            assert ignite.cluster().localNode().id().equals(ignite.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(affKey).id());
+            assert ignite.cluster().localNode().id().equals(ignite.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id());
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
index 80b1aa8..4f513b3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
@@ -100,7 +100,7 @@ public class GridCacheAtomicEntryProcessorDeploymentSelfTest extends GridCommonA
      * @return Cache.
      */
     protected IgniteCache getCache(){
-        return grid(1).cache(null);
+        return grid(1).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/GridCacheAtomicMessageCountSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
index 1365577..ca94c7f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
@@ -66,7 +66,7 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest
 
         cfg.setDiscoverySpi(discoSpi);
 
-        CacheConfiguration cCfg = new CacheConfiguration();
+        CacheConfiguration cCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         cCfg.setCacheMode(PARTITIONED);
         cCfg.setBackups(1);
@@ -108,7 +108,7 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest
 
         startGrids(4);
 
-        ignite(0).cache(null);
+        ignite(0).cache(DEFAULT_CACHE_NAME);
 
         try {
             awaitPartitionMapExchange();
@@ -129,7 +129,7 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest
             for (int i = 0; i < putCnt; i++) {
                 ClusterNode locNode = grid(0).localNode();
 
-                Affinity<Object> affinity = ignite(0).affinity(null);
+                Affinity<Object> affinity = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
                 if (affinity.isPrimary(locNode, i))
                     expDhtCnt++;

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
index f4d8336..f766d01 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
@@ -89,7 +89,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception If test failed.
      */
     public void testBasicLock() throws Exception {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         Lock lock = cache.lock(1);
 
@@ -106,7 +106,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws IgniteCheckedException If test failed.
      */
     public void testSingleLockReentry() throws IgniteCheckedException {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         Lock lock = cache.lock(1);
 
@@ -134,7 +134,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception If test failed.
      */
     public void testReentry() throws Exception {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         Lock lock = cache.lock(1);
 
@@ -173,7 +173,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      *
      */
     public void testInterruptLock() throws InterruptedException {
-        final IgniteCache<Integer, String> cache = ignite.cache(null);
+        final IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         final Lock lock = cache.lock(1);
 
@@ -217,12 +217,12 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      *
      */
     public void testInterruptLockWithTimeout() throws Exception {
-        final IgniteCache<Integer, String> cache = ignite.cache(null);
+        final IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         startGrid(1);
 
         try {
-            final List<Integer> keys = primaryKeys(grid(1).cache(null), 2, 1);
+            final List<Integer> keys = primaryKeys(grid(1).cache(DEFAULT_CACHE_NAME), 2, 1);
 
             Lock lock1 = cache.lock(keys.get(1));
 
@@ -262,8 +262,8 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
             assertFalse(cache.isLocalLocked(keys.get(0), false));
             assertFalse(cache.isLocalLocked(keys.get(1), false));
 
-            assertFalse(grid(1).cache(null).isLocalLocked(keys.get(0), false));
-            assertFalse(grid(1).cache(null).isLocalLocked(keys.get(1), false));
+            assertFalse(grid(1).cache(DEFAULT_CACHE_NAME).isLocalLocked(keys.get(0), false));
+            assertFalse(grid(1).cache(DEFAULT_CACHE_NAME).isLocalLocked(keys.get(1), false));
 
             assertTrue(isOk.get());
         }
@@ -276,7 +276,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws IgniteCheckedException If test failed.
      */
     public void testManyLockReentries() throws IgniteCheckedException {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         Integer key = 1;
 
@@ -319,7 +319,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception If test failed.
      */
     public void testLockMultithreaded() throws Exception {
-        final IgniteCache<Integer, String> cache = ignite.cache(null);
+        final IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         final CountDownLatch l1 = new CountDownLatch(1);
         final CountDownLatch l2 = new CountDownLatch(1);
@@ -437,7 +437,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception If error occur.
      */
     public void testBasicOps() throws Exception {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         CountDownLatch latch = new CountDownLatch(1);
 
@@ -498,7 +498,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception If error occur.
      */
     public void testBasicOpsWithReentry() throws Exception {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         int key = (int)System.currentTimeMillis();
 
@@ -570,7 +570,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception If test failed.
      */
     public void testMultiLocks() throws Exception {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         Collection<Integer> keys = Arrays.asList(1, 2, 3);
 
@@ -601,7 +601,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws IgniteCheckedException If test failed.
      */
     public void testGetPutRemove() throws IgniteCheckedException {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         int key = (int)System.currentTimeMillis();
 
@@ -625,7 +625,7 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
      * @throws Exception In case of error.
      */
     public void testPutWithExpiration() throws Exception {
-        IgniteCache<Integer, String> cache = ignite.cache(null);
+        IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
         CacheEventListener lsnr = new CacheEventListener(new CountDownLatch(1));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
index 69de233..82c4659 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
@@ -78,14 +78,14 @@ public class GridCacheClearLocallySelfTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        CacheConfiguration ccfgLoc = new CacheConfiguration();
+        CacheConfiguration ccfgLoc = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfgLoc.setName(CACHE_LOCAL);
         ccfgLoc.setCacheMode(LOCAL);
         ccfgLoc.setWriteSynchronizationMode(FULL_SYNC);
         ccfgLoc.setAtomicityMode(TRANSACTIONAL);
 
-        CacheConfiguration ccfgPartitioned = new CacheConfiguration();
+        CacheConfiguration ccfgPartitioned = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfgPartitioned.setName(CACHE_PARTITIONED);
         ccfgPartitioned.setCacheMode(PARTITIONED);
@@ -99,7 +99,7 @@ public class GridCacheClearLocallySelfTest extends GridCommonAbstractTest {
 
         ccfgPartitioned.setAtomicityMode(TRANSACTIONAL);
 
-        CacheConfiguration ccfgColocated = new CacheConfiguration();
+        CacheConfiguration ccfgColocated = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfgColocated.setName(CACHE_COLOCATED);
         ccfgColocated.setCacheMode(PARTITIONED);
@@ -107,7 +107,7 @@ public class GridCacheClearLocallySelfTest extends GridCommonAbstractTest {
         ccfgColocated.setWriteSynchronizationMode(FULL_SYNC);
         ccfgColocated.setAtomicityMode(TRANSACTIONAL);
 
-        CacheConfiguration ccfgReplicated = new CacheConfiguration();
+        CacheConfiguration ccfgReplicated = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfgReplicated.setName(CACHE_REPLICATED);
         ccfgReplicated.setCacheMode(REPLICATED);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapSelfTest.java
index 0218394..593fc3e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapSelfTest.java
@@ -77,7 +77,7 @@ public class GridCacheConcurrentMapSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testRehash() throws Exception {
-        IgniteCache<Integer, String> c = grid().cache(null);
+        IgniteCache<Integer, String> c = grid().cache(DEFAULT_CACHE_NAME);
 
         int cnt = 100 * 1024;
 
@@ -108,7 +108,7 @@ public class GridCacheConcurrentMapSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testRehashRandom() throws Exception {
-        IgniteCache<Integer, String> c = grid().cache(null);
+        IgniteCache<Integer, String> c = grid().cache(DEFAULT_CACHE_NAME);
 
         int cnt = 100 * 1024;
 
@@ -156,7 +156,7 @@ public class GridCacheConcurrentMapSelfTest extends GridCommonAbstractTest {
         multithreaded(new Callable<Object>() {
             @SuppressWarnings("UnusedAssignment")
             @Override public Object call() throws Exception {
-                IgniteCache<Integer, String> c = grid().cache(null);
+                IgniteCache<Integer, String> c = grid().cache(DEFAULT_CACHE_NAME);
 
                 int tid = tidGen.getAndIncrement();
 
@@ -228,7 +228,7 @@ public class GridCacheConcurrentMapSelfTest extends GridCommonAbstractTest {
         multithreaded(new Callable<Object>() {
             @SuppressWarnings("UnusedAssignment")
             @Override public Object call() throws Exception {
-                IgniteCache<Integer, String> c = grid().cache(null);
+                IgniteCache<Integer, String> c = grid().cache(DEFAULT_CACHE_NAME);
 
                 int tid = tidGen.getAndIncrement();
 
@@ -313,7 +313,7 @@ public class GridCacheConcurrentMapSelfTest extends GridCommonAbstractTest {
      */
     @SuppressWarnings("ResultOfObjectAllocationIgnored")
     public void testEmptyWeakIterator() throws Exception {
-        final IgniteCache<Integer, String> c = grid().cache(null);
+        final IgniteCache<Integer, String> c = grid().cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < 10; i++) {
             multithreaded(new Callable<Object>() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
index 3656270..e7e7840 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
@@ -227,7 +227,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
                     String terminalId = String.valueOf(++tid);
 
                     // Server partition cache
-                    UUID mappedId = srvr1.affinity(null).mapKeyToNode(terminalId).id();
+                    UUID mappedId = srvr1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(terminalId).id();
 
                     if (!srvrId.equals(mappedId))
                         continue;
@@ -475,7 +475,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
 
             doWork();
 
-            GridNearCacheAdapter near = (GridNearCacheAdapter)((IgniteKernal) ignite).internalCache();
+            GridNearCacheAdapter near = (GridNearCacheAdapter)((IgniteKernal) ignite).internalCache(DEFAULT_CACHE_NAME);
             GridDhtCacheAdapter dht = near.dht();
 
             long start = cntrs.get2().get();
@@ -604,7 +604,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
                         if (g.name().contains("server")) {
                             GridNearCacheAdapter<AffinityKey<String>, Object> near =
                                 (GridNearCacheAdapter<AffinityKey<String>, Object>)((IgniteKernal)g).
-                                    <AffinityKey<String>, Object>internalCache();
+                                    <AffinityKey<String>, Object>internalCache(DEFAULT_CACHE_NAME);
                             GridDhtCacheAdapter<AffinityKey<String>, Object> dht = near.dht();
 
                             for (AffinityKey<String> k : keys) {
@@ -692,7 +692,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
          * @param terminalId Terminal ID.
          */
         private void put(Object o, String cacheKey, String terminalId) {
-//            CacheProjection<AffinityKey<String>, Object> cache = ((IgniteKernal)ignite).cache(null);
+//            CacheProjection<AffinityKey<String>, Object> cache = ((IgniteKernal)ignite).cache(DEFAULT_CACHE_NAME);
 //
 //            AffinityKey<String> affinityKey = new AffinityKey<>(cacheKey, terminalId);
 //
@@ -711,7 +711,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
         private <T> Object get(String cacheKey, String terminalId) {
             Object key = new AffinityKey<>(cacheKey, terminalId);
 
-            return (T) ignite.cache(null).get(key);
+            return (T) ignite.cache(DEFAULT_CACHE_NAME).get(key);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
index b26b582..eefdf9d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
@@ -94,7 +94,7 @@ public class GridCacheConditionalDeploymentSelfTest extends GridCommonAbstractTe
 
         awaitPartitionMapExchange();
 
-        ignite0.cache(null).put(1, new TestValue());
+        ignite0.cache(DEFAULT_CACHE_NAME).put(1, new TestValue());
     }
 
     /** {@inheritDoc} */
@@ -168,7 +168,7 @@ public class GridCacheConditionalDeploymentSelfTest extends GridCommonAbstractTe
     }
 
     protected GridCacheContext cacheContext() {
-        return ((IgniteCacheProxy)grid(0).cache(null)).context();
+        return ((IgniteCacheProxy)grid(0).cache(DEFAULT_CACHE_NAME)).context();
     }
 
     protected GridCacheIoManager cacheIoManager() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
index 6a153b3..2865627 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
@@ -68,7 +68,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
     private boolean cacheEnabled;
 
     /** */
-    private String cacheName;
+    private String cacheName = DEFAULT_CACHE_NAME;
 
     /** */
     private CacheMode cacheMode = REPLICATED;

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDaemonNodeAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDaemonNodeAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDaemonNodeAbstractSelfTest.java
index aaaac0d..8077251 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDaemonNodeAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDaemonNodeAbstractSelfTest.java
@@ -98,7 +98,7 @@ public abstract class GridCacheDaemonNodeAbstractSelfTest extends GridCommonAbst
 
             startGrid(4);
 
-            IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
             for (int i = 0; i < 30; i++)
                 cache.put(i, i);
@@ -129,7 +129,7 @@ public abstract class GridCacheDaemonNodeAbstractSelfTest extends GridCommonAbst
 
             startGrid(4);
 
-            IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
             for (int i = 0; i < 30; i++) {
                 try (Transaction tx = ignite(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
@@ -174,14 +174,14 @@ public abstract class GridCacheDaemonNodeAbstractSelfTest extends GridCommonAbst
 
             for (long i = 0; i < Integer.MAX_VALUE; i = (i << 1) + 1) {
                 // Call mapKeyToNode for normal node.
-                assertNotNull(g1.<Long>affinity(null).mapKeyToNode(i));
+                assertNotNull(g1.<Long>affinity(DEFAULT_CACHE_NAME).mapKeyToNode(i));
 
                 // Call mapKeyToNode for daemon node.
                 final long i0 = i;
 
                 GridTestUtils.assertThrows(log, new Callable<Object>() {
                     @Override public Object call() throws Exception {
-                        return g2.<Long>affinity(null).mapKeyToNode(i0);
+                        return g2.<Long>affinity(DEFAULT_CACHE_NAME).mapKeyToNode(i0);
                     }
                 }, IgniteException.class, "Failed to find cache");
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
index 933165b..c88d0cc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
@@ -170,7 +170,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.affinity(null).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
+                if (g1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
                     break;
             }
 
@@ -205,7 +205,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.affinity(null).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
+                if (g1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
                     break;
             }
 
@@ -214,15 +214,15 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             stopGrid(IGNITE_INSTANCE_NAME);
 
             for (int i = 0; i < 10; i++) {
-                if (g1.cache(null).localSize() == 0 && g2.cache(null).localSize() == 0)
+                if (g1.cache(DEFAULT_CACHE_NAME).localSize() == 0 && g2.cache(DEFAULT_CACHE_NAME).localSize() == 0)
                     break;
 
                 U.sleep(500);
             }
 
-            assertEquals(0, g1.cache(null).localSize());
+            assertEquals(0, g1.cache(DEFAULT_CACHE_NAME).localSize());
 
-            assertEquals(isCacheUndeployed(g1) ? 0 : 1, g2.cache(null).localSize());
+            assertEquals(isCacheUndeployed(g1) ? 0 : 1, g2.cache(DEFAULT_CACHE_NAME).localSize());
 
             startGrid(3);
         }
@@ -268,8 +268,8 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.affinity(null).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()) &&
-                    g1.affinity(null).isBackup((backupLeavesGrid ? g0 : g1).cluster().localNode(), key))
+                if (g1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()) &&
+                    g1.affinity(DEFAULT_CACHE_NAME).isBackup((backupLeavesGrid ? g0 : g1).cluster().localNode(), key))
                     break;
             }
 
@@ -277,9 +277,9 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
 
             stopGrid(IGNITE_INSTANCE_NAME);
 
-            assertEquals(1, g1.cache(null).localSize(CachePeekMode.ALL));
+            assertEquals(1, g1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL));
 
-            assertEquals(1, g2.cache(null).localSize(CachePeekMode.ALL));
+            assertEquals(1, g2.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL));
 
             startGrid(3);
         }
@@ -314,7 +314,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
 
             info("Key: " + key);
 
-            IgniteCache<Object, Object> cache = g0.cache(null);
+            IgniteCache<Object, Object> cache = g0.cache(DEFAULT_CACHE_NAME);
 
             assert cache != null;
 
@@ -363,7 +363,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.affinity(null).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
+                if (g1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
                     break;
             }
 
@@ -396,7 +396,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.affinity(null).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
+                if (g1.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()))
                     break;
             }
 
@@ -422,7 +422,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
 
             Ignite g = startGrid(0);
 
-            g.cache(null).put(0, valCls.newInstance());
+            g.cache(DEFAULT_CACHE_NAME).put(0, valCls.newInstance());
 
             info("Added value to cache 0.");
 
@@ -463,10 +463,10 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             Ignite g1 = startGrid(1);
 
             for (int i = 0; i < 20; i++)
-                g0.cache(null).put(i, valCls.newInstance());
+                g0.cache(DEFAULT_CACHE_NAME).put(i, valCls.newInstance());
 
-            assert g0.cache(null).localSize(CachePeekMode.ALL) > 0 : "Cache is empty";
-            assert g1.cache(null).localSize(CachePeekMode.ALL) > 0 : "Cache is empty";
+            assert g0.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL) > 0 : "Cache is empty";
+            assert g1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL) > 0 : "Cache is empty";
 
             g0.compute(g0.cluster().forRemotes()).execute(taskCls, g1.cluster().localNode());
 
@@ -474,23 +474,23 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
 
             if (depMode == SHARED && isCacheUndeployed(g1)) {
                 for (int i = 0; i < 10; i++) {
-                    if (g1.cache(null).localSize(CachePeekMode.ALL) == 0)
+                    if (g1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL) == 0)
                         break;
 
                     Thread.sleep(500);
                 }
 
-                assertEquals(0, g1.cache(null).localSize(CachePeekMode.ALL));
+                assertEquals(0, g1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL));
             }
             else {
                 for (int i = 0; i < 4; i++) {
-                    if (g1.cache(null).localSize(CachePeekMode.ALL) == 0)
+                    if (g1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL) == 0)
                         break;
 
                     Thread.sleep(500);
                 }
 
-                assert g1.cache(null).localSize(CachePeekMode.ALL) > 0 : "Cache undeployed unexpectadly";
+                assert g1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.ALL) > 0 : "Cache undeployed unexpectadly";
             }
         }
         finally {
@@ -516,9 +516,9 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
         info("Near: " + near);
 
         for (int i = start; i < start + 10000; i++) {
-            if (g.affinity(null).isPrimary(primary, i) && g.affinity(null).isBackup(backup, i)) {
-                assert !g.affinity(null).isPrimary(near, i) : "Key: " + i;
-                assert !g.affinity(null).isBackup(near, i) : "Key: " + i;
+            if (g.affinity(DEFAULT_CACHE_NAME).isPrimary(primary, i) && g.affinity(DEFAULT_CACHE_NAME).isBackup(backup, i)) {
+                assert !g.affinity(DEFAULT_CACHE_NAME).isPrimary(near, i) : "Key: " + i;
+                assert !g.affinity(DEFAULT_CACHE_NAME).isBackup(near, i) : "Key: " + i;
 
                 return i;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
index d361d45..b10ff70 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
@@ -226,7 +226,7 @@ public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
                 while (true) {
                     key++;
 
-                    if (grid(0).affinity(null).mapKeyToNode(key).equals(grid(0).localNode())) {
+                    if (grid(0).affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).equals(grid(0).localNode())) {
                         if (i > 0)
                             jcache(0).put(key, new Value(new byte[i * 1024]));
 
@@ -278,7 +278,7 @@ public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
                 while (true) {
                     key++;
 
-                    if (grid(0).affinity(null).mapKeyToNode(key).equals(grid(0).localNode())) {
+                    if (grid(0).affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).equals(grid(0).localNode())) {
                         if (i > 0)
                             jcache(0).put(key, new Value(new byte[i * 1024]));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
index 79b77ed..9e933be 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
@@ -53,7 +53,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
 
         discoSpi.setIpFinder(IP_FINDER);
 
-        CacheConfiguration ccfg = new CacheConfiguration();
+        CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         ccfg.setCacheMode(PARTITIONED);
         ccfg.setBackups(1);
@@ -96,23 +96,23 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
 
             for (Integer key : map.keySet()) {
                 info("Affinity nodes [key=" + key + ", nodes=" +
-                    F.viewReadOnly(grid(0).affinity(null).mapKeyToPrimaryAndBackups(key), F.node2id()) + ']');
+                    F.viewReadOnly(grid(0).affinity(DEFAULT_CACHE_NAME).mapKeyToPrimaryAndBackups(key), F.node2id()) + ']');
             }
 
-            grid(0).cache(null).putAll(map);
+            grid(0).cache(DEFAULT_CACHE_NAME).putAll(map);
 
             for (int g = 0; g < 3; g++) {
                 IgniteKernal grid = (IgniteKernal)grid(g);
 
                 for (Integer key : map.keySet()) {
-                    GridCacheAdapter<Object, Object> cache = grid.internalCache();
+                    GridCacheAdapter<Object, Object> cache = grid.internalCache(DEFAULT_CACHE_NAME);
 
                     GridCacheEntryEx entry = cache.peekEx(key);
 
                     if (entry != null) {
                         GridCacheVersion ver = entry.version();
 
-                        long order = grid.affinity(null).mapKeyToNode(key).order();
+                        long order = grid.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).order();
 
                         // Check topology version.
                         assertEquals(3, ver.topologyVersion() -
@@ -126,20 +126,20 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
 
             startGrid(3);
 
-            grid(0).cache(null).putAll(map);
+            grid(0).cache(DEFAULT_CACHE_NAME).putAll(map);
 
             for (int g = 0; g < 4; g++) {
                 IgniteKernal grid = (IgniteKernal)grid(g);
 
                 for (Integer key : map.keySet()) {
-                    GridCacheAdapter<Object, Object> cache = grid.internalCache();
+                    GridCacheAdapter<Object, Object> cache = grid.internalCache(DEFAULT_CACHE_NAME);
 
                     GridCacheEntryEx entry = cache.peekEx(key);
 
                     if (entry != null) {
                         GridCacheVersion ver = entry.version();
 
-                        long order = grid.affinity(null).mapKeyToNode(key).order();
+                        long order = grid.affinity(DEFAULT_CACHE_NAME).mapKeyToNode(key).order();
 
                         // Check topology version.
                         assertEquals(4, ver.topologyVersion() -

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
index eae8dad..554a7a9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
@@ -112,7 +112,7 @@ public abstract class GridCacheEvictionEventAbstractTest extends GridCommonAbstr
             }
         }, EventType.EVT_CACHE_ENTRY_EVICTED);
 
-        IgniteCache<String, String> c = g.cache(null);
+        IgniteCache<String, String> c = g.cache(DEFAULT_CACHE_NAME);
 
         c.put("1", "val1");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
index 780b9a8..9732272 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
@@ -89,9 +89,9 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
         String key = "key";
         String val = "value";
 
-        IgniteCache<String, String> cache = grid.cache(null);
+        IgniteCache<String, String> cache = grid.cache(DEFAULT_CACHE_NAME);
 
-        int keyPart = grid.<String, String>internalCache().context().affinity().partition(key);
+        int keyPart = grid.<String, String>internalCache(DEFAULT_CACHE_NAME).context().affinity().partition(key);
 
         cache.put(key, val);
 
@@ -132,7 +132,7 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
                 if (barrier.await() == 0)
                     start.set(System.currentTimeMillis());
 
-                IgniteCache<String, String> cache = grid(0).cache(null);
+                IgniteCache<String, String> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
                 Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
 
@@ -170,7 +170,7 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
     public void testMvccFinishPartitions() throws Exception {
         String key = "key";
 
-        int keyPart = grid.internalCache().context().affinity().partition(key);
+        int keyPart = grid.internalCache(DEFAULT_CACHE_NAME).context().affinity().partition(key);
 
         // Wait for tx-enlisted partition.
         long waitTime = runLock(key, keyPart, F.asList(keyPart));
@@ -194,14 +194,14 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
      * @throws Exception If failed.
      */
     public void testMvccFinishKeys() throws Exception {
-        IgniteCache<String, Integer> cache = grid(0).cache(null);
+        IgniteCache<String, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
             final String key = "key";
 
             cache.get(key);
 
-            GridCacheAdapter<String, Integer> internal = grid.internalCache();
+            GridCacheAdapter<String, Integer> internal = grid.internalCache(DEFAULT_CACHE_NAME);
 
             KeyCacheObject cacheKey = internal.context().toCacheKeyObject(key);
 
@@ -235,7 +235,7 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
 
         final CountDownLatch latch = new CountDownLatch(1);
 
-        IgniteCache<Integer, String> cache = grid.cache(null);
+        IgniteCache<Integer, String> cache = grid.cache(DEFAULT_CACHE_NAME);
 
         Lock lock = cache.lock(key);
 
@@ -293,7 +293,7 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
 
         final CountDownLatch latch = new CountDownLatch(1);
 
-        IgniteCache<String, String> cache = grid.cache(null);
+        IgniteCache<String, String> cache = grid.cache(DEFAULT_CACHE_NAME);
 
         Lock lock = cache.lock(key);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
index d2d9cbb..e12e246 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
@@ -75,7 +75,7 @@ public class GridCacheFullTextQueryMultithreadedSelfTest extends GridCacheAbstra
         final int logFreq = 50;
         final String txt = "Value";
 
-        final GridCacheAdapter<Integer, H2TextValue> c = ((IgniteKernal)grid(0)).internalCache(null);
+        final GridCacheAdapter<Integer, H2TextValue> c = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME);
 
         IgniteInternalFuture<?> fut1 = multithreadedAsync(new Callable() {
                 @Override public Object call() throws Exception {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIncrementTransformTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIncrementTransformTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIncrementTransformTest.java
index d926d40..33b094f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIncrementTransformTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIncrementTransformTest.java
@@ -61,7 +61,7 @@ public class GridCacheIncrementTransformTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        CacheConfiguration cache = new CacheConfiguration();
+        CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
         cache.setCacheMode(PARTITIONED);
         cache.setAtomicityMode(ATOMIC);
@@ -170,7 +170,7 @@ public class GridCacheIncrementTransformTest extends GridCommonAbstractTest {
                 ignite = restarts ? grids.getAndSet(idx, null) : grid(idx);
             }
 
-            IgniteCache<String, TestObject> cache = ignite.<String, TestObject>cache(null).withNoRetries();
+            IgniteCache<String, TestObject> cache = ignite.<String, TestObject>cache(DEFAULT_CACHE_NAME).withNoRetries();
 
             assertNotNull(cache);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
index d247831..fdca159 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
@@ -1336,7 +1336,7 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
     private List<String> primaryKeys(int idx, int cnt) {
         assert cnt > 0;
 
-        Affinity aff = ignite(0).affinity(null);
+        Affinity aff = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
         List<String> keys = new ArrayList<>(cnt);
 
@@ -1361,7 +1361,7 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
      * @return Primary key for grid.
      */
     private String backupKey(int idx) {
-        Affinity aff = ignite(0).affinity(null);
+        Affinity aff = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
         String key = null;
 
@@ -1383,7 +1383,7 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
      * @return Key which does not belong to the grid.
      */
     private String nearKey(int idx) {
-        Affinity aff = ignite(0).affinity(null);
+        Affinity aff = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
         String key = null;
 
@@ -1413,7 +1413,7 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
 
         try {
             for (int i = 0; i < gridCount(); i++)
-                assertEquals("Unexpected value for grid " + i, expVal, grid(i).cache(null).get(key));
+                assertEquals("Unexpected value for grid " + i, expVal, grid(i).cache(DEFAULT_CACHE_NAME).get(key));
         }
         finally {
             interceptor.disabled = false;

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIteratorPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIteratorPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIteratorPerformanceTest.java
index 99820ec..f38a0b2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIteratorPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheIteratorPerformanceTest.java
@@ -107,7 +107,7 @@ public class GridCacheIteratorPerformanceTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testSmall() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid().cache(null);
+        IgniteCache<Integer, Integer> cache = grid().cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < SMALL_ENTRY_CNT; i++)
             cache.put(i, i);
@@ -136,7 +136,7 @@ public class GridCacheIteratorPerformanceTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testLarge() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid().cache(null);
+        IgniteCache<Integer, Integer> cache = grid().cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < LARGE_ENTRY_CNT; i++)
             cache.put(i, i);
@@ -165,7 +165,7 @@ public class GridCacheIteratorPerformanceTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testFiltered() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid().cache(null);
+        IgniteCache<Integer, Integer> cache = grid().cache(DEFAULT_CACHE_NAME);
 
         for (int i = 0; i < LARGE_ENTRY_CNT; i++)
             cache.put(i, i);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheKeyCheckSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheKeyCheckSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheKeyCheckSelfTest.java
index 0ea1ff5..ebb88a3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheKeyCheckSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheKeyCheckSelfTest.java
@@ -130,7 +130,7 @@ public class GridCacheKeyCheckSelfTest extends GridCacheAbstractSelfTest {
         this.atomicityMode = atomicityMode;
 
         try {
-            IgniteCache<IncorrectCacheKey, String> cache = grid(0).cache(null);
+            IgniteCache<IncorrectCacheKey, String> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
             cache.get(new IncorrectCacheKey(0));
 
@@ -150,7 +150,7 @@ public class GridCacheKeyCheckSelfTest extends GridCacheAbstractSelfTest {
         this.atomicityMode = atomicityMode;
 
         try {
-            IgniteCache<IncorrectCacheKey, String> cache = grid(0).cache(null);
+            IgniteCache<IncorrectCacheKey, String> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
             cache.put(new IncorrectCacheKey(0), "test_value");
 
@@ -170,7 +170,7 @@ public class GridCacheKeyCheckSelfTest extends GridCacheAbstractSelfTest {
         this.atomicityMode = atomicityMode;
 
         try {
-            IgniteCache<IncorrectCacheKey, String> cache = grid(0).cache(null);
+            IgniteCache<IncorrectCacheKey, String> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
             cache.remove(new IncorrectCacheKey(0));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallerTxAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallerTxAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallerTxAbstractTest.java
index a87a6ed..0d616d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallerTxAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallerTxAbstractTest.java
@@ -95,7 +95,7 @@ public abstract class GridCacheMarshallerTxAbstractTest extends GridCommonAbstra
 
         Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
         try {
-            grid().cache(null).put(key, value);
+            grid().cache(DEFAULT_CACHE_NAME).put(key, value);
 
             tx.commit();
         }
@@ -106,11 +106,11 @@ public abstract class GridCacheMarshallerTxAbstractTest extends GridCommonAbstra
         tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
 
         try {
-            assert value.equals(grid().cache(null).get(key));
+            assert value.equals(grid().cache(DEFAULT_CACHE_NAME).get(key));
 
-            grid().cache(null).put(key, newValue);
+            grid().cache(DEFAULT_CACHE_NAME).put(key, newValue);
 
-            grid().cache(null).put(key2, wrongValue);
+            grid().cache(DEFAULT_CACHE_NAME).put(key2, wrongValue);
 
             tx.commit();
         }
@@ -121,7 +121,7 @@ public abstract class GridCacheMarshallerTxAbstractTest extends GridCommonAbstra
         tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
 
         try {
-            String locVal = (String)grid().cache(null).get(key);
+            String locVal = (String)grid().cache(DEFAULT_CACHE_NAME).get(key);
 
             assert locVal != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
index 1f81ba5..392f8e5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
@@ -55,7 +55,7 @@ public class GridCacheMarshallingNodeJoinSelfTest extends GridCommonAbstractTest
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        CacheConfiguration<Integer, TestObject> cacheCfg = new CacheConfiguration<>();
+        CacheConfiguration<Integer, TestObject> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
 
         cacheCfg.setCacheMode(CacheMode.PARTITIONED);
         cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
@@ -116,7 +116,7 @@ public class GridCacheMarshallingNodeJoinSelfTest extends GridCommonAbstractTest
             }
         }, 1);
 
-        IgniteCache<Integer, TestObject> cache = ignite(0).cache(null);
+        IgniteCache<Integer, TestObject> cache = ignite(0).cache(DEFAULT_CACHE_NAME);
 
         try (Transaction tx = ignite(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
             cache.get(0);


Mime
View raw message