# IGNITE-56 Use IgniteCache in ignite-core module (6).
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d2382f46 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d2382f46 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d2382f46 Branch: refs/heads/ignite-111 Commit: d2382f46c23ecc8f6b6612a2dcef7eca4812a12d Parents: fbb22e1 Author: sevdokimov <[email protected]> Authored: Fri Feb 6 00:06:15 2015 +0300 Committer: sevdokimov <[email protected]> Committed: Fri Feb 6 00:06:15 2015 +0300 ---------------------------------------------------------------------- ...ractJdbcCacheStoreMultithreadedSelfTest.java | 2 +- .../cache/GridCacheAbstractFullApiSelfTest.java | 35 +++++++------------- ...tomicClientOnlyMultiNodeFullApiSelfTest.java | 2 +- 3 files changed, 14 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2382f46/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java index c263ceb..967c5f7 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java @@ -184,7 +184,7 @@ public abstract class AbstractJdbcCacheStoreMultithreadedSelfTest<T extends Jdbc map.put(new PersonKey(id), new Person(id, rnd.nextInt(), "Name" + id)); } - GridCache<Object, Object> cache = cache(); + IgniteCache<Object, Object> cache = jcache(); cache.putAll(map); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2382f46/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 fa9674a..179fb60 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 @@ -243,7 +243,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract * @throws Exception In case of error. */ public void testContainsKey() throws Exception { - cache().put("testContainsKey", 1); + jcache().put("testContainsKey", 1); checkContainsKey(true, "testContainsKey"); checkContainsKey(false, "testContainsKeyWrongKey"); @@ -308,21 +308,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract } /** - * @throws Exception In case of error. - */ - public void testForAll() throws Exception { - assert cache().forAll(F.<CacheEntry<String, Integer>>alwaysTrue()); - assert cache().isEmpty() || !cache().forAll(F.<CacheEntry<String, Integer>>alwaysFalse()); - - cache().put("key1", 100); - cache().put("key2", 101); - cache().put("key3", 200); - cache().put("key4", 201); - - assert cache().forAll(gte100); - } - - /** * @throws IgniteCheckedException If failed. */ public void testAtomicOps() throws IgniteCheckedException { @@ -2014,11 +1999,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract if (cacheMode() != LOCAL && cacheMode() != REPLICATED) { int cnt = 3; + IgniteCache<String, Integer> cache = jcache(); + for (int i = 0; i < cnt; i++) - cache().put(String.valueOf(i), i); + cache.put(String.valueOf(i), i); for (int i = 0; i < cnt; i++) - cache().remove(String.valueOf(i)); + cache.remove(String.valueOf(i)); for (int g = 0; g < gridCount(); g++) { for (int i = 0; i < cnt; i++) { @@ -2029,7 +2016,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract GridCacheEntryEx<String, Integer> entry = cctx.isNear() ? cctx.near().dht().peekEx(key) : cctx.cache().peekEx(key); - if (cache().affinity().mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode())) { + if (grid(0).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode())) { assertNotNull(entry); assertTrue(entry.deleted()); } @@ -2473,12 +2460,14 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract cache.localEvict(Sets.union(ImmutableSet.of("key1", "key2"), keys)); - assert cache().isEmpty(); + assert cache.size() == 0; + + cache.clear(); - cache().clear(); + cache.localPromote(ImmutableSet.of("key2", "key1")); - assert cache().promote("key1") == null; - assert cache().promote("key2") == null; + assert cache.localPeek("key1") == null; + assert cache.localPeek("key2") == null; } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2382f46/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 f3cef28..87b71c9 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 @@ -209,7 +209,7 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache } /** {@inheritDoc} */ - @Override public void testEvictAll() throws Exception { + @Override public void testLocalEvict() throws Exception { IgniteCache<String, Integer> cache = jcache(); List<String> keys = primaryKeysForCache(cache, 3);
