ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #ignite-333: Comment Full api self test.
Date Wed, 18 Mar 2015 16:53:13 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-333 268f1bd37 -> 9666a415a


#ignite-333: Comment Full api self test.


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

Branch: refs/heads/ignite-333
Commit: 9666a415a1d5fd50abb7f3702053d760ae5f8735
Parents: 268f1bd
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Mar 18 19:53:08 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Mar 18 19:53:08 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFullApiSelfTest.java | 622 +++++++++----------
 .../dht/GridCacheAtomicFullApiSelfTest.java     |  74 +--
 ...tomicClientOnlyMultiNodeFullApiSelfTest.java |  12 +-
 ...eAtomicNearOnlyMultiNodeFullApiSelfTest.java |   6 +-
 ...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 122 ++--
 5 files changed, 413 insertions(+), 423 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9666a415/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index de064e2..6a7eb8c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -185,79 +185,79 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 ///*
 //    *
 //     * @throws Exception In case of error.
-//    public void testSize() throws Exception {
-//        assert jcache().localSize() == 0;
-//
-//        int size = 10;
-//
-//        Map<String, Integer> map = new HashMap<>();
-//
-//        for (int i = 0; i < size; i++)
-//            map.put("key" + i, i);
-//
-//        // Put in primary nodes to avoid near readers which will prevent entry from being
cleared.
-//        Map<ClusterNode, Collection<String>> mapped = grid(0).cluster().mapKeysToNodes(null,
map.keySet());
-//
-//        for (int i = 0; i < gridCount(); i++) {
-//            Collection<String> keys = mapped.get(grid(i).localNode());
-//
-//            if (!F.isEmpty(keys)) {
-//                for (String key : keys)
-//                    jcache(i).put(key, map.get(key));
-//            }
-//        }
-//
-//        map.remove("key0");
-//
-//        mapped = grid(0).cluster().mapKeysToNodes(null, map.keySet());
-//
-//        for (int i = 0; i < gridCount(); i++) {
-//            // Will actually delete entry from map.
-//            CU.invalidate(cache(i), "key0");
-//
-//            assertNull("Failed check for grid: " + i, jcache(i).localPeek("key0", CachePeekMode.ONHEAP));
-//
-//            Collection<String> keysCol = mapped.get(grid(i).localNode());
-//
-//            assert jcache(i).localSize() != 0 || F.isEmpty(keysCol);
-//        }
-//
-//        for (int i = 0; i < gridCount(); i++) {
-//            GridCacheContext<String, Integer> ctx = context(i);
-//
-//            int sum = 0;
-//
-//            for (String key : map.keySet())
-//                if (ctx.affinity().localNode(key, ctx.discovery().topologyVersion()))
-//                    sum++;
-//
-//            assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize());
-//        }
-//
-//        for (int i = 0; i < gridCount(); i++) {
-//            Collection<String> keysCol = mapped.get(grid(i).localNode());
-//
-//            assertEquals("Failed check for grid: " + i, !F.isEmpty(keysCol) ? keysCol.size()
: 0,
-//                cache(i).primarySize());
-//        }
-//
-//        int globalPrimarySize = map.size();
-//
-//        for (int i = 0; i < gridCount(); i++)
-//            assertEquals(globalPrimarySize, cache(i).globalPrimarySize());
-//
-//        int times = 1;
-//
-//        if (cacheMode() == REPLICATED)
-//            times = gridCount();
-//        else if (cacheMode() == PARTITIONED)
-//            times = Math.min(gridCount(), jcache().getConfiguration(CacheConfiguration.class).getBackups()
+ 1);
-//
-//        int globalSize = globalPrimarySize * times;
-//
-//        for (int i = 0; i < gridCount(); i++)
-//            assertEquals(globalSize, cache(i).globalSize());
-//    }
+    public void testSize() throws Exception {
+        assert jcache().localSize() == 0;
+
+        int size = 10;
+
+        Map<String, Integer> map = new HashMap<>();
+
+        for (int i = 0; i < size; i++)
+            map.put("key" + i, i);
+
+        // Put in primary nodes to avoid near readers which will prevent entry from being
cleared.
+        Map<ClusterNode, Collection<String>> mapped = grid(0).cluster().mapKeysToNodes(null,
map.keySet());
+
+        for (int i = 0; i < gridCount(); i++) {
+            Collection<String> keys = mapped.get(grid(i).localNode());
+
+            if (!F.isEmpty(keys)) {
+                for (String key : keys)
+                    jcache(i).put(key, map.get(key));
+            }
+        }
+
+        map.remove("key0");
+
+        mapped = grid(0).cluster().mapKeysToNodes(null, map.keySet());
+
+        for (int i = 0; i < gridCount(); i++) {
+            // Will actually delete entry from map.
+            CU.invalidate(cache(i), "key0");
+
+            assertNull("Failed check for grid: " + i, jcache(i).localPeek("key0", CachePeekMode.ONHEAP));
+
+            Collection<String> keysCol = mapped.get(grid(i).localNode());
+
+            assert jcache(i).localSize() != 0 || F.isEmpty(keysCol);
+        }
+
+        for (int i = 0; i < gridCount(); i++) {
+            GridCacheContext<String, Integer> ctx = context(i);
+
+            int sum = 0;
+
+            for (String key : map.keySet())
+                if (ctx.affinity().localNode(key, ctx.discovery().topologyVersion()))
+                    sum++;
+
+            assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize());
+        }
+
+        for (int i = 0; i < gridCount(); i++) {
+            Collection<String> keysCol = mapped.get(grid(i).localNode());
+
+            assertEquals("Failed check for grid: " + i, !F.isEmpty(keysCol) ? keysCol.size()
: 0,
+                cache(i).primarySize());
+        }
+
+        int globalPrimarySize = map.size();
+
+        for (int i = 0; i < gridCount(); i++)
+            assertEquals(globalPrimarySize, cache(i).globalPrimarySize());
+
+        int times = 1;
+
+        if (cacheMode() == REPLICATED)
+            times = gridCount();
+        else if (cacheMode() == PARTITIONED)
+            times = Math.min(gridCount(), jcache().getConfiguration(CacheConfiguration.class).getBackups()
+ 1);
+
+        int globalSize = globalPrimarySize * times;
+
+        for (int i = 0; i < gridCount(); i++)
+            assertEquals(globalSize, cache(i).globalSize());
+    }
 //
 //    *
 //     * @throws Exception In case of error.
