ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [17/61] [abbrv] incubator-ignite git commit: # ignite-42
Date Thu, 22 Jan 2015 15:41:15 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStorePartitionedMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStorePartitionedMultiNodeSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStorePartitionedMultiNodeSelfTest.java
index 277a1b4..4c8c063 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStorePartitionedMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStorePartitionedMultiNodeSelfTest.java
@@ -18,6 +18,7 @@
 package org.gridgain.grid.kernal.processors.cache;
 
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.transactions.*;
 import org.gridgain.grid.*;
@@ -28,6 +29,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
 import java.util.*;
 
 import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
@@ -55,6 +57,7 @@ public class GridCacheWriteBehindStorePartitionedMultiNodeSelfTest extends GridC
     private int idx;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -69,10 +72,15 @@ public class GridCacheWriteBehindStorePartitionedMultiNodeSelfTest extends GridC
         cc.setCacheMode(GridCacheMode.PARTITIONED);
         cc.setWriteBehindEnabled(true);
         cc.setWriteBehindFlushFrequency(WRITE_BEHIND_FLUSH_FREQ);
-        cc.setStore(stores[idx] = new GridCacheTestStore());
         cc.setAtomicityMode(TRANSACTIONAL);
         cc.setDistributionMode(NEAR_PARTITIONED);
 
+        CacheStore store = stores[idx] = new GridCacheTestStore();
+
+        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cc.setReadThrough(true);
+        cc.setWriteThrough(true);
+
         c.setCacheConfiguration(cc);
 
         idx++;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxExceptionAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index c4be689..0e5d562 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@ -76,7 +76,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
         CacheConfiguration ccfg = super.cacheConfiguration(gridName);
 
         ccfg.setQueryIndexEnabled(true);
-        ccfg.setStore(null);
+        ccfg.setCacheStoreFactory(null);
 
         return ccfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxStoreExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxStoreExceptionAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxStoreExceptionAbstractSelfTest.java
index ed1cd4c..81be16c 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxStoreExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxStoreExceptionAbstractSelfTest.java
@@ -31,6 +31,7 @@ import org.gridgain.testframework.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import javax.cache.integration.*;
 import javax.cache.processor.*;
 import java.util.*;
@@ -72,10 +73,13 @@ public abstract class IgniteTxStoreExceptionAbstractSelfTest extends GridCacheAb
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
         CacheConfiguration ccfg = super.cacheConfiguration(gridName);
 
-        ccfg.setStore(store);
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        ccfg.setReadThrough(true);
+        ccfg.setWriteThrough(true);
 
         return ccfg;
     }
@@ -593,7 +597,7 @@ public abstract class IgniteTxStoreExceptionAbstractSelfTest extends GridCacheAb
     /**
      *
      */
-    private static class TestStore implements CacheStore<Object, Object> {
+    private static class TestStore extends CacheStore<Object, Object> {
         /** Fail flag. */
         private volatile boolean fail;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
index 50abe61..230db3e 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
@@ -91,7 +91,7 @@ public abstract class GridCacheAbstractQueueFailoverDataConsistencySelfTest exte
         ccfg.setAtomicWriteOrderMode(PRIMARY);
         ccfg.setSwapEnabled(false);
         ccfg.setQueryIndexEnabled(false);
-        ccfg.setStore(null);
+        ccfg.setCacheStoreFactory(null);
 
         return ccfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java
index 9e8f421..991399c 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheAtomicReferenceApiSelfAbstractTest.java
@@ -31,7 +31,11 @@ import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.testframework.junits.common.*;
 import org.mockito.*;
 
+import javax.cache.*;
+import javax.cache.configuration.*;
+import javax.cache.integration.*;
 import java.util.*;
+import java.util.concurrent.atomic.*;
 
 import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
 import static org.gridgain.grid.cache.GridCacheDistributionMode.*;
@@ -43,6 +47,9 @@ public abstract class GridCacheAtomicReferenceApiSelfAbstractTest extends GridCo
     /** */
     protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
+    /** */
+    private AtomicBoolean storeCalled = new AtomicBoolean();
+
     /**
      * Constructs a test.
      */
@@ -71,13 +78,30 @@ public abstract class GridCacheAtomicReferenceApiSelfAbstractTest extends GridCo
     /**
      * @return Cache configuration for the test.
      */
+    @SuppressWarnings("unchecked")
     protected CacheConfiguration getCacheConfiguration() {
         CacheConfiguration ccfg = defaultCacheConfiguration();
 
         ccfg.setAtomicityMode(TRANSACTIONAL);
         ccfg.setDistributionMode(NEAR_PARTITIONED);
 
-        ccfg.setStore(Mockito.mock(CacheStore.class));
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new CacheStoreAdapter() {
+            @Override public Object load(Object key) throws CacheLoaderException {
+                storeCalled.set(true);
+
+                return null;
+            }
+
+            @Override public void write(Cache.Entry entry) throws CacheWriterException {
+                storeCalled.set(true);
+            }
+
+            @Override public void delete(Object key) throws CacheWriterException {
+                storeCalled.set(true);
+            }
+        }));
+        ccfg.setReadThrough(true);
+        ccfg.setWriteThrough(true);
 
         return ccfg;
     }
