ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [02/35] incubator-ignite git commit: # IGNITE-56 Migration tests to IgniteCache
Date Tue, 10 Feb 2015 16:15:46 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
index 907e08a..a8a4b50 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -91,9 +92,9 @@ public class GridCacheMixedPartitionExchangeSelfTest extends GridCommonAbstractT
 
                         int key = rnd.nextInt(keys);
 
-                        GridCache<Integer, Integer> prj = grid(g).cache(null);
+                        IgniteCache<Integer, Integer> prj = grid(g).jcache(null);
 
-                        try (IgniteTx tx = prj.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+                        try (IgniteTx tx = grid(g).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                             Integer val = prj.get(key);
 
                             val = val == null ? 1 : val + 1;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultiUpdateLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultiUpdateLockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultiUpdateLockSelfTest.java
index c58ce0a..224ed36 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultiUpdateLockSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultiUpdateLockSelfTest.java
@@ -130,11 +130,11 @@ public class GridCacheMultiUpdateLockSelfTest extends GridCommonAbstractTest {
 
                         started.set(true);
 
-                        GridCache<Object, Object> c = g4.cache(null);
+                        IgniteCache<Object, Object> c = g4.jcache(null);
 
                         info(">>>> Checking tx in new grid.");
 
-                        try (IgniteTx tx = c.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+                        try (IgniteTx tx = g4.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                             assertEquals(2, c.get("a"));
                             assertEquals(4, c.get("b"));
                             assertEquals(6, c.get("c"));
@@ -151,11 +151,11 @@ public class GridCacheMultiUpdateLockSelfTest extends GridCommonAbstractTest {
                 assertFalse(started.get());
 
                 // Check we can proceed with transactions.
-                GridCache<Object, Object> cache0 = g.cache(null);
+                IgniteCache<Object, Object> cache0 = g.jcache(null);
 
                 info(">>>> Checking tx commit.");
 
-                IgniteTx tx = cache0.txStart(PESSIMISTIC, REPEATABLE_READ);
+                IgniteTx tx = g.transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
 
                 try {
                     cache0.put("a", 1);
@@ -172,7 +172,7 @@ public class GridCacheMultiUpdateLockSelfTest extends GridCommonAbstractTest {
 
                 assertFalse(started.get());
 
-                tx = cache0.txStart(PESSIMISTIC, REPEATABLE_READ);
+                tx = g.transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
 
                 try {
                     cache0.put("a", 2);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
index 24ca1a6..de1769c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
@@ -96,7 +96,7 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
             expVal += ITERATIONS_PER_THREAD * THREADS;
 
             for (int j = 0; j < gridCount(); j++) {
-                Integer val = (Integer)grid(j).cache(null).get(key);
+                Integer val = (Integer)grid(j).jcache(null).get(key);
 
                 assertEquals("Unexpected value for grid " + j, expVal, val);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java
index ee298b1..0d43891 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java
@@ -95,9 +95,9 @@ public class GridCacheMvccManagerSelfTest extends GridCommonAbstractTest {
         try {
             Ignite ignite = startGridsMultiThreaded(gridCnt);
 
-            GridCache<Integer, Integer> cache = ignite.cache(null);
+            IgniteCache<Integer, Integer> cache = ignite.jcache(null);
 
-            IgniteTx tx = cache.txStart();
+            IgniteTx tx = ignite.transactions().txStart();
 
             cache.put(1, 1);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheNestedTxAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheNestedTxAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheNestedTxAbstractTest.java
index d7df849..079afbb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheNestedTxAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheNestedTxAbstractTest.java
@@ -86,9 +86,9 @@ public class GridCacheNestedTxAbstractTest extends GridCommonAbstractTest {
         super.afterTest();
 
         for (int i = 0; i < GRID_CNT; i++) {
-            grid(i).cache(null).removeAll();
+            grid(i).jcache(null).removeAll();
 
-            assert grid(i).cache(null).isEmpty();
+            assert grid(i).jcache(null).isEmpty();
         }
     }
 
@@ -106,14 +106,14 @@ public class GridCacheNestedTxAbstractTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testTwoTx() throws Exception {
-        final GridCache<String, Integer> c = grid(0).cache(null);
+        final IgniteCache<String, Integer> c = grid(0).jcache(null);
 
         GridKernalContext ctx = ((IgniteKernal)grid(0)).context();
 
         c.put(CNTR_KEY, 0);
 
         for (int i = 0; i < 10; i++) {
-            try (IgniteTx tx = c.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+            try (IgniteTx tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                 c.get(CNTR_KEY);
 
                 ctx.closure().callLocalSafe((new Callable<Boolean>() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
index df2fb56..99cf3af 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
@@ -111,7 +111,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
         }, THREADS, "transform");
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             assertEquals("Unexpected value for grid " + i, (Integer)(ITERATIONS_PER_THREAD * THREADS), val);
         }
@@ -134,7 +134,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
      * @throws Exception If failed.
      */
     private void testPut(final Integer key) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
         cache.put(key, 0);
 
@@ -147,7 +147,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
                     if (i % 500 == 0)
                         log.info("Iteration " + i);
 
-                    Integer val = cache.put(key, i);
+                    Integer val = cache.getAndPut(key, i);
 
                     assertNotNull(val);
                 }
@@ -157,7 +157,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
         }, THREADS, "put");
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             assertNotNull("Unexpected value for grid " + i, val);
         }
@@ -180,7 +180,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
      * @throws Exception If failed.
      */
     private void testPutxIfAbsent(final Integer key) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
         cache.put(key, 0);
 
@@ -193,7 +193,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
                     if (i % 500 == 0)
                         log.info("Iteration " + i);
 
-                    assertFalse(cache.putxIfAbsent(key, 100));
+                    assertFalse(cache.putIfAbsent(key, 100));
                 }
 
                 return null;
@@ -201,7 +201,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
         }, THREADS, "putxIfAbsent");
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             assertEquals("Unexpected value for grid " + i, (Integer)0, val);
         }
@@ -212,50 +212,6 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
     /**
      * @throws Exception If failed.
      */
-    public void testPutWithFilter() throws Exception {
-        testPutWithFilter(keyForNode(0));
-
-        if (gridCount() > 1)
-            testPutWithFilter(keyForNode(1));
-    }
-
-    /**
-     * @param key Key.
-     * @throws Exception If failed.
-     */
-    private void testPutWithFilter(final Integer key) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-        cache.put(key, 0);
-
-        final int THREADS = 5;
-        final int ITERATIONS_PER_THREAD = iterations();
-
-        GridTestUtils.runMultiThreaded(new Callable<Void>() {
-            @Override public Void call() throws Exception {
-                for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++) {
-                    if (i % 500 == 0)
-                        log.info("Iteration " + i);
-
-                    assertTrue(cache.putx(key, i, new TestFilter()));
-                }
-
-                return null;
-            }
-        }, THREADS, "putWithFilter");
-
-        for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
-
-            assertNotNull("Unexpected value for grid " + i, val);
-        }
-
-        assertFalse(failed);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testPutGet() throws Exception {
         testPutGet(keyForNode(0));
 
@@ -268,7 +224,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
      * @throws Exception If failed.
      */
     private void testPutGet(final Integer key) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
         cache.put(key, 0);
 
@@ -281,7 +237,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
                     if (i % 1000 == 0)
                         log.info("Put iteration " + i);
 
-                    assertTrue(cache.putx(key, i));
+                    cache.put(key, i);
                 }
 
                 return null;
@@ -317,7 +273,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
         getFut.get();
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             assertNotNull("Unexpected value for grid " + i, val);
         }
@@ -330,10 +286,8 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
     protected Integer keyForNode(int idx) {
         Integer key0 = null;
 
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
-
         for (int i = 0; i < 10_000; i++) {
-            if (cache.affinity().isPrimary(grid(idx).localNode(), i)) {
+            if (grid(0).affinity(null).isPrimary(grid(idx).localNode(), i)) {
                 key0 = i;
 
                 break;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateSelfTest.java
index d7a1876..6984d27 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateSelfTest.java
@@ -84,7 +84,7 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
         }, THREADS, "transform");
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             if (txConcurrency == PESSIMISTIC)
                 assertEquals("Unexpected value for grid " + i, (Integer)(ITERATIONS_PER_THREAD * THREADS), val);
@@ -94,7 +94,7 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
 
         if (failed) {
             for (int g = 0; g < gridCount(); g++)
-                info("Value for cache [g=" + g + ", val=" + grid(g).cache(null).get(key) + ']');
+                info("Value for cache [g=" + g + ", val=" + grid(g).jcache(null).get(key) + ']');
 
             assertFalse(failed);
         }
@@ -123,7 +123,7 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
      * @throws Exception If failed.
      */
     private void testPutTx(final Integer key, final IgniteTxConcurrency txConcurrency) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
         cache.put(key, 0);
 
@@ -136,8 +136,8 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
                     if (i % 500 == 0)
                         log.info("Iteration " + i);
 
-                    try (IgniteTx tx = cache.txStart(txConcurrency, REPEATABLE_READ)) {
-                        Integer val = cache.put(key, i);
+                    try (IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ)) {
+                        Integer val = cache.getAndPut(key, i);
 
                         assertNotNull(val);
 
@@ -150,7 +150,7 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
         }, THREADS, "put");
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             assertNotNull("Unexpected value for grid " + i, val);
         }
@@ -159,62 +159,6 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
     /**
      * @throws Exception If failed.
      */
-    public void testPutWithFilterTx() throws Exception {
-        testPutWithFilterTx(keyForNode(0), PESSIMISTIC);
-
-        // TODO GG-8118.
-        //testPutWithFilterTx(keyForNode(0), OPTIMISTIC);
-
-        if (gridCount() > 1) {
-            testPutWithFilterTx(keyForNode(1), PESSIMISTIC);
-
-            // TODO GG-8118.
-            //testPutWithFilterTx(keyForNode(1), OPTIMISTIC);
-        }
-    }
-
-    /**
-     * @param key Key.
-     * @param txConcurrency Transaction concurrency.
-     * @throws Exception If failed.
-     */
-    private void testPutWithFilterTx(final Integer key, final IgniteTxConcurrency txConcurrency) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-        cache.put(key, 0);
-
-        final int THREADS = 5;
-        final int ITERATIONS_PER_THREAD = iterations();
-
-        GridTestUtils.runMultiThreaded(new Callable<Void>() {
-            @Override public Void call() throws Exception {
-                for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++) {
-                    if (i % 500 == 0)
-                        log.info("Iteration " + i);
-
-                    try (IgniteTx tx = cache.txStart(txConcurrency, REPEATABLE_READ)) {
-                        cache.putx(key, i, new TestFilter());
-
-                        tx.commit();
-                    }
-                }
-
-                return null;
-            }
-        }, THREADS, "putWithFilter");
-
-        for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
-
-            assertNotNull("Unexpected value for grid " + i, val);
-        }
-
-        assertFalse(failed);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testPutxIfAbsentTx() throws Exception {
         testPutxIfAbsentTx(keyForNode(0), PESSIMISTIC);
 
@@ -235,7 +179,7 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
      * @throws Exception If failed.
      */
     private void testPutxIfAbsentTx(final Integer key, final IgniteTxConcurrency txConcurrency) throws Exception {
-        final GridCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
         cache.put(key, 0);
 
@@ -248,8 +192,8 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
                     if (i % 500 == 0)
                         log.info("Iteration " + i);
 
-                    try (IgniteTx tx = cache.txStart(txConcurrency, REPEATABLE_READ)) {
-                        assertFalse(cache.putxIfAbsent(key, 100));
+                    try (IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ)) {
+                        cache.putIfAbsent(key, 100);
 
                         tx.commit();
                     }
@@ -260,7 +204,7 @@ public class GridCacheOffHeapMultiThreadedUpdateSelfTest extends GridCacheOffHea
         }, THREADS, "putxIfAbsent");
 
         for (int i = 0; i < gridCount(); i++) {
-            Integer val = (Integer)grid(i).cache(null).get(key);
+            Integer val = (Integer)grid(i).jcache(null).get(key);
 
             assertEquals("Unexpected value for grid " + i, (Integer)0, val);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
index a9ba172..30029c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
@@ -197,15 +197,15 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkPutGetRemove(Integer key) throws Exception {
-        GridCache<Integer, Integer> c = grid(0).cache(null);
+        IgniteCache<Integer, Integer> c = grid(0).jcache(null);
 
         checkValue(key, null);
 
-        assertNull(c.put(key, key));
+        assertNull(c.getAndPut(key, key));
 
         checkValue(key, key);
 
-        assertEquals(key, c.remove(key));
+        assertEquals(key, c.getAndRemove(key));
 
         checkValue(key, null);
 
@@ -221,17 +221,17 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkPutGetRemoveByteArray(Integer key) throws Exception {
-        GridCache<Integer, byte[]> c = grid(0).cache(null);
+        IgniteCache<Integer, byte[]> c = grid(0).jcache(null);
 
         checkValue(key, null);
 
         byte[] val = new byte[] {key.byteValue()};
 
-        assertNull(c.put(key, val));
+        assertNull(c.getAndPut(key, val));
 
         checkValue(key, val);
 
-        Assert.assertArrayEquals(val, c.remove(key));
+        Assert.assertArrayEquals(val, c.getAndRemove(key));
 
         checkValue(key, null);
 
@@ -248,19 +248,19 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkPutGetRemoveTx(Integer key, IgniteTxConcurrency txConcurrency) throws Exception {
-        GridCache<Integer, Integer> c = grid(0).cache(null);
+        IgniteCache<Integer, Integer> c = grid(0).jcache(null);
 
-        IgniteTx tx = c.txStart(txConcurrency, REPEATABLE_READ);
+        IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ);
 
-        assertNull(c.put(key, key));
+        assertNull(c.getAndPut(key, key));
 
         tx.commit();
 
         checkValue(key, key);
 
-        tx = c.txStart(txConcurrency, REPEATABLE_READ);
+        tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ);
 
-        assertEquals(key, c.remove(key));
+        assertEquals(key, c.getAndRemove(key));
 
         tx.commit();
 
@@ -273,21 +273,21 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkPutGetRemoveTxByteArray(Integer key, IgniteTxConcurrency txConcurrency) throws Exception {
-        GridCache<Integer, byte[]> c = grid(0).cache(null);
+        IgniteCache<Integer, byte[]> c = grid(0).jcache(null);
 
-        IgniteTx tx = c.txStart(txConcurrency, REPEATABLE_READ);
+        IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ);
 
         byte[] val = new byte[] {key.byteValue()};
 
-        assertNull(c.put(key, val));
+        assertNull(c.getAndPut(key, val));
 
         tx.commit();
 
         checkValue(key, val);
 
-        tx = c.txStart(txConcurrency, REPEATABLE_READ);
+        tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ);
 
-        Assert.assertArrayEquals(val, c.remove(key));
+        Assert.assertArrayEquals(val, c.getAndRemove(key));
 
         tx.commit();
 
@@ -384,13 +384,13 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
         for (int i = 0; i < 100; i++)
             map.put(i, i);
 
-        GridCache<Integer, Integer> c = grid(0).cache(null);
+        IgniteCache<Integer, Integer> c = grid(0).jcache(null);
 
         Map<Integer, Integer> map0 = c.getAll(map.keySet());
 
         assertTrue(map0.isEmpty());
 
-        try (IgniteTx tx = c.txStart(txConcurrency, REPEATABLE_READ)) {
+        try (IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ)) {
             c.putAll(map);
 
             tx.commit();
@@ -403,7 +403,7 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
         for (Map.Entry<Integer, Integer> e : map.entrySet())
             checkValue(e.getKey(), e.getValue());
 
-        try (IgniteTx tx = c.txStart(txConcurrency, REPEATABLE_READ)) {
+        try (IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ)) {
             c.removeAll(map.keySet());
 
             tx.commit();
@@ -435,13 +435,13 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkPutGetRemoveObject(Integer key) throws Exception {
-        GridCache<Integer, TestValue> c = grid(0).cache(null);
+        IgniteCache<Integer, TestValue> c = grid(0).jcache(null);
 
         checkValue(key, null);
 
         TestValue val = new TestValue(new byte[10]);
 
-        assertNull(c.put(key, val));
+        assertNull(c.getAndPut(key, val));
 
         checkValue(key, val);
 
@@ -450,14 +450,14 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
         if (portableEnabled()) // TODO: 9271, check return value when fixed.
             c.put(key, val);
         else
-            assertEquals(val, c.put(key, val));
+            assertEquals(val, c.getAndPut(key, val));
 
         checkValue(key, val2);
 
         if (portableEnabled()) // TODO: 9271, check return value when fixed.
             c.remove(key);
         else
-            assertEquals(val2, c.remove(key));
+            assertEquals(val2, c.getAndRemove(key));
 
         checkValue(key, null);
 
@@ -474,21 +474,21 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkPutGetRemoveObjectTx(Integer key, IgniteTxConcurrency txConcurrency) throws Exception {
-        GridCache<Integer, TestValue> c = grid(0).cache(null);
+        IgniteCache<Integer, TestValue> c = grid(0).jcache(null);
 
         TestValue val = new TestValue(new byte[10]);
 
-        IgniteTx tx = c.txStart(txConcurrency, REPEATABLE_READ);
+        IgniteTx tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ);
 
-        assertNull(c.put(key, val));
+        assertNull(c.getAndPut(key, val));
 
         tx.commit();
 
         checkValue(key, val);
 
-        tx = c.txStart(txConcurrency, REPEATABLE_READ);
+        tx = grid(0).transactions().txStart(txConcurrency, REPEATABLE_READ);
 
-        assertEquals(val, c.remove(key));
+        assertEquals(val, c.getAndRemove(key));
 
         tx.commit();
 
@@ -550,10 +550,10 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
             if (val != null && val.getClass() == byte[].class) {
                 Assert.assertArrayEquals("Unexpected value for grid: " + i,
                     (byte[])val,
-                    (byte[])grid(i).cache(null).get(key));
+                    (byte[])grid(i).jcache(null).get(key));
             }
             else
-                assertEquals("Unexpected value for grid: " + i, val, grid(i).cache(null).get(key));
+                assertEquals("Unexpected value for grid: " + i, val, grid(i).jcache(null).get(key));
         }
     }
 
@@ -575,12 +575,12 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
      * @throws Exception If failed.
      */
     private void checkUnswap(Integer key) throws Exception {
-        GridCache<Integer, Integer> c = grid(0).cache(null);
+        IgniteCache<Integer, Integer> c = grid(0).jcache(null);
 
         for (int i = 0; i < gridCount(); i++) {
-            assertEquals("Unexpected entries for grid: " + i, 0, grid(i).cache(null).offHeapEntriesCount());
+            assertEquals("Unexpected entries for grid: " + i, 0, internalCache(i).offHeapEntriesCount());
 
-            assertEquals("Unexpected offheap size for grid: " + i, 0, grid(i).cache(null).offHeapAllocatedSize());
+            assertEquals("Unexpected offheap size for grid: " + i, 0, internalCache(i).offHeapAllocatedSize());
         }
 
         assertNull(c.peek(key));
@@ -593,14 +593,14 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
 
         assertNull(c.peek(key));
 
-        assertTrue(c.removex(key));
+        assertTrue(c.remove(key));
 
         assertNull(c.peek(key));
 
         for (int i = 0; i < gridCount(); i++) {
-            assertEquals("Unexpected entries for grid: " + i, 0, grid(i).cache(null).offHeapEntriesCount());
+            assertEquals("Unexpected entries for grid: " + i, 0, internalCache(i).offHeapEntriesCount());
 
-            assertEquals("Unexpected offheap size for grid: " + i, 0, grid(i).cache(null).offHeapAllocatedSize());
+            assertEquals("Unexpected offheap size for grid: " + i, 0, internalCache(i).offHeapAllocatedSize());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
index ae3599d..d8784ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
@@ -92,7 +92,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
-        final GridCache<Integer, Object> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Object> cache = grid(0).jcache(null);
 
         vals = new ArrayList<>(VALS);
 
@@ -129,7 +129,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
      * @throws Exception If failed.
      */
     public void testPut() throws Exception {
-        final GridCache<Integer, Object> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Object> cache = grid(0).jcache(null);
 
         GridTestUtils.runMultiThreaded(new Callable<Void>() {
             @Override public Void call() throws Exception {
@@ -140,9 +140,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
 
                     final TestValue val = vals.get(key % VAL_SIZE);
 
-                    TestPredicate p = testPredicate(val.val, false);
-
-                    cache.putx(key, val, p);
+                    cache.put(key, val);
                 }
 
                 return null;
@@ -154,7 +152,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
      * @throws Exception If failed.
      */
     public void testRemove() throws Exception {
-        final GridCache<Integer, Object> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Object> cache = grid(0).jcache(null);
 
         GridTestUtils.runMultiThreaded(new Callable<Void>() {
             @Override public Void call() throws Exception {
@@ -165,12 +163,10 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
 
                     final TestValue val = vals.get(key % VAL_SIZE);
 
-                    TestPredicate p = testPredicate(val.val, true);
-
                     if (rnd.nextBoolean())
-                        cache.removex(key, p);
+                        cache.remove(key);
                     else
-                        cache.putx(key, val, p);
+                        cache.put(key, val);
                 }
 
                 return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapUpdateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapUpdateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapUpdateSelfTest.java
index e483ae5..950a8f9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapUpdateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapUpdateSelfTest.java
@@ -57,33 +57,33 @@ public class GridCacheOffheapUpdateSelfTest extends GridCommonAbstractTest {
         try {
             Ignite ignite = startGrids(2);
 
-            GridCache<Object, Object> rmtCache = ignite.cache(null);
+            IgniteCache<Object, Object> rmtCache = ignite.jcache(null);
 
             int key = 0;
 
-            while (!rmtCache.affinity().isPrimary(grid(1).localNode(), key))
+            while (!ignite.affinity(null).isPrimary(grid(1).localNode(), key))
                 key++;
 
-            GridCache<Object, Object> locCache = grid(1).cache(null);
+            IgniteCache<Object, Object> locCache = grid(1).jcache(null);
 
-            try (IgniteTx tx = locCache.txStart(PESSIMISTIC, REPEATABLE_READ)) {
-                locCache.putxIfAbsent(key, 0);
+            try (IgniteTx tx = grid(1).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+                locCache.putIfAbsent(key, 0);
 
                 tx.commit();
             }
 
-            try (IgniteTx tx = rmtCache.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+            try (IgniteTx tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                 assertEquals(0, rmtCache.get(key));
 
-                rmtCache.putx(key, 1);
+                rmtCache.put(key, 1);
 
                 tx.commit();
             }
 
-            try (IgniteTx tx = rmtCache.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+            try (IgniteTx tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                 assertEquals(1, rmtCache.get(key));
 
-                rmtCache.putx(key, 2);
+                rmtCache.put(key, 2);
 
                 tx.commit();
             }
@@ -100,7 +100,7 @@ public class GridCacheOffheapUpdateSelfTest extends GridCommonAbstractTest {
         try {
             Ignite grid = startGrid(0);
 
-            GridCache<Object, Object> cache = grid.cache(null);
+            IgniteCache<Object, Object> cache = grid.jcache(null);
 
             for (int i = 0; i < 30; i++)
                 cache.put(i, 0);
@@ -110,7 +110,7 @@ public class GridCacheOffheapUpdateSelfTest extends GridCommonAbstractTest {
             awaitPartitionMapExchange();
 
             for (int i = 0; i < 30; i++)
-                grid(1).cache(null).put(i, 10);
+                grid(1).jcache(null).put(i, 10);
 
             // Find a key that does not belong to started node anymore.
             int key = 0;
@@ -118,17 +118,17 @@ public class GridCacheOffheapUpdateSelfTest extends GridCommonAbstractTest {
             ClusterNode locNode = grid.cluster().localNode();
 
             for (;key < 30; key++) {
-                if (!cache.affinity().isPrimary(locNode, key) && !cache.affinity().isBackup(locNode, key))
+                if (!grid.affinity(null).isPrimary(locNode, key) && !grid.affinity(null).isBackup(locNode, key))
                     break;
             }
 
             assertEquals(10, cache.get(key));
 
-            try (IgniteTx ignored = cache.txStart(OPTIMISTIC, REPEATABLE_READ)) {
+            try (IgniteTx ignored = grid.transactions().txStart(OPTIMISTIC, REPEATABLE_READ)) {
                 assertEquals(10, cache.get(key));
             }
 
-            try (IgniteTx ignored = cache.txStart(PESSIMISTIC, READ_COMMITTED)) {
+            try (IgniteTx ignored = grid.transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
                 assertEquals(10, cache.get(key));
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
index f1d5ced..7d81b98 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
@@ -126,7 +126,7 @@ public class GridCacheOrderedPreloadingSelfTest extends GridCommonAbstractTest {
         Ignite g = startGrid(0);
 
         try {
-            GridCache<Object, Object> cache = g.cache("first");
+            IgniteCache<Object, Object> cache = g.jcache("first");
 
             // Put some data into cache.
             for (int i = 0; i < 1000; i++)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedGetSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedGetSelfTest.java
index cca77b2..d5622b6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedGetSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedGetSelfTest.java
@@ -117,7 +117,7 @@ public class GridCachePartitionedGetSelfTest extends GridCommonAbstractTest {
      */
     public void testGetFromPrimaryNode() throws Exception {
         for (int i = 0; i < GRID_CNT; i++) {
-            GridCache<String, Integer> c = grid(i).cache(null);
+            IgniteCache<String, Integer> c = grid(i).jcache(null);
 
             if (grid(i).affinity(null).isPrimary(grid(i).localNode(), KEY)) {
                 info("Primary node: " + grid(i).localNode().id());
@@ -136,7 +136,7 @@ public class GridCachePartitionedGetSelfTest extends GridCommonAbstractTest {
      */
     public void testGetFromBackupNode() throws Exception {
         for (int i = 0; i < GRID_CNT; i++) {
-            GridCache<String, Integer> c = grid(i).cache(null);
+            IgniteCache<String, Integer> c = grid(i).jcache(null);
 
             if (grid(i).affinity(null).isBackup(grid(i).localNode(), KEY)) {
                 info("Backup node: " + grid(i).localNode().id());
@@ -147,7 +147,7 @@ public class GridCachePartitionedGetSelfTest extends GridCommonAbstractTest {
 
                 assert !await();
 
-                assert c.evict(KEY);
+                c.evict(KEY);
 
                 assert c.peek(KEY) == null;
 
@@ -167,7 +167,7 @@ public class GridCachePartitionedGetSelfTest extends GridCommonAbstractTest {
      */
     public void testGetFromNearNode() throws Exception {
         for (int i = 0; i < GRID_CNT; i++) {
-            GridCache<String, Integer> c = grid(i).cache(null);
+            IgniteCache<String, Integer> c = grid(i).jcache(null);
 
             if (!grid(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), KEY)) {
                 info("Near node: " + grid(i).localNode().id());
@@ -219,7 +219,7 @@ public class GridCachePartitionedGetSelfTest extends GridCommonAbstractTest {
                 info("Primary node: " + g.cluster().localNode().id());
 
                 // Put value.
-                g.cache(null).put(KEY, VAL);
+                g.jcache(null).put(KEY, VAL);
 
                 // Register listener.
                 ((IgniteKernal)g).context().io().addMessageListener(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
index 285ee52..9bce48b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
@@ -101,7 +101,7 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
         try {
             final Ignite ignite1 = startGrid(1);
 
-            GridCache<Integer, Object> cache1 = ignite1.cache(null);
+            IgniteCache<Integer, Object> cache1 = ignite1.jcache(null);
 
             for (int i = 0; i < 5000; i++)
                 cache1.put(i, VALUE + i);
@@ -112,7 +112,7 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
 
             final CountDownLatch startLatch = new CountDownLatch(1);
 
-            int oldSize = cache1.size();
+            int oldSize = cache1.localSize();
 
             assert false;
 
@@ -127,7 +127,7 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
                             Cache.Entry<Integer, Object> entry = randomEntry(ignite1);
 
                             if (entry != null)
-                                ignite1.cache(null).evict(entry.getKey());
+                                ignite1.jcache(null).evict(entry.getKey());
                             else
                                 info("Entry is null.");
                         }
@@ -195,8 +195,8 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
 
         assertTrue(GridTestUtils.waitForCondition(new PA() {
             @Override public boolean apply() {
-                int size1 = ignite1.cache(null).size();
-                return size1 != oldSize && size1 == ignite2.cache(null).size();
+                int size1 = ignite1.jcache(null).localSize();
+                return size1 != oldSize && size1 == ignite2.jcache(null).localSize();
             }
         }, getTestTimeout()));
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index bdefe70..1fef3c6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@ -23,6 +23,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -339,9 +340,9 @@ public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest {
             int primaryCacheSize = 0;
 
             for (Ignite g : runningWorkers) {
-                info(">>>>> " + g.cache(CACHE_NAME).size());
+                info(">>>>> " + g.jcache(CACHE_NAME).localSize());
 
-                primaryCacheSize += g.cache(CACHE_NAME).primarySize();
+                primaryCacheSize += ((IgniteKernal)g).internalCache(CACHE_NAME).primarySize();
             }
 
             assertEquals(TEST_MAP_SIZE, primaryCacheSize);
@@ -539,9 +540,9 @@ public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest {
             int primaryCacheSize = 0;
 
             for (Ignite g : runningWorkers) {
-                info(">>>>> " + g.cache(CACHE_NAME).size());
+                info(">>>>> " + g.jcache(CACHE_NAME).localSize());
 
-                primaryCacheSize += g.cache(CACHE_NAME).primarySize();
+                primaryCacheSize += ((IgniteKernal)g).internalCache(CACHE_NAME).primarySize();
             }
 
             assertEquals(TEST_MAP_SIZE, primaryCacheSize);
@@ -564,7 +565,7 @@ public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest {
 
         Collection<Integer> ret = new ArrayList<>(keys.size());
 
-        GridCache<Object, Object> cache = workerNode.cache(CACHE_NAME);
+        IgniteCache<Object, Object> cache = workerNode.jcache(CACHE_NAME);
 
         for (Integer key : keys) {
             if (cache.get(key) == null) // Key is absent.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
index 87a1e8e..06bf403 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -312,7 +313,7 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
                 Ignite g = startGrid();
 
                 try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
+                    IgniteCache<Integer, TestValue> cache = g.jcache(null);
 
                     refs.add(new WeakReference<Object>(cacheContext(cache)));
 
@@ -353,7 +354,8 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
                 Ignite g = startGrid();
 
                 try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
+                    IgniteCache<Integer, TestValue> cache = g.jcache(null);
+                    IgniteCache<Integer, TestValue> cacheAsync = cache.withAsync();
 
                     refs.add(new WeakReference<Object>(cacheContext(cache)));
 
@@ -361,7 +363,9 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
 
                     refs.add(new WeakReference<Object>(val));
 
-                    cache.putxAsync(0, val).get();
+                    cacheAsync.putIfAbsent(0, val);
+
+                    cacheAsync.future().get();
                 }
                 finally {
                     G.stop(g.name(), cancel);
@@ -386,21 +390,24 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
                 Ignite g = startGrid();
 
                 try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
+                    IgniteCache<Integer, TestValue> cache = g.jcache(null);
+                    IgniteCache<Integer, TestValue> cacheAsync = cache.withAsync();
 
                     refs.add(new WeakReference<Object>(cacheContext(cache)));
 
-                    Collection<IgniteInternalFuture<?>> futs = new ArrayList<>(1000);
+                    Collection<IgniteFuture<?>> futs = new ArrayList<>(1000);
 
                     for (int i = 0; i < 1000; i++) {
                         TestValue val = new TestValue(i);
 
                         refs.add(new WeakReference<Object>(val));
 
-                        futs.add(cache.putxAsync(i, val));
+                        cacheAsync.putIfAbsent(0, val);
+
+                        futs.add(cacheAsync.future());
                     }
 
-                    for (IgniteInternalFuture<?> fut : futs)
+                    for (IgniteFuture<?> fut : futs)
                         fut.get();
                 }
                 finally {
@@ -426,17 +433,17 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
                 Ignite g = startGrid();
 
                 try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
+                    IgniteCache<Integer, TestValue> cache = g.jcache(null);
 
                     refs.add(new WeakReference<Object>(cacheContext(cache)));
 
-                    IgniteTx tx = cache.txStart();
+                    IgniteTx tx = g.transactions().txStart();
 
                     TestValue val = new TestValue(0);
 
                     refs.add(new WeakReference<Object>(val));
 
-                    cache.putx(0, val);
+                    cache.put(0, val);
 
                     tx.commit();
                 }
@@ -463,18 +470,19 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
                 Ignite g = startGrid();
 
                 try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
+                    IgniteCache<Integer, TestValue> cache = g.jcache(null);
+                    IgniteCache<Integer, TestValue> cacheAsync = cache.withAsync();
 
                     refs.add(new WeakReference<Object>(cacheContext(cache)));
 
-                    IgniteTx tx = cache.txStart();
+                    IgniteTx tx = g.transactions().txStart();
 
                     for (int i = 0; i < 1000; i++) {
                         TestValue val = new TestValue(i);
 
                         refs.add(new WeakReference<Object>(val));
 
-                        cache.putxAsync(i, val);
+                        cacheAsync.put(i, val);
                     }
 
                     tx.commit();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
index e846b16..733ace9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
@@ -163,10 +163,10 @@ public class GridCacheReloadSelfTest extends GridCommonAbstractTest {
         Ignite ignite = startGrid();
 
         try {
-            GridCache<Integer, Integer> cache = ignite.cache(CACHE_NAME);
+            IgniteCache<Integer, Integer> cache = ignite.jcache(CACHE_NAME);
 
             for (int i = 0; i < N_ENTRIES; i++)
-                cache.reload(i);
+                load(cache, i, true);
 
             assertEquals(MAX_CACHE_ENTRIES, cache.size());
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
index d37eab5..b3e1d0d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
@@ -104,7 +104,7 @@ public class GridCacheReplicatedSynchronousCommitTest extends GridCommonAbstract
         try {
             Ignite firstIgnite = startGrid("1");
 
-            GridCache<Integer, String> firstCache = firstIgnite.cache(null);
+            IgniteCache<Integer, String> firstCache = firstIgnite.jcache(null);
 
             for (int i = 0; i < ADDITION_CACHE_NUMBER; i++)
                 startGrid(String.valueOf(i + 2));
@@ -134,8 +134,8 @@ public class GridCacheReplicatedSynchronousCommitTest extends GridCommonAbstract
 
             Ignite ignite3 = startGrid("3");
 
-            GridCache<Integer, String> cache1 = ignite1.cache(null);
-            GridCache<Integer, String> cache3 = ignite3.cache(null);
+            IgniteCache<Integer, String> cache1 = ignite1.jcache(null);
+            IgniteCache<Integer, String> cache3 = ignite3.jcache(null);
 
             IgniteInternalFuture<?> fut = multithreadedAsync(
                 new Callable<Object>() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
index d546966..d9cfca2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
@@ -114,9 +114,9 @@ public class GridCacheSlowTxWarnTest extends GridCommonAbstractTest {
             cache.context().tm().slowTxWarnTimeout(500);
         }
 
-        GridCache<Object, Object> cache1 = g.cache(cacheName);
+        IgniteCache<Object, Object> cache1 = g.jcache(cacheName);
 
-        IgniteTx tx = cache1.txStart();
+        IgniteTx tx = g.transactions().txStart();
 
         try {
             cache1.put(1, 1);
@@ -130,7 +130,7 @@ public class GridCacheSlowTxWarnTest extends GridCommonAbstractTest {
             tx.close();
         }
 
-        tx = cache1.txStart();
+        tx = g.transactions().txStart();
 
         try {
             cache1.put(1, 1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
index 468dd39..2961e28 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -131,7 +130,7 @@ public class GridCacheStopSelfTest extends GridCommonAbstractTest {
 
             final CountDownLatch readyLatch = new CountDownLatch(PUT_THREADS);
 
-            final GridCache<Integer, Integer> cache = grid(0).cache(null);
+            final IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
             assertNotNull(cache);
 
@@ -146,7 +145,7 @@ public class GridCacheStopSelfTest extends GridCommonAbstractTest {
                 putFuts.add(GridTestUtils.runAsync(new Callable<Void>() {
                     @Override public Void call() throws Exception {
                         if (startTx) {
-                            try (IgniteTx tx = cache.txStart()) {
+                            try (IgniteTx tx = grid(0).transactions().txStart()) {
                                 cache.put(key, key);
 
                                 readyLatch.countDown();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
index 50a3f1e..34a8fa5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
@@ -78,7 +78,7 @@ public class GridCacheStoreValueBytesSelfTest extends GridCommonAbstractTest {
         Ignite g0 = startGrid(0);
         Ignite g1 = startGrid(1);
 
-        GridCache<Integer, String> c = g0.cache(null);
+        IgniteCache<Integer, String> c = g0.jcache(null);
 
         c.put(1, "Cached value");
 
@@ -99,7 +99,7 @@ public class GridCacheStoreValueBytesSelfTest extends GridCommonAbstractTest {
         Ignite g0 = startGrid(0);
         Ignite g1 = startGrid(1);
 
-        GridCache<Integer, String> c = g0.cache(null);
+        IgniteCache<Integer, String> c = g0.jcache(null);
 
         c.put(1, "Cached value");
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
index ea04a12..d83bc79 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -96,16 +97,21 @@ public class GridCacheSwapPreloadSelfTest extends GridCommonAbstractTest {
         try {
             startGrid(0);
 
-            GridCache<Integer, Integer> cache = grid(0).cache(null);
+            IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
+
+            Set<Integer> keys = new HashSet<>();
 
             // Populate.
-            for (int i = 0; i < ENTRY_CNT; i++)
+            for (int i = 0; i < ENTRY_CNT; i++) {
+                keys.add(i);
+
                 cache.put(i, i);
+            }
 
             info("Put finished.");
 
             // Evict all.
-            cache.evictAll();
+            cache.localEvict(keys);
 
             info("Evict finished.");
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
index 23def69..dfc9381 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
@@ -106,7 +106,7 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
 
         for (int key = 0; key < 10; key++) {
             for (int i = 1; i < gridCount(); i++) {
-                if (grid(i).cache(null).affinity().isPrimaryOrBackup(grid(i).localNode(), key))
+                if (grid(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key))
                     assertEquals(key, grid(i).cache(null).peek(key));
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
index d54a9ca..1638e8d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
@@ -848,6 +848,14 @@ public final class GridTestUtils {
 
     /**
      * @param cache Cache.
+     * @return Cache context.
+     */
+    public static <K, V> GridCacheContext<K, V> cacheContext(IgniteCache<K, V> cache) {
+        return ((IgniteKernal)cache.unwrap(Ignite.class)).<K, V>internalCache().context();
+    }
+
+    /**
+     * @param cache Cache.
      * @return Near cache.
      */
     public static <K, V> GridNearCacheAdapter<K, V> near(GridCache<K, V> cache) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf7d8766/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index f31f398..e5f27ad 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.colocated.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
@@ -95,6 +96,20 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
     }
 
     /**
+     * @param idx Grid index.
+     * @return Cache.
+     */
+    protected <K, V> GridCacheAdapter<K, V> internalCache(int idx) {
+        return ((IgniteKernal)grid(idx)).internalCache(null);
+    }
+    /**
+     * @return Cache.
+     */
+    protected <K, V> GridCacheAdapter<K, V> internalCache() {
+        return ((IgniteKernal)grid()).internalCache(null);
+    }
+
+    /**
      * @return Cache.
      */
     protected <K, V> IgniteCache<K, V> jcache() {


Mime
View raw message