@@ -2506,39 +2506,39 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 //    *
 //     * @throws Exception In case of error.
 //
-//    public void testLoadAll() throws Exception {
-//        IgniteCache<String, Integer> cache = jcache();
-//
-//        Set<String> keys = new HashSet<>(primaryKeysForCache(cache, 2));
-//
-//        for (String key : keys)
-//            assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
-//
-//        Map<String, Integer> vals = new HashMap<>();
-//
-//        int i = 0;
-//
-//        for (String key : keys) {
-//            cache.put(key, i);
-//
-//            vals.put(key, i);
-//
-//            i++;
-//        }
-//
-//        for (String key : keys)
-//            assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
-//
-//        cache.clear();
-//
-//        for (String key : keys)
-//            assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
-//
-//        loadAll(cache, keys, true);
-//
-//        for (String key : keys)
-//            assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
-//    }
+    public void testLoadAll() throws Exception {
+        IgniteCache<String, Integer> cache = jcache();
+
+        Set<String> keys = new HashSet<>(primaryKeysForCache(cache, 2));
+
+        for (String key : keys)
+            assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+
+        Map<String, Integer> vals = new HashMap<>();
+
+        int i = 0;
+
+        for (String key : keys) {
+            cache.put(key, i);
+
+            vals.put(key, i);
+
+            i++;
+        }
+
+        for (String key : keys)
+            assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
+
+        cache.clear();
+
+        for (String key : keys)
+            assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+
+        loadAll(cache, keys, true);
+
+        for (String key : keys)
+            assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
+    }
 //
 //    *
 //     * @throws Exception If failed.