@@ -185,8 +209,6 @@ public abstract class GridCacheAtomicReferenceApiSelfAbstractTest extends GridCo
 
         cache.dataStructures().removeAtomicReference(atomicName);
 
-        GridCacheContext ctx = ((GridKernal)grid()).context().cache().internalCache().context();
-
-        Mockito.verifyZeroInteractions(ctx.store().configuredStore()); // Store shouldn't be ever called.
+        assertFalse(storeCalled.get());
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheSetFailoverAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheSetFailoverAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheSetFailoverAbstractSelfTest.java
index c42fe44..f1f973c 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheSetFailoverAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/datastructures/GridCacheSetFailoverAbstractSelfTest.java
@@ -75,7 +75,7 @@ public class GridCacheSetFailoverAbstractSelfTest extends GridCacheAbstractSelfT
 
         ccfg.setBackups(1);
         ccfg.setAtomicWriteOrderMode(PRIMARY);
-        ccfg.setStore(null);
+        ccfg.setCacheStoreFactory(null);
         ccfg.setCacheMode(PARTITIONED);
         ccfg.setDistributionMode(PARTITIONED_ONLY);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
index 5b5451b..f2199ae 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
@@ -61,7 +61,7 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
             nearOnlyGridName = gridName;
         }
 
-        cfg.setStore(null);
+        cfg.setCacheStoreFactory(null);
         cfg.setAffinity(new GridCacheConsistentHashAffinityFunction(false, 32));
         cfg.setBackups(1);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
index eebb6ca..6220d8a 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
@@ -65,7 +65,7 @@ public abstract class GridCacheExpiredEntriesPreloadAbstractSelfTest extends Gri
         CacheConfiguration cfg = super.cacheConfiguration(gridName);
 
         cfg.setPreloadMode(SYNC);
-        cfg.setStore(null);
+        cfg.setCacheStoreFactory(null);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePartitionedReloadAllAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePartitionedReloadAllAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePartitionedReloadAllAbstractSelfTest.java
index f0d0ffc..228fc71 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePartitionedReloadAllAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePartitionedReloadAllAbstractSelfTest.java
@@ -32,6 +32,7 @@ import org.gridgain.testframework.junits.common.*;
 import org.jdk8.backport.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 
 import static org.gridgain.grid.cache.GridCacheAtomicWriteOrderMode.*;
@@ -59,6 +60,7 @@ public abstract class GridCachePartitionedReloadAllAbstractSelfTest extends Grid
     private List<GridCache<Integer, String>> caches;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -80,7 +82,15 @@ public abstract class GridCachePartitionedReloadAllAbstractSelfTest extends Grid
 
         cc.setWriteSynchronizationMode(FULL_SYNC);
 
-        cc.setStore(cacheStore());
+        CacheStore store = cacheStore();
+
+        if (store != null) {
+            cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+            cc.setReadThrough(true);
+            cc.setWriteThrough(true);
+        }
+        else
+            cc.setCacheStoreFactory(null);
 
         cc.setAtomicWriteOrderMode(atomicWriteOrderMode());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
