Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-42 854664a75 -> ee7bb3fd6


# ignite-42


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

Branch: refs/heads/ignite-42
Commit: ee7bb3fd69f0988aee9957312af9a8ddfd90c226
Parents: 854664a
Author: sboikov <semen.boi...@inria.fr>
Authored: Wed Jan 21 08:02:24 2015 +0300
Committer: sboikov <semen.boi...@inria.fr>
Committed: Wed Jan 21 08:02:24 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheInvokeEntry.java      |  12 +-
 .../processors/cache/GridCacheAdapter.java      |  27 +-
 .../processors/cache/GridCacheMapEntry.java     |   4 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   2 +
 .../IgniteCacheLoaderWriterAbstractTest.java    |  12 +-
 .../IgniteCacheStoreSessionTest.java            | 435 +++++++++++++++++++
 .../cache/GridCacheAbstractFullApiSelfTest.java |   3 +-
 .../bamboo/GridDataGridTestSuite.java           |   1 +
 8 files changed, 479 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
index e44aff1..055263d 100644
--- 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
+++ 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
@@ -30,9 +30,6 @@ public class CacheInvokeEntry<K, V> implements 
MutableEntry<K, V> {
     /** */
     private boolean modified;
 
-    /** */
-    private final boolean hadVal;
-
     /**
      * @param key Key.
      * @param val Value.
@@ -42,8 +39,6 @@ public class CacheInvokeEntry<K, V> implements 
MutableEntry<K, V> {
 
         this.key = key;
         this.val = val;
-
-        hadVal = val != null;
     }
 
     /** {@inheritDoc} */
@@ -84,14 +79,9 @@ public class CacheInvokeEntry<K, V> implements 
MutableEntry<K, V> {
     }
 
     /**
-     * @return {@code True} if entry was modified.
+     * @return {@code True} if {@link #setValue} or {@link #remove was called}.
      */
     public boolean modified() {
-        if (modified) {
-            if (!hadVal && val == null)
-                return false;
-        }
-
         return modified;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
index e08653e..f02b4c8 100644
--- 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
@@ -22,6 +22,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.dataload.*;
 import org.apache.ignite.fs.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.security.*;
@@ -2811,8 +2812,10 @@ public abstract class GridCacheAdapter<K, V> extends 
GridMetadataAwareAdapter im
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(@Nullable final Collection<? extends K> 
keys,
+    @Override public void removeAll(final Collection<? extends K> keys,
         final IgnitePredicate<GridCacheEntry<K, V>>... filter) throws 
IgniteCheckedException {
+        A.notNull(keys, "keys");
+
         ctx.denyOnLocalRead();
 
         if (F.isEmpty(keys))
@@ -3395,6 +3398,9 @@ public abstract class GridCacheAdapter<K, V> extends 
GridMetadataAwareAdapter im
             if (ctx.store().isLocalStore()) {
                 Collection<ClusterNode> nodes = 
ctx.grid().forCache(name()).nodes();
 
+                if (nodes.isEmpty())
+                    return new GridFinishedFuture<>(ctx.kernalContext());
+
                 return ctx.closures().callAsyncNoFailover(BROADCAST,
                     new LoadKeysCallable<>(ctx.name(), keys, true),
                     nodes,
@@ -3413,6 +3419,9 @@ public abstract class GridCacheAdapter<K, V> extends 
GridMetadataAwareAdapter im
         else {
             Collection<ClusterNode> nodes = 
ctx.grid().forCache(name()).nodes();
 
+            if (nodes.isEmpty())
+                return new GridFinishedFuture<>(ctx.kernalContext());
+
             return ctx.closures().callAsyncNoFailover(BROADCAST,
                 new LoadKeysCallable<>(ctx.name(), keys, false),
                 nodes,
@@ -3426,6 +3435,8 @@ public abstract class GridCacheAdapter<K, V> extends 
GridMetadataAwareAdapter im
      */
     private void localLoadAndUpdate(final Collection<? extends K> keys) throws 
IgniteCheckedException {
         try (final IgniteDataLoader<K, V> ldr = ctx.kernalContext().<K, 
V>dataLoad().dataLoader(ctx.namex(), false)) {
+            ldr.updater(new SkipStoreUpdater<K, V>());
+
             final Collection<Map.Entry<K, V>> col = new 
ArrayList<>(ldr.perNodeBufferSize());
 
             ctx.store().loadAllFromStore(null, keys, new CIX2<K, V>() {
@@ -5333,4 +5344,18 @@ public abstract class GridCacheAdapter<K, V> extends 
GridMetadataAwareAdapter im
                 ldr.addData(col);
         }
     }
+
+    /**
+     *
+     */
+    static class SkipStoreUpdater<K, V> implements 
IgniteDataLoadCacheUpdater<K, V> {
+    /** {@inheritDoc} */
+        @Override public void update(IgniteCache<K, V> cache, 
Collection<Map.Entry<K, V>> entries)
+            throws IgniteCheckedException {
+            cache = cache.flagsOn(SKIP_STORE);
+
+            for (Map.Entry<K, V> e : entries)
+                cache.put(e.getKey(), e.getValue());
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
index e8bb529..d9c84ab 100644
--- 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
+++ 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
@@ -1426,7 +1426,7 @@ public abstract class GridCacheMapEntry<K, V> implements 
GridCacheEntryEx<K, V>
 
             GridCacheValueBytes oldBytes = valueBytesUnlocked();
 
-            if (needVal && old == null) {
+            if (needVal && old == null && cctx.readThrough()) {
                 old = readThrough(null, key, false, CU.<K, V>empty(), subjId, 
taskName);
 
                 // Detach value before index update.
@@ -1766,7 +1766,7 @@ public abstract class GridCacheMapEntry<K, V> implements 
GridCacheEntryEx<K, V>
 
             GridCacheValueBytes oldBytes = valueBytesUnlocked();
 
-            if (needVal && old == null) {
+            if (needVal && old == null && cctx.readThrough()) {
                 old = readThrough(null, key, false, CU.<K, V>empty(), subjId, 
taskName);
 
                 // Detach value before index update.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 0dbf7dd..23f5ce3 100644
--- 
a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ 
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -484,6 +484,8 @@ public class GridDhtAtomicCache<K, V> extends 
GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @Override public IgniteFuture<?> removeAllAsync(Collection<? extends K> 
keys,
         IgnitePredicate<GridCacheEntry<K, V>>[] filter) {
+        A.notNull(keys, "keys");
+
         return removeAllAsync0(keys, null, null, false, false, filter);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
index 68829d8..7564f06 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
@@ -140,9 +140,19 @@ public abstract class IgniteCacheLoaderWriterAbstractTest 
extends IgniteCacheAbs
 
             checkCalls(3, 3);
 
-            cache.remove(key);
+            cache.invoke(key, new EntryProcessor<Object, Object, Object>() {
+                @Override public Object process(MutableEntry<Object, Object> 
e, Object... args) {
+                    e.remove();
+
+                    return null;
+                }
+            });
 
             checkCalls(3, 4);
+
+            assertFalse(storeMap.containsKey(key));
+
+            assertNull(cache.get(key));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionTest.java
new file mode 100644
index 0000000..d333456
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionTest.java
@@ -0,0 +1,435 @@
+package org.apache.ignite.internal.processors.cache.integration;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.transactions.*;
+import org.gridgain.grid.cache.*;
+import org.gridgain.grid.util.typedef.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import javax.cache.integration.*;
+import java.util.*;
+
+import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
+import static org.apache.ignite.transactions.IgniteTxIsolation.*;
+import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
+import static org.gridgain.grid.cache.GridCacheDistributionMode.*;
+import static org.gridgain.grid.cache.GridCacheMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheStoreSessionTest extends IgniteCacheAbstractTest {
+    /** */
+    private static volatile List<ExpectedData> expData;
+
+    /** */
+    private static final String CACHE_NAME1 = "cache1";
+
+    private TestStore store = new TestStore();
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 3;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected GridCacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected GridCacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected GridCacheDistributionMode distributionMode() {
+        return PARTITIONED_ONLY;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheStore<?, ?> cacheStore() {
+        return store;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        assert cfg.getCacheConfiguration().length == 1;
+
+        CacheConfiguration ccfg0 = cfg.getCacheConfiguration()[0];
+
+        CacheConfiguration ccfg1 = cacheConfiguration(gridName);
+
+        ccfg1.setName(CACHE_NAME1);
+
+        cfg.setCacheConfiguration(ccfg0, ccfg1);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        expData = null;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        expData = Collections.synchronizedList(new ArrayList<ExpectedData>());
+
+        super.beforeTestsStarted();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStoreSession() throws Exception {
+        testTxPut(jcache(0), null, null);
+
+        testTxPut(ignite(0).jcache(CACHE_NAME1), null, null);
+
+        testTxRemove(null, null);
+
+        testTxPutRemove(null, null);
+
+        for (IgniteTxConcurrency concurrency : F.asList(PESSIMISTIC)) {
+            for (IgniteTxIsolation isolation : F.asList(REPEATABLE_READ)) {
+                testTxPut(jcache(0), concurrency, isolation);
+
+                testTxRemove(concurrency, isolation);
+
+                testTxPutRemove(concurrency, isolation);
+            }
+        }
+    }
+
+    /**
+     * @param cnt Keys count.
+     * @return Keys.
+     * @throws Exception If failed.
+     */
+    private List<Integer> testKeys(IgniteCache cache, int cnt) throws 
Exception {
+        return primaryKeys(cache, cnt, 0);
+    }
+
+    /**
+     * @param concurrency Concurrency mode.
+     * @param isolation Isolation mode.
+     * @throws Exception If failed.
+     */
+    private void testTxPutRemove(IgniteTxConcurrency concurrency, 
IgniteTxIsolation isolation) throws Exception {
+        log.info("Test tx put/remove [concurrency=" + concurrency + ", 
isolation=" + isolation + ']');
+
+        IgniteCache<Integer, Integer> cache = jcache(0);
+
+        List<Integer> keys = testKeys(cache, 3);
+
+        Integer key1 = keys.get(0);
+        Integer key2 = keys.get(1);
+        Integer key3 = keys.get(2);
+
+        try (IgniteTx tx = startTx(concurrency, isolation)) {
+            log.info("Do tx put1.");
+
+            cache.put(key1, key1);
+
+            log.info("Do tx put2.");
+
+            cache.put(key2, key2);
+
+            log.info("Do tx remove.");
+
+            cache.remove(key3);
+
+            expData.add(new ExpectedData("writeAll", new HashMap<>(), null));
+            expData.add(new ExpectedData("delete", F.<Object, Object>asMap(0, 
"writeAll"), null));
+            expData.add(new ExpectedData("txEnd", F.<Object, Object>asMap(0, 
"writeAll", 1, "delete"), null));
+
+            log.info("Do tx commit.");
+
+            tx.commit();
+        }
+
+        assertEquals(0, expData.size());
+    }
+
+    /**
+     * @param concurrency Concurrency mode.
+     * @param isolation Isolation mode.
+     * @throws Exception If failed.
+     */
+    private void testTxPut(IgniteCache<Object, Object> cache,
+        IgniteTxConcurrency concurrency,
+        IgniteTxIsolation isolation) throws Exception {
+        log.info("Test tx put [concurrency=" + concurrency + ", isolation=" + 
isolation + ']');
+
+        List<Integer> keys = testKeys(cache, 3);
+
+        Integer key1 = keys.get(0);
+
+        try (IgniteTx tx = startTx(concurrency, isolation)) {
+            log.info("Do tx get.");
+
+            cache.get(key1);
+
+            log.info("Do tx put.");
+
+            cache.put(key1, key1);
+
+            expData.add(new ExpectedData("write", new HashMap<>(), 
cache.getName()));
+            expData.add(new ExpectedData("txEnd", F.<Object, Object>asMap(0, 
"write"), cache.getName()));
+
+            log.info("Do tx commit.");
+
+            tx.commit();
+        }
+
+        assertEquals(0, expData.size());
+
+        Integer key2 = keys.get(1);
+        Integer key3 = keys.get(2);
+
+        try (IgniteTx tx = startTx(concurrency, isolation);) {
+            log.info("Do tx put1.");
+
+            cache.put(key2, key2);
+
+            log.info("Do tx put2.");
+
+            cache.put(key3, key3);
+
+            expData.add(new ExpectedData("writeAll", new HashMap<>(), 
cache.getName()));
+            expData.add(new ExpectedData("txEnd", F.<Object, Object>asMap(0, 
"writeAll"), cache.getName()));
+
+            log.info("Do tx commit.");
+
+            tx.commit();
+        }
+
+        assertEquals(0, expData.size());
+    }
+
+    /**
+     * @param concurrency Concurrency mode.
+     * @param isolation Isolation mode.
+     * @throws Exception If failed.
+     */
+    private void testTxRemove(IgniteTxConcurrency concurrency, 
IgniteTxIsolation isolation) throws Exception {
+        log.info("Test tx remove [concurrency=" + concurrency + ", isolation=" 
+ isolation + ']');
+
+        IgniteCache<Integer, Integer> cache = jcache(0);
+
+        List<Integer> keys = testKeys(cache, 3);
+
+        Integer key1 = keys.get(0);
+
+        try (IgniteTx tx = startTx(concurrency, isolation)) {
+            log.info("Do tx get.");
+
+            cache.get(key1);
+
+            log.info("Do tx remove.");
+
+            cache.remove(key1, key1);
+
+            expData.add(new ExpectedData("delete", new HashMap<>(), null));
+            expData.add(new ExpectedData("txEnd", F.<Object, Object>asMap(0, 
"delete"), null));
+
+            log.info("Do tx commit.");
+
+            tx.commit();
+        }
+
+        assertEquals(0, expData.size());
+
+        Integer key2 = keys.get(1);
+        Integer key3 = keys.get(2);
+
+        try (IgniteTx tx = startTx(concurrency, isolation);) {
+            log.info("Do tx remove1.");
+
+            cache.remove(key2, key2);
+
+            log.info("Do tx remove2.");
+
+            cache.remove(key3, key3);
+
+            expData.add(new ExpectedData("deleteAll", new HashMap<>(), null));
+            expData.add(new ExpectedData("txEnd", F.<Object, Object>asMap(0, 
"deleteAll"), null));
+
+            log.info("Do tx commit.");
+
+            tx.commit();
+        }
+
+        assertEquals(0, expData.size());
+    }
+
+    /**
+     * @param concurrency Concurrency mode.
+     * @param isolation Isolation mode.
+     * @return Transaction.
+     */
+    private IgniteTx startTx(IgniteTxConcurrency concurrency, 
IgniteTxIsolation isolation) {
+        IgniteTransactions txs = ignite(0).transactions();
+
+        if (concurrency == null)
+            return txs.txStart();
+
+        return txs.txStart(concurrency, isolation);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSessionCrossCacheTx() throws Exception {
+        IgniteCache<Object, Object> cache0 = ignite(0).jcache(null);
+
+        IgniteCache<Object, Object> cache1 = ignite(0).jcache(CACHE_NAME1);
+
+        Integer key1 = primaryKey(cache0);
+        Integer key2 = primaryKeys(cache1, 1, key1 + 1).get(0);
+
+        try (IgniteTx tx = startTx(null, null)) {
+            cache1.put(key2, key2);
+
+            cache0.put(key1, key1);
+
+            expData.add(new ExpectedData("writeAll", new HashMap<>(), null));
+            expData.add(new ExpectedData("txEnd", F.<Object, Object>asMap(0, 
"writeAll"), null));
+
+            tx.commit();
+        }
+
+        assertEquals(0, expData.size());
+    }
+
+    /**
+     *
+     */
+    static class ExpectedData {
+        /** */
+        private final String expMtd;
+
+        /** */
+        private  final Map<Object, Object> expProps;
+
+        /** */
+        private final String expCacheName;
+
+        /**
+         * @param expMtd Expected method.
+         * @param expProps Expected properties.
+         * @param expCacheName Expected cache name.
+         */
+        public ExpectedData(String expMtd, Map<Object, Object> expProps, 
String expCacheName) {
+            this.expMtd = expMtd;
+            this.expProps = expProps;
+            this.expCacheName = expCacheName;
+        }
+    }
+
+    /**
+     *
+     */
+    private class TestStore extends CacheStore<Object, Object> {
+        /** {@inheritDoc} */
+        @Override public void loadCache(IgniteBiInClosure<Object, Object> clo, 
@Nullable Object... args) {
+            fail();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void txEnd(boolean commit) throws 
CacheWriterException {
+            log.info("Tx end [commit=" + commit + ", tx=" + 
session().transaction() + ']');
+
+            checkSession("txEnd");
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object load(Object key) throws CacheLoaderException {
+            log.info("Load [key=" + key + ", tx=" + session().transaction() + 
']');
+
+            checkSession("load");
+
+            return key;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<Object, Object> loadAll(Iterable<?> keys) throws 
CacheLoaderException {
+            log.info("LoadAll [keys=" + keys + ", tx=" + 
session().transaction() + ']');
+
+            checkSession("loadAll");
+
+            Map<Object, Object> loaded = new HashMap<>();
+
+            for (Object key : keys)
+                loaded.put(key, key);
+
+            return loaded;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void write(Cache.Entry<?, ?> entry) throws 
CacheWriterException {
+            log.info("Write [write=" + entry + ", tx=" + 
session().transaction() + ']');
+
+            checkSession("write");
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeAll(Collection<Cache.Entry<?, ?>> entries) 
throws CacheWriterException {
+            log.info("WriteAll: [writeAll=" + entries + ", tx=" + 
session().transaction() + ']');
+
+            checkSession("writeAll");
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(Object key) throws CacheWriterException {
+            log.info("Delete [key=" + key + ", tx=" + session().transaction() 
+ ']');
+
+            checkSession("delete");
+        }
+
+        /** {@inheritDoc} */
+        @Override public void deleteAll(Collection<?> keys) throws 
CacheWriterException {
+            log.info("DeleteAll [keys=" + keys + ", tx=" + 
session().transaction() + ']');
+
+            checkSession("deleteAll");
+        }
+
+        /**
+         * @param mtd Called stored method.
+         */
+        private void checkSession(String mtd) {
+            assertFalse(expData.isEmpty());
+
+            ExpectedData exp = expData.remove(0);
+
+            assertEquals(exp.expMtd, mtd);
+
+            CacheStoreSession ses = session();
+
+            assertNotNull(ses);
+
+            assertNotNull(ses.transaction());
+
+            Map<Object, Object> props = ses.properties();
+
+            assertNotNull(props);
+
+            assertEquals(exp.expProps, props);
+
+            props.put(props.size(), mtd);
+
+            assertEquals(exp.expCacheName, ses.cacheName());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index a65b73f..0ec83e4 100644
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -800,8 +800,7 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
     private void checkTransform(IgniteTxConcurrency concurrency, 
IgniteTxIsolation isolation) throws Exception {
         IgniteCache<String, Integer> cache = jcache();
 
-        List<String> keys =
-            concurrency == OPTIMISTIC ? primaryKeysForCache(cache, 3) : 
Arrays.asList("key1", "key2", "key3");
+        List<String> keys = Arrays.asList("key1", "key2", "key3");
 
         String key1 = keys.get(0);
         String key2 = keys.get(1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee7bb3fd/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
 
b/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
index 2e7775b..887ae1a 100644
--- 
a/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
+++ 
b/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
@@ -343,6 +343,7 @@ public class GridDataGridTestSuite extends TestSuite {
 
         suite.addTestSuite(IgniteCacheAtomicLoaderWriterTest.class);
         //suite.addTestSuite(IgniteCacheTxLoaderWriterTest.class);
+        //suite.addTestSuite(IgniteCacheStoreSessionTest.class);
 
         return suite;
     }

Reply via email to