@@ -2596,136 +2596,126 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 //    *
 //     * @throws Exception In case of error.
 //
-//    public void testClear() throws Exception {
-//        IgniteCache<String, Integer> cache = jcache();
-//
-//        Set<String> keys = new HashSet<>(primaryKeysForCache(cache, 3));
-//
-//        for (String key : keys)
-//            assertNull(cache.get(key));
-//
-//        Map<String, Integer> vals = new HashMap<>(keys.size());
-//
-//        int i = 0;
-//
-//        for (String key : keys) {
-//            cache.put(key, i);
-//
-//            vals.put(key, i);
-//
-//            i++;
-//        }
-//
-//        for (String key : keys)
-//            assertEquals(vals.get(key), peek(cache, key));
-//
-//        cache.clear();
-//
-//        for (String key : keys)
-//            assertNull(peek(cache, key));
-//
-//        for (i = 0; i < gridCount(); i++)
-//            jcache(i).clear();
-//
-//        for (i = 0; i < gridCount(); i++)
-//            assert jcache(i).localSize() == 0;
-//
-//        for (Map.Entry<String, Integer> entry : vals.entrySet())
-//            cache.put(entry.getKey(), entry.getValue());
-//
-//        for (String key : keys)
-//            assertEquals(vals.get(key), peek(cache, key));
-//
-//        String first = F.first(keys);
-//
-//        if (lockingEnabled()) {
-//            Lock lock = cache.lock(first);
-//
-//            lock.lock();
-//
-//            try {
-//                cache.clear();
-//
-//                assertEquals(vals.get(first), peek(cache, first));
-//            }
-//            finally {
-//                lock.unlock();
-//            }
-//        }
-//        else {
-//            cache.clear();
-//
-//            cache.put(first, vals.get(first));
-//        }
-//
-//        cache.clear();
-//
-//        assert cache.localSize() == 0 : "Values after clear.";
-//
-//        i = 0;
-//
-//        for (String key : keys) {
-//            cache.put(key, i);
-//
-//            vals.put(key, i);
-//
-//            i++;
-//        }
-//
-//        cache.put("key1", 1);
-//        cache.put("key2", 2);
-//
-//        cache.localEvict(Sets.union(ImmutableSet.of("key1", "key2"), keys));
-//
-//        assert cache.localSize(CachePeekMode.ONHEAP) == 0;
-//
-//        cache.clear();
-//
-//        cache.localPromote(ImmutableSet.of("key2", "key1"));
-//
-//        assert cache.localPeek("key1", CachePeekMode.ONHEAP) == null;
-//        assert cache.localPeek("key2", CachePeekMode.ONHEAP) == null;
-//    }
-//
-//    *
-//     * @throws Exception If failed.
-//
-//    public void testGlobalClearAll() throws Exception {
-//        globalClearAll(false);
-//    }
-//
-//    *
-//     * @throws Exception If failed.
-//
-//    public void testGlobalClearAllAsync() throws Exception {
-//        globalClearAll(true);
-//    }
-//
-//    *
-//     * @param async If {@code true} uses async method.
-//     * @throws Exception If failed.
-//
-//    protected void globalClearAll(boolean async) throws Exception {
-//        // Save entries only on their primary nodes. If we didn't do so, clearLocally()
will not remove all entries
-//        // because some of them were blocked due to having readers.
-//        for (int i = 0; i < gridCount(); i++) {
-//            for (String key : primaryKeysForCache(jcache(i), 3, 100_000))
-//                jcache(i).put(key, 1);
-//        }
-//
-//        if (async) {
-//            IgniteCache<String, Integer> asyncCache = jcache().withAsync();
-//
-//            asyncCache.clear();
-//
-//            asyncCache.future().get();
-//        }
-//        else
-//            jcache().clear();
-//
-//        for (int i = 0; i < gridCount(); i++)
-//            assert jcache(i).localSize() == 0;
-//    }
+    public void testClear() throws Exception {
+        IgniteCache<String, Integer> cache = jcache();
+
+        Set<String> keys = new HashSet<>(primaryKeysForCache(cache, 3));
+
+        for (String key : keys)
+            assertNull(cache.get(key));
+
+        Map<String, Integer> vals = new HashMap<>(keys.size());
+
+        int i = 0;
+
+        for (String key : keys) {
+            cache.put(key, i);
+
+            vals.put(key, i);
+
+            i++;
+        }
+
+        for (String key : keys)
+            assertEquals(vals.get(key), peek(cache, key));
+
+        cache.clear();
+
+        for (String key : keys)
+            assertNull(peek(cache, key));
+
+        for (i = 0; i < gridCount(); i++)
+            jcache(i).clear();
+
+        for (i = 0; i < gridCount(); i++)
+            assert jcache(i).localSize() == 0;
+
+        for (Map.Entry<String, Integer> entry : vals.entrySet())
+            cache.put(entry.getKey(), entry.getValue());
+
+        for (String key : keys)
+            assertEquals(vals.get(key), peek(cache, key));
+
+        String first = F.first(keys);
+
+        if (lockingEnabled()) {
+            Lock lock = cache.lock(first);
+
+            lock.lock();
+
+            try {
+                cache.clear();
+
+                assertEquals(vals.get(first), peek(cache, first));
+            }
+            finally {
+                lock.unlock();
+            }
+        }
+        else {
+            cache.clear();
+
+            cache.put(first, vals.get(first));
+        }
+
+        cache.clear();
+
+        assert cache.localSize() == 0 : "Values after clear.";
+
+        i = 0;
+
+        for (String key : keys) {
+            cache.put(key, i);
+
+            vals.put(key, i);
+
+            i++;
+        }
+
+        cache.put("key1", 1);
+        cache.put("key2", 2);
+
+        cache.localEvict(Sets.union(ImmutableSet.of("key1", "key2"), keys));
+
+        assert cache.localSize(CachePeekMode.ONHEAP) == 0;
+
+        cache.clear();
+
+        cache.localPromote(ImmutableSet.of("key2", "key1"));
+
+        assert cache.localPeek("key1", CachePeekMode.ONHEAP) == null;
+        assert cache.localPeek("key2", CachePeekMode.ONHEAP) == null;
+    }
+
+    public void testGlobalClearAll() throws Exception {
+        globalClearAll(false);
+    }
+
+    public void testGlobalClearAllAsync() throws Exception {
+        globalClearAll(true);
+    }
+
+    protected void globalClearAll(boolean async) throws Exception {
+        // Save entries only on their primary nodes. If we didn't do so, clearLocally() will
not remove all entries
+        // because some of them were blocked due to having readers.
+        for (int i = 0; i < gridCount(); i++) {
+            for (String key : primaryKeysForCache(jcache(i), 3, 100_000))
+                jcache(i).put(key, 1);
+        }
+
+        if (async) {
+            IgniteCache<String, Integer> asyncCache = jcache().withAsync();
+
+            asyncCache.clear();
+
+            asyncCache.future().get();
+        }
+        else
+            jcache().clear();
+
+        for (int i = 0; i < gridCount(); i++)
+            assert jcache(i).localSize() == 0;
+    }
 //
 //    *
 //     * @throws Exception In case of error.