index b1a108b..e0c0137 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
@@ -256,7 +256,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
         CacheConfiguration cfg = super.cacheConfiguration(gridName);
 
-        cfg.setStore(null);
+        cfg.setCacheStoreFactory(null);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
index e236757..baed328 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
@@ -443,7 +443,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
         CacheConfiguration cfg = super.cacheConfiguration(gridName);
 
-        cfg.setStore(null);
+        cfg.setCacheStoreFactory(null);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPreloadAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPreloadAbstractTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPreloadAbstractTest.java
index 04341ee..5ca6ea8 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPreloadAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/IgniteTxPreloadAbstractTest.java
@@ -212,7 +212,7 @@ public abstract class IgniteTxPreloadAbstractTest extends GridCacheAbstractSelfT
 
         cfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
 
-        cfg.setStore(null);
+        cfg.setCacheStoreFactory(null);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
index 1552636..f319214 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
 import javax.cache.processor.*;
 import java.util.*;
 
@@ -96,6 +97,7 @@ public abstract class GridCacheAbstractTransformWriteThroughSelfTest extends Gri
     protected abstract boolean batchUpdate();
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
@@ -115,7 +117,9 @@ public abstract class GridCacheAbstractTransformWriteThroughSelfTest extends Gri
 
         cacheCfg.setCacheMode(PARTITIONED);
         cacheCfg.setBackups(1);
-        cacheCfg.setStore(store);
+        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteThrough(true);
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
         cacheCfg.setDistributionMode(NEAR_PARTITIONED);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index 3a540b6..a2a67bc 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -34,6 +34,7 @@ import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
@@ -58,6 +59,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
     private boolean storeEnabled;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
@@ -76,10 +78,13 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         cacheCfg.setSwapEnabled(false);
 
-        if (storeEnabled)
-            cacheCfg.setStore(new GridCacheTestStore());
+        if (storeEnabled) {
+            cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new GridCacheTestStore()));
+            cacheCfg.setReadThrough(true);
+            cacheCfg.setWriteThrough(true);
+        }
         else
