# ignite-sprint-6 fixed test to work in offheap mode
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cc20ef6a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cc20ef6a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cc20ef6a Branch: refs/heads/ignite-843 Commit: cc20ef6adce9bdeea19d37f5817c0693e380cfa5 Parents: de53189 Author: sboikov <sboi...@gridgain.com> Authored: Thu Jun 18 10:30:20 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Thu Jun 18 10:30:20 2015 +0300 ---------------------------------------------------------------------- .../cache/GridCacheAbstractFullApiSelfTest.java | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc20ef6a/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 128d452..151c249 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 @@ -1020,25 +1020,27 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract throws Exception { IgniteCache<String, Integer> cache = jcache(); + final String key = primaryKeysForCache(cache, 1).get(0); + Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, READ_COMMITTED) : null; try { if (startVal) - cache.put("key", 2); + cache.put(key, 2); else - assertEquals(null, cache.get("key")); + assertEquals(null, cache.get(key)); - Integer expectedRes = startVal ? 2 : null; + Integer expRes = startVal ? 2 : null; - assertEquals(String.valueOf(expectedRes), cache.invoke("key", INCR_PROCESSOR)); + assertEquals(String.valueOf(expRes), cache.invoke(key, INCR_PROCESSOR)); - expectedRes = startVal ? 3 : 1; + expRes = startVal ? 3 : 1; - assertEquals(String.valueOf(expectedRes), cache.invoke("key", INCR_PROCESSOR)); + assertEquals(String.valueOf(expRes), cache.invoke(key, INCR_PROCESSOR)); - expectedRes++; + expRes++; - assertEquals(String.valueOf(expectedRes), cache.invoke("key", INCR_PROCESSOR)); + assertEquals(String.valueOf(expRes), cache.invoke(key, INCR_PROCESSOR)); if (tx != null) tx.commit(); @@ -1050,11 +1052,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract Integer exp = (startVal ? 2 : 0) + 3; - assertEquals(exp, cache.get("key")); + assertEquals(exp, cache.get(key)); for (int i = 0; i < gridCount(); i++) { - if (ignite(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), "key")) - assertEquals(exp, peek(jcache(i), "key")); + if (ignite(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key)) + assertEquals(exp, peek(jcache(i), key)); } }