@@ -3751,56 +3741,56 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 //     * @param keys Expected keys.
 //     * @throws Exception If failed.
 //
-//    protected void checkSize(Collection<String> keys) throws Exception {
-//        if (nearEnabled())
-//            assertEquals(keys.size(), jcache().localSize());
-//        else {
-//            for (int i = 0; i < gridCount(); i++) {
-//                GridCacheContext<String, Integer> ctx = context(i);
-//
-//                if (offheapTiered(ctx.cache()))
-//                    continue;
-//
-//                int size = 0;
-//
-//                for (String key : keys) {
-//                    if (ctx.affinity().localNode(key, ctx.discovery().topologyVersion()))
{
-//                        GridCacheEntryEx e =
-//                            ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
-//
-//                        assert e != null : "Entry is null [idx=" + i + ", key=" + key +
", ctx=" + ctx + ']';
-//                        assert !e.deleted() : "Entry is deleted: " + e;
-//
-//                        size++;
-//                    }
-//                }
-//
-//                assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize());
-//            }
-//        }
-//    }
-//
+    protected void checkSize(Collection<String> keys) throws Exception {
+        if (nearEnabled())
+            assertEquals(keys.size(), jcache().localSize());
+        else {
+            for (int i = 0; i < gridCount(); i++) {
+                GridCacheContext<String, Integer> ctx = context(i);
+
+                if (offheapTiered(ctx.cache()))
+                    continue;
+
+                int size = 0;
+
+                for (String key : keys) {
+                    if (ctx.affinity().localNode(key, ctx.discovery().topologyVersion()))
{
+                       GridCacheEntryEx e =
+                            ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
+
+                        assert e != null : "Entry is null [idx=" + i + ", key=" + key + ",
ctx=" + ctx + ']';
+                        assert !e.deleted() : "Entry is deleted: " + e;
+
+                        size++;
+                    }
+                }
+
+                assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize());
+            }
+        }
+    }
+
 //    *
 //     * @param keys Expected keys.
 //     * @throws Exception If failed.
 //