-            cacheCfg.setStore(null);
+            cacheCfg.setCacheStoreFactory(null);
 
         cfg.setCacheConfiguration(cacheCfg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheGetStoreErrorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheGetStoreErrorSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheGetStoreErrorSelfTest.java
index bf9902e..7784715 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheGetStoreErrorSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheGetStoreErrorSelfTest.java
@@ -29,6 +29,7 @@ import org.gridgain.testframework.*;
 import org.gridgain.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.concurrent.*;
 
 import static org.apache.ignite.events.IgniteEventType.*;
@@ -50,6 +51,7 @@ public class GridCacheGetStoreErrorSelfTest extends GridCommonAbstractTest {
     private GridCacheMode cacheMode;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -65,7 +67,7 @@ public class GridCacheGetStoreErrorSelfTest extends GridCommonAbstractTest {
         cc.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : PARTITIONED_ONLY);
         cc.setAtomicityMode(TRANSACTIONAL);
 
-        cc.setStore(new CacheStoreAdapter<Object, Object>() {
+        CacheStore store = new CacheStoreAdapter<Object, Object>() {
             @Override public Object load(Object key) {
                 throw new IgniteException("Failed to get key from store: " + key);
             }
@@ -77,7 +79,11 @@ public class GridCacheGetStoreErrorSelfTest extends GridCommonAbstractTest {
             @Override public void delete(Object key) {
                 // No-op.
             }
-        });
+        };
+
+        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cc.setReadThrough(true);
+        cc.setWriteThrough(true);
 
         c.setCacheConfiguration(cc);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
index abf9209..3688772 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
@@ -37,6 +37,7 @@ import org.gridgain.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
@@ -81,6 +82,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
@@ -94,7 +96,9 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         CacheConfiguration cacheCfg = defaultCacheConfiguration();
 
         cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setStore(store);
+        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteThrough(true);
         cacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
         cacheCfg.setAffinity(aff);
         cacheCfg.setAtomicityMode(atomicityMode());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
index 3ea4a38..911cee3 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
@@ -29,6 +29,7 @@ import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.concurrent.*;
 import java.util.concurrent.locks.*;
 
@@ -55,6 +56,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         store.reset();
+
         cache().removeAll();
 
         assertEquals("DHT entries: " + dht().entries(), 0, dht().size());
@@ -63,6 +65,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration() throws Exception {
         IgniteConfiguration cfg = super.getConfiguration();
 
@@ -81,7 +84,9 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
 
         cacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
 
-        cacheCfg.setStore(store);
+        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteThrough(true);
 
         cfg.setCacheConfiguration(cacheCfg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearPartitionedClearSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearPartitionedClearSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearPartitionedClearSelfTest.java
index 2f03664..ae80d37 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearPartitionedClearSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCacheNearPartitionedClearSelfTest.java
@@ -30,6 +30,8 @@ import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
+
 import static org.gridgain.grid.cache.GridCacheMode.*;
 import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
 import static org.gridgain.grid.cache.GridCacheDistributionMode.*;
@@ -87,7 +89,9 @@ public class GridCacheNearPartitionedClearSelfTest extends GridCommonAbstractTes
         ccfg.setPreloadMode(SYNC);
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
         ccfg.setBackups(BACKUP_CNT);
-        ccfg.setStore(store);
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        ccfg.setReadThrough(true);
+        ccfg.setWriteThrough(true);
 
         cfg.setCacheConfiguration(ccfg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java
index ec6a1ac..7bf5eaf 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java
@@ -29,6 +29,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
 import java.util.*;
 
 import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
@@ -75,6 +76,7 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected final IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -92,7 +94,9 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA
         cc.setAtomicityMode(TRANSACTIONAL);
         cc.setBackups(1);
 
-        cc.setStore(store);
+        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cc.setReadThrough(true);
+        cc.setWriteThrough(true);
 
         c.setCacheConfiguration(cc);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLoadCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLoadCacheSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLoadCacheSelfTest.java
index f1ea543..f76ca39 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLoadCacheSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedLoadCacheSelfTest.java
@@ -32,6 +32,7 @@ import org.gridgain.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 
 import static org.gridgain.grid.cache.GridCacheMode.*;
 import static org.gridgain.grid.cache.GridCacheWriteSynchronizationMode.*;
@@ -50,17 +51,20 @@ public class GridCachePartitionedLoadCacheSelfTest extends GridCommonAbstractTes
     private static final int PUT_CNT = 100;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        CacheConfiguration cache = defaultCacheConfiguration();
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        cache.setCacheMode(PARTITIONED);
-        cache.setBackups(1);
-        cache.setStore(new TestStore());
-        cache.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setBackups(1);
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+        ccfg.setReadThrough(true);
+        ccfg.setWriteThrough(true);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
-        cfg.setCacheConfiguration(cache);
+        cfg.setCacheConfiguration(ccfg);
 
         TcpDiscoverySpi disco = new TcpDiscoverySpi();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
index 0bb6af1..8fc7008 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
@@ -59,7 +59,7 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
         cc1.setPreloadMode(preloadMode);
         cc1.setEvictionPolicy(null);
         cc1.setSwapEnabled(false);
-        cc1.setStore(null);
+        cc1.setCacheStoreFactory(null);
         cc1.setEvictionPolicy(null);
         cc1.setNearEvictionPolicy(null);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
index 235a000..2ca7c09 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
@@ -30,6 +30,7 @@ import org.gridgain.grid.util.typedef.*;
 import org.gridgain.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.concurrent.atomic.*;
 
 import static org.gridgain.grid.cache.GridCacheMode.*;
@@ -80,11 +81,14 @@ public class GridCachePartitionedStorePutSelfTest extends GridCommonAbstractTest
     /**
      * @return Cache configuration.
      */
+    @SuppressWarnings("unchecked")
     private CacheConfiguration cacheConfiguration() {
         CacheConfiguration cfg = defaultCacheConfiguration();
 
         cfg.setCacheMode(PARTITIONED);
-        cfg.setStore(new TestStore());
+        cfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+        cfg.setReadThrough(true);
+        cfg.setWriteThrough(true);
         cfg.setAffinity(new GridCacheModuloAffinityFunction(3, 1));
         cfg.setWriteSynchronizationMode(FULL_SYNC);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java
index 97b8caa..ed97b3f 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java
@@ -28,6 +28,7 @@ import org.gridgain.grid.cache.*;
 import org.gridgain.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
@@ -75,12 +76,15 @@ public class GridPartitionedBackupLoadSelfTest extends GridCommonAbstractTest {
     /**
      * @return Cache configuration.
      */
+    @SuppressWarnings("unchecked")
     private CacheConfiguration cacheConfiguration() {
         CacheConfiguration cfg = defaultCacheConfiguration();
 
         cfg.setCacheMode(PARTITIONED);
         cfg.setBackups(1);
-        cfg.setStore(store);
+        cfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cfg.setReadThrough(true);
+        cfg.setWriteThrough(true);
         cfg.setWriteSynchronizationMode(FULL_SYNC);
 
         return cfg;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
index 1412542..111dc83 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
@@ -62,7 +62,7 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
         cc1.setPreloadMode(preloadMode);
         cc1.setEvictionPolicy(null);
         cc1.setSwapEnabled(false);
-        cc1.setStore(null);
+        cc1.setCacheStoreFactory(null);
 
         // Identical configuration.
         CacheConfiguration cc2 = new CacheConfiguration(cc1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java
index eefb72d..0e288d8 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java
@@ -27,6 +27,7 @@ import org.gridgain.grid.kernal.processors.cache.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
 
@@ -61,11 +62,13 @@ public class GridCacheBatchEvictUnswapSelfTest extends GridCacheAbstractSelfTest
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
         CacheConfiguration cacheCfg = super.cacheConfiguration(gridName);
 
         cacheCfg.setCacheMode(GridCacheMode.PARTITIONED);
-        cacheCfg.setStore(new CacheStoreAdapter<Long, String>() {
+
+        CacheStore store = new CacheStoreAdapter<Long, String>() {
             @Nullable @Override public String load(Long key) {
                 return null;
             }
@@ -83,7 +86,11 @@ public class GridCacheBatchEvictUnswapSelfTest extends GridCacheAbstractSelfTest
             @Override public void delete(Object key) {
                 // No-op.
             }
-        });
+        };
+
+        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteThrough(true);
 
         cacheCfg.setEvictionPolicy(new GridCacheFifoEvictionPolicy(EVICT_PLC_SIZE));
         cacheCfg.setSwapEnabled(true);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
index cf8ca02..dc5be98 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
@@ -35,6 +35,7 @@ import org.gridgain.grid.util.typedef.internal.U;
 import org.gridgain.testframework.junits.common.GridCommonAbstractTest;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 
 import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
 
@@ -61,6 +62,7 @@ public abstract class GridCacheEmptyEntriesAbstractSelfTest extends GridCommonAb
     private IgniteTxIsolation txIsolation;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -87,7 +89,13 @@ public abstract class GridCacheEmptyEntriesAbstractSelfTest extends GridCommonAb
         cc.setEvictNearSynchronized(true);
         cc.setEvictSynchronized(true);
 
-        cc.setStore(testStore);
+        if (testStore != null) {
+            cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(testStore));
+            cc.setReadThrough(true);
+            cc.setWriteThrough(true);
+        }
+        else
+            cc.setCacheStoreFactory(null);
 
         c.setCacheConfiguration(cc);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
index 150a575..f219ae2 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
@@ -19,6 +19,7 @@ package org.gridgain.grid.kernal.processors.cache.eviction;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.transactions.*;
 import org.gridgain.grid.cache.*;
@@ -32,6 +33,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
 import java.util.*;
 
 import static org.gridgain.grid.cache.GridCacheMode.*;
@@ -50,6 +52,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest {
     private GridCacheEvictionPolicy<?, ?> plc;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -68,7 +71,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest {
 
         cc.setEvictionPolicy(plc);
 
-        cc.setStore(new GridCacheGenericTestStore<Object, Object>() {
+        CacheStore store = new GridCacheGenericTestStore<Object, Object>() {
             @Override public Object load(Object key) {
                 return key;
             }
@@ -81,7 +84,11 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest {
 
                 return loaded;
             }
-        });
+        };
+
+        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cc.setReadThrough(true);
+        cc.setWriteThrough(true);
 
         c.setCacheConfiguration(cc);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLoadAllSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLoadAllSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLoadAllSelfTest.java
index cd9427f..3747198 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLoadAllSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/local/GridCacheLocalLoadAllSelfTest.java
@@ -27,6 +27,7 @@ import org.gridgain.grid.util.typedef.*;
 import org.gridgain.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 
 import static org.gridgain.grid.cache.GridCacheMode.*;
@@ -55,6 +56,7 @@ public class GridCacheLocalLoadAllSelfTest extends GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg =  super.getConfiguration(gridName);
 
@@ -64,13 +66,15 @@ public class GridCacheLocalLoadAllSelfTest extends GridCommonAbstractTest {
 
         cfg.setDiscoverySpi(disco);
 
-        CacheConfiguration cache = defaultCacheConfiguration();
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        cache.setName("test-cache");
-        cache.setCacheMode(LOCAL);
-        cache.setStore(new TestStore());
+        ccfg.setName("test-cache");
+        ccfg.setCacheMode(LOCAL);
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+        ccfg.setReadThrough(true);
+        ccfg.setWriteThrough(true);
 
-        cfg.setCacheConfiguration(cache);
+        cfg.setCacheConfiguration(ccfg);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 6428c05..1dec50a 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -42,6 +42,7 @@ import org.jdk8.backport.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import javax.cache.integration.*;
 import java.util.*;
 import java.util.concurrent.*;
@@ -67,6 +68,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
     protected static final long LATCH_TIMEOUT = 5000;
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
@@ -79,7 +81,9 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
         cacheCfg.setDistributionMode(distributionMode());
         cacheCfg.setPreloadMode(ASYNC);
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg.setStore(new TestStore());
+        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteThrough(true);
         cacheCfg.setQueryIndexEnabled(false);
 
         cfg.setCacheConfiguration(cacheCfg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/loadtests/cache/GridCacheWriteBehindStoreLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/loadtests/cache/GridCacheWriteBehindStoreLoadTest.java b/modules/core/src/test/java/org/gridgain/loadtests/cache/GridCacheWriteBehindStoreLoadTest.java
index 5ce5aa3..b2df006 100644
--- a/modules/core/src/test/java/org/gridgain/loadtests/cache/GridCacheWriteBehindStoreLoadTest.java
+++ b/modules/core/src/test/java/org/gridgain/loadtests/cache/GridCacheWriteBehindStoreLoadTest.java
@@ -29,6 +29,7 @@ import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
 
@@ -110,7 +111,9 @@ public class GridCacheWriteBehindStoreLoadTest extends GridCommonAbstractTest {
         cc.setWriteSynchronizationMode(FULL_SYNC);
         cc.setSwapEnabled(false);
 
-        cc.setStore(store);
+        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        cc.setReadThrough(true);
+        cc.setWriteThrough(true);
 
         cc.setWriteBehindEnabled(true);
         cc.setWriteBehindFlushFrequency(WRITE_FROM_BEHIND_FLUSH_FREQUENCY);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/loadtests/capacity/spring-capacity-cache.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/loadtests/capacity/spring-capacity-cache.xml b/modules/core/src/test/java/org/gridgain/loadtests/capacity/spring-capacity-cache.xml
index 814842e..f1e249d 100644
--- a/modules/core/src/test/java/org/gridgain/loadtests/capacity/spring-capacity-cache.xml
+++ b/modules/core/src/test/java/org/gridgain/loadtests/capacity/spring-capacity-cache.xml
@@ -49,7 +49,7 @@
         <property name="cacheConfiguration">
             <!--
                 Specify list of cache configurations here. Any property from
-                GridCacheConfiguration interface can be configured here.
+                CacheConfiguration interface can be configured here.
                 Note that absolutely all configuration properties are optional.
             -->
             <list>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml b/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml
index 29a8c48..0eb6c5a 100644
--- a/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml
+++ b/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml
@@ -105,7 +105,7 @@
         <property name="cacheConfiguration">
             <!--
                 Specify list of cache configurations here. Any property from
-                GridCacheConfiguration interface can be configured here.
+                CacheConfiguration interface can be configured here.
                 Note that absolutely all configuration properties are optional.
             -->
             <list>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/loadtests/swap/GridSwapEvictAllBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/loadtests/swap/GridSwapEvictAllBenchmark.java b/modules/core/src/test/java/org/gridgain/loadtests/swap/GridSwapEvictAllBenchmark.java
index 6cb9de6..81540fc 100644
--- a/modules/core/src/test/java/org/gridgain/loadtests/swap/GridSwapEvictAllBenchmark.java
+++ b/modules/core/src/test/java/org/gridgain/loadtests/swap/GridSwapEvictAllBenchmark.java
@@ -34,6 +34,7 @@ import org.gridgain.testframework.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
 
@@ -248,6 +249,7 @@ public class GridSwapEvictAllBenchmark {
      * @return Started grid.
      * @throws IgniteCheckedException If failed.
      */
+    @SuppressWarnings("unchecked")
     private static Ignite start(CacheStore<Long, String> store) throws IgniteCheckedException {
         IgniteConfiguration cfg = new IgniteConfiguration();
 
@@ -266,7 +268,12 @@ public class GridSwapEvictAllBenchmark {
         ccfg.setSwapEnabled(true);
         ccfg.setEvictSynchronized(false);
         ccfg.setEvictionPolicy(new GridCacheFifoEvictionPolicy(EVICT_PLC_SIZE));
-        ccfg.setStore(store);
+
+        if (store != null) {
+            ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+            ccfg.setReadThrough(true);
+            ccfg.setWriteThrough(true);
+        }
 
         FileSwapSpaceSpi swap = new FileSwapSpaceSpi();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/GridTestUtils.java b/modules/core/src/test/java/org/gridgain/testframework/GridTestUtils.java
index fc73054..d4e9c7f 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/GridTestUtils.java
@@ -1086,6 +1086,45 @@ public final class GridTestUtils {
     }
 
     /**
+     * Set object field value via reflection.
+     *
+     * @param obj Object to set field value to.
+     * @param cls Class to get field from.
+     * @param fieldName Field name to set value for.
+     * @param val New field value.
+     * @throws IgniteException In case of error.
+     */
+    @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
+    public static void setFieldValue(Object obj, Class cls, String fieldName, Object val) throws IgniteException {
+        assert obj != null;
+        assert fieldName != null;
+
+        try {
+            Field field = cls.getDeclaredField(fieldName);
+
+            synchronized (field) {
+                // Backup accessible field state.
+                boolean accessible = field.isAccessible();
+
+                try {
+                    if (!accessible)
+                        field.setAccessible(true);
+
+                    field.set(obj, val);
+                }
+                finally {
+                    // Recover accessible field state.
+                    if (!accessible)
+                        field.setAccessible(false);
+                }
+            }
+        }
+        catch (NoSuchFieldException | IllegalAccessException e) {
+            throw new IgniteException("Failed to set object field [obj=" + obj + ", field=" + fieldName + ']', e);
+        }
+    }
+
+    /**
      * Invoke method on an object.
      *
      * @param obj Object to call method on.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/java/org/gridgain/testframework/junits/cache/GridAbstractCacheStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/junits/cache/GridAbstractCacheStoreSelfTest.java b/modules/core/src/test/java/org/gridgain/testframework/junits/cache/GridAbstractCacheStoreSelfTest.java
index 261f202..a6757e4 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/junits/cache/GridAbstractCacheStoreSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/junits/cache/GridAbstractCacheStoreSelfTest.java
@@ -20,19 +20,18 @@ package org.gridgain.testframework.junits.cache;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.resources.*;
 import org.apache.ignite.transactions.*;
 import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.grid.util.lang.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
+import org.gridgain.testframework.*;
 import org.gridgain.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
 import java.util.*;
 import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
 
 /**
  * Abstract cache store test.
@@ -411,7 +410,7 @@ public abstract class GridAbstractCacheStoreSelfTest<T extends CacheStore<Object
     protected void inject(T store) throws Exception {
         getTestResources().inject(store);
 
-        getTestResources().resources().injectBasicResource(store, IgniteCacheSessionResource.class, ses);
+        GridTestUtils.setFieldValue(store, CacheStore.class, "ses", ses);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/core/src/test/webapp/META-INF/gg-config.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/webapp/META-INF/gg-config.xml b/modules/core/src/test/webapp/META-INF/gg-config.xml
index e29ab79..7d18bd3 100644
--- a/modules/core/src/test/webapp/META-INF/gg-config.xml
+++ b/modules/core/src/test/webapp/META-INF/gg-config.xml
@@ -81,7 +81,7 @@
         <property name="cacheConfiguration">
             <!--
                 Specify list of cache configurations here. Any property from
-                GridCacheConfiguration interface can be configured here.
+                CacheConfiguration interface can be configured here.
                 Note that absolutely all configuration properties are optional.
             -->
             <list>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java b/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
index cc1e4ff..d4633b1 100644
--- a/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
+++ b/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
@@ -581,4 +581,13 @@ public class GridCacheHibernateBlobStore<K, V> extends CacheStoreAdapter<K, V> {
 
         return marsh.unmarshal(bytes, getClass().getClassLoader());
     }
+
+    /**
+     * @return Current transaction.
+     */
+    @Nullable private IgniteTx transaction() {
+        CacheStoreSession ses = session();
+
+        return ses != null ? ses.transaction() : null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractQuerySelfTest.java
index 0a00bf5..b302aed 100644
--- a/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractQuerySelfTest.java
@@ -41,6 +41,7 @@ import org.jdk8.backport.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import javax.cache.expiry.*;
 import java.io.*;
 import java.util.*;
@@ -97,6 +98,7 @@ public abstract class GridCacheAbstractQuerySelfTest extends GridCommonAbstractT
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 
@@ -127,9 +129,11 @@ public abstract class GridCacheAbstractQuerySelfTest extends GridCommonAbstractT
 
             cc.setCacheMode(cacheMode());
             cc.setAtomicityMode(atomicityMode());
-            cc.setDistributionMode(gridName.startsWith("client") ? CLIENT_ONLY :distributionMode());
+            cc.setDistributionMode(gridName.startsWith("client") ? CLIENT_ONLY : distributionMode());
             cc.setWriteSynchronizationMode(FULL_SYNC);
-            cc.setStore(store);
+            cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+            cc.setReadThrough(true);
+            cc.setWriteThrough(true);
             cc.setPreloadMode(SYNC);
             cc.setSwapEnabled(true);
             cc.setEvictNearSynchronized(false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eafa1141/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheQueryLoadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheQueryLoadSelfTest.java b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheQueryLoadSelfTest.java
index 3118aaf..d4f20c6 100644
--- a/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheQueryLoadSelfTest.java
+++ b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheQueryLoadSelfTest.java
@@ -35,6 +35,7 @@ import org.gridgain.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 
 import static org.gridgain.grid.cache.GridCacheMode.*;
@@ -59,16 +60,19 @@ public class GridCacheQueryLoadSelfTest extends GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        CacheConfiguration cache = defaultCacheConfiguration();
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        cache.setCacheMode(REPLICATED);
-        cache.setStore(new TestStore());
-        cache.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setCacheMode(REPLICATED);
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+        ccfg.setReadThrough(true);
+        ccfg.setWriteThrough(true);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
-        cfg.setCacheConfiguration(cache);
+        cfg.setCacheConfiguration(ccfg);
 
         TcpDiscoverySpi disco = new TcpDiscoverySpi();
 


Mime
View raw message