-//    protected void checkKeySize(Collection<String> keys) throws Exception {
-//        if (nearEnabled())
-//            assertEquals("Invalid key size: " + jcache().localSize(), keys.size(), jcache().localSize());
-//        else {
-//            for (int i = 0; i < gridCount(); i++) {
-//                GridCacheContext<String, Integer> ctx = context(i);
-//
-//                int size = 0;
-//
-//                for (String key : keys)
-//                    if (ctx.affinity().localNode(key, ctx.discovery().topologyVersion()))
-//                        size++;
-//
-//                assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize());
-//            }
-//        }
-//    }
+    protected void checkKeySize(Collection<String> keys) throws Exception {
+        if (nearEnabled())
+            assertEquals("Invalid key size: " + jcache().localSize(), keys.size(), jcache().localSize());
+        else {
+            for (int i = 0; i < gridCount(); i++) {
+                GridCacheContext<String, Integer> ctx = context(i);
+
+                int size = 0;
+
+                for (String key : keys)
+                    if (ctx.affinity().localNode(key, ctx.discovery().topologyVersion()))
+                        size++;
+
+                assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize());
+            }
+        }
+    }
 //
 //    *
 //     * @param exp Expected value.
@@ -3847,34 +3837,34 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 //     * @param key Key.
 //     * @return Cache.
 //
-//    protected IgniteCache<String, Integer> primaryCache(String key) {
-//        return primaryIgnite(key).jcache(null);
-//    }
+    protected IgniteCache<String, Integer> primaryCache(String key) {
+        return primaryIgnite(key).jcache(null);
+    }
 //
 //    *
 //     * @param cache Cache.
 //     * @param cnt Keys count.
 //     * @return Collection of keys for which given cache is primary.
 //
-//    protected List<String> primaryKeysForCache(IgniteCache<String, Integer>
cache, int cnt, int startFrom) {
-//        List<String> found = new ArrayList<>(cnt);
-//
-//        Ignite ignite = cache.unwrap(Ignite.class);
-//        CacheAffinity<Object> affinity = ignite.affinity(cache.getName());
-//
-//        for (int i = startFrom; i < startFrom + 100_000; i++) {
-//            String key = "key" + i;
-//
-//            if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
-//                found.add(key);
-//
-//                if (found.size() == cnt)
-//                    return found;
-//            }
-//        }
-//
-//        throw new IgniteException("Unable to find " + cnt + " keys as primary for cache.");
-//    }
+    protected List<String> primaryKeysForCache(IgniteCache<String, Integer> cache,
int cnt, int startFrom) {
+        List<String> found = new ArrayList<>(cnt);
+
+        Ignite ignite = cache.unwrap(Ignite.class);
+        CacheAffinity<Object> affinity = ignite.affinity(cache.getName());
+
+        for (int i = startFrom; i < startFrom + 100_000; i++) {
+            String key = "key" + i;
+
+            if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
+                found.add(key);
+
+                if (found.size() == cnt)
+                    return found;
+            }
+        }
+
+        throw new IgniteException("Unable to find " + cnt + " keys as primary for cache.");
+    }
 //
 //    *
 //     * @param cache Cache.
@@ -3882,10 +3872,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 //     * @return Collection of keys for which given cache is primary.
 //     * @throws IgniteCheckedException If failed.
 //
-//    protected List<String> primaryKeysForCache(IgniteCache<String, Integer>
cache, int cnt)
-//        throws IgniteCheckedException {
-//        return primaryKeysForCache(cache, cnt, 1);
-//    }
+    protected List<String> primaryKeysForCache(IgniteCache<String, Integer> cache,
int cnt)
+        throws IgniteCheckedException {
+        return primaryKeysForCache(cache, cnt, 1);
+    }
 //
 //    *
 //     * @throws Exception If failed.
@@ -4083,14 +4073,14 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 //     * @param cache Cache.
 //     * @throws Exception If failed.
 //
-//    protected void atomicClockModeDelay(IgniteCache cache) throws Exception {
-//        CacheConfiguration ccfg = (CacheConfiguration)cache.getConfiguration(CacheConfiguration.class);
-//
-//        if (ccfg.getCacheMode() != LOCAL &&
-//            ccfg.getAtomicityMode() == CacheAtomicityMode.ATOMIC &&
-//            ccfg.getAtomicWriteOrderMode() == CacheAtomicWriteOrderMode.CLOCK)
-//            U.sleep(100);
-//    }*/
+    protected void atomicClockModeDelay(IgniteCache cache) throws Exception {
+        CacheConfiguration ccfg = (CacheConfiguration)cache.getConfiguration(CacheConfiguration.class);
+
+        if (ccfg.getCacheMode() != LOCAL &&
+            ccfg.getAtomicityMode() == CacheAtomicityMode.ATOMIC &&
+            ccfg.getAtomicWriteOrderMode() == CacheAtomicWriteOrderMode.CLOCK)
+            U.sleep(100);
+    }
 
     /**
      * @throws Exception If failed.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9666a415/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
index cbbaeeb..1143e11 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
@@ -88,41 +88,41 @@ public class GridCacheAtomicFullApiSelfTest extends GridCachePartitionedFullApiS
         }, CacheException.class, "Locks are not supported");
     }
 
-    /**
-     * @throws Exception In case of error.
-     */
-    @Override public void testGetAll() throws Exception {
-        jcache().put("key1", 1);
-        jcache().put("key2", 2);
-
-        GridTestUtils.assertThrows(log, new Callable<Void>() {
-            @Override public Void call() throws Exception {
-                jcache().getAll(null).isEmpty();
-
-                return null;
-            }
-        }, NullPointerException.class, null);
-
-        assert jcache().getAll(Collections.<String>emptySet()).isEmpty();
-
-        Map<String, Integer> map1 = jcache().getAll(ImmutableSet.of("key1", "key2",
"key9999"));
-
-        info("Retrieved map1: " + map1);
-
-        assert 2 == map1.size() : "Invalid map: " + map1;
-
-        assertEquals(1, (int)map1.get("key1"));
-        assertEquals(2, (int)map1.get("key2"));
-        assertNull(map1.get("key9999"));
-
-        Map<String, Integer> map2 = jcache().getAll(ImmutableSet.of("key1", "key2",
"key9999"));
-
-        info("Retrieved map2: " + map2);
-
-        assert 2 == map2.size() : "Invalid map: " + map2;
-
-        assertEquals(1, (int)map2.get("key1"));
-        assertEquals(2, (int)map2.get("key2"));
-        assertNull(map2.get("key9999"));
-    }
+//    /**
+//     * @throws Exception In case of error.
+//     */
+//    @Override public void testGetAll() throws Exception {
+//        jcache().put("key1", 1);
+//        jcache().put("key2", 2);
+//
+//        GridTestUtils.assertThrows(log, new Callable<Void>() {
+//            @Override public Void call() throws Exception {
+//                jcache().getAll(null).isEmpty();
+//
+//                return null;
+//            }
+//        }, NullPointerException.class, null);
+//
+//        assert jcache().getAll(Collections.<String>emptySet()).isEmpty();
+//
+//        Map<String, Integer> map1 = jcache().getAll(ImmutableSet.of("key1", "key2",
"key9999"));
+//
+//        info("Retrieved map1: " + map1);
+//
+//        assert 2 == map1.size() : "Invalid map: " + map1;
+//
+//        assertEquals(1, (int)map1.get("key1"));
+//        assertEquals(2, (int)map1.get("key2"));
+//        assertNull(map1.get("key9999"));
+//
+//        Map<String, Integer> map2 = jcache().getAll(ImmutableSet.of("key1", "key2",
"key9999"));
+//
+//        info("Retrieved map2: " + map2);
+//
+//        assert 2 == map2.size() : "Invalid map: " + map2;
+//
+//        assertEquals(1, (int)map2.get("key1"));
+//        assertEquals(2, (int)map2.get("key2"));
+//        assertNull(map2.get("key9999"));
+//    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9666a415/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
index 505aed9..9a761fa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
@@ -141,9 +141,9 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends
GridCache
         for (String key : keys)
             assertEquals(null, nearCache.localPeek(key, CachePeekMode.ONHEAP));
 
-    }
+    }/*
 
-    /** {@inheritDoc} */
+    *//** {@inheritDoc} *//*
     @Override public void testEvictExpired() throws Exception {
         IgniteCache<String, Integer> cache = jcache();
 
@@ -183,7 +183,7 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends
GridCache
         assertEquals(null, cache.localPeek(key, CachePeekMode.ONHEAP));
     }
 
-    /** {@inheritDoc} */
+    *//** {@inheritDoc} *//*
     @Override public void testLocalEvict() throws Exception {
         IgniteCache<String, Integer> cache = jcache();
 
@@ -232,7 +232,7 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends
GridCache
         assert cache.localPeek(key3, CachePeekMode.ONHEAP) == null;
     }
 
-    /** {@inheritDoc} */
+    *//** {@inheritDoc} *//*
     @Override public void testPeekExpired() throws Exception {
         IgniteCache<String, Integer> c = jcache();
 
@@ -256,7 +256,7 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends
GridCache
         assert c.localSize() == 0 : "Cache is not empty.";
     }
 
-    /** {@inheritDoc} */
+    *//** {@inheritDoc} *//*
     @Override public void testUnswap() throws Exception {
         IgniteCache<String, Integer> cache = jcache();
 
@@ -374,5 +374,5 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends
GridCache
 
         assertEquals(cnt, swapEvts.get());
         assertEquals(cnt, unswapEvts.get());
-    }
+    }*/
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9666a415/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
index e6c4efa..08c8ee7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
@@ -113,8 +113,8 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
         for (String key : keys)
             assertEquals((Integer)i++, nearCache.localPeek(key, CachePeekMode.ONHEAP));
     }
-
-    /** {@inheritDoc} */
+/*
+    *//** {@inheritDoc} *//*
     @Override public void testEvictExpired() throws Exception {
         IgniteCache<String, Integer> cache = jcache();
 
@@ -150,5 +150,5 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
             if (aff.isPrimaryOrBackup(grid(i).cluster().localNode(), key))
                 assertEquals((Integer)1, peek(jcache(i), key));
         }
-    }
+    }*/
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9666a415/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
index 660b64b..d09b39b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
@@ -527,65 +527,65 @@ public class GridCacheNearOnlyMultiNodeFullApiSelfTest extends GridCachePartitio
         }
     }
 
-    /** {@inheritDoc} */
-    @SuppressWarnings("BusyWait")
-    @Override public void testLockUnlock() throws Exception {
-        if (lockingEnabled()) {
-            final CountDownLatch lockCnt = new CountDownLatch(1);
-            final CountDownLatch unlockCnt = new CountDownLatch(1);
-
-            grid(0).events().localListen(new IgnitePredicate<Event>() {
-                @Override public boolean apply(Event evt) {
-                    switch (evt.type()) {
-                        case EVT_CACHE_OBJECT_LOCKED:
-                            lockCnt.countDown();
-
-                            break;
-                        case EVT_CACHE_OBJECT_UNLOCKED:
-                            unlockCnt.countDown();
-
-                            break;
-                    }
-
-                    return true;
-                }
-            }, EVT_CACHE_OBJECT_LOCKED, EVT_CACHE_OBJECT_UNLOCKED);
-
-            IgniteCache<String, Integer> nearCache = jcache();
-            IgniteCache<String, Integer> cache = fullCache();
-
-            String key = primaryKeysForCache(cache, 1).get(0);
-
-            nearCache.put(key, 1);
-
-            assert !nearCache.isLocalLocked(key, false);
-            assert !cache.isLocalLocked(key, false);
-
-            Lock lock = nearCache.lock(key);
-
-            lock.lock();
-
-            try {
-                lockCnt.await();
-
-                assert nearCache.isLocalLocked(key, false);
-                assert cache.isLocalLocked(key, false);
-            }
-            finally {
-                lock.unlock();
-            }
-
-            unlockCnt.await();
-
-            for (int i = 0; i < 100; i++) {
-                if (cache.isLocalLocked(key, false))
-                    Thread.sleep(10);
-                else
-                    break;
-            }
-
-            assert !nearCache.isLocalLocked(key, false);
-            assert !cache.isLocalLocked(key, false);
-        }
-    }
+//    /** {@inheritDoc} */
+//    @SuppressWarnings("BusyWait")
+//    @Override public void testLockUnlock() throws Exception {
+//        if (lockingEnabled()) {
+//            final CountDownLatch lockCnt = new CountDownLatch(1);
+//            final CountDownLatch unlockCnt = new CountDownLatch(1);
+//
+//            grid(0).events().localListen(new IgnitePredicate<Event>() {
+//                @Override public boolean apply(Event evt) {
+//                    switch (evt.type()) {
+//                        case EVT_CACHE_OBJECT_LOCKED:
+//                            lockCnt.countDown();
+//
+//                            break;
+//                        case EVT_CACHE_OBJECT_UNLOCKED:
+//                            unlockCnt.countDown();
+//
+//                            break;
+//                    }
+//
+//                    return true;
+//                }
+//            }, EVT_CACHE_OBJECT_LOCKED, EVT_CACHE_OBJECT_UNLOCKED);
+//
+//            IgniteCache<String, Integer> nearCache = jcache();
+//            IgniteCache<String, Integer> cache = fullCache();
+//
+//            String key = primaryKeysForCache(cache, 1).get(0);
+//
+//            nearCache.put(key, 1);
+//
+//            assert !nearCache.isLocalLocked(key, false);
+//            assert !cache.isLocalLocked(key, false);
+//
+//            Lock lock = nearCache.lock(key);
+//
+//            lock.lock();
+//
+//            try {
+//                lockCnt.await();
+//
+//                assert nearCache.isLocalLocked(key, false);
+//                assert cache.isLocalLocked(key, false);
+//            }
+//            finally {
+//                lock.unlock();
+//            }
+//
+//            unlockCnt.await();
+//
+//            for (int i = 0; i < 100; i++) {
+//                if (cache.isLocalLocked(key, false))
+//                    Thread.sleep(10);
+//                else
+//                    break;
+//            }
+//
+//            assert !nearCache.isLocalLocked(key, false);
+//            assert !cache.isLocalLocked(key, false);
+//        }
+//    }
 }


Mime
View raw message