Repository: incubator-ignite Updated Branches: refs/heads/ignite-565 14ed9ec80 -> c98332519
#ignite-565: remove GridCache from tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c9833251 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c9833251 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c9833251 Branch: refs/heads/ignite-565 Commit: c983325195f0022205b8d0956c84057de3d8b8b0 Parents: 14ed9ec Author: ivasilinets <ivasilin...@gridgain.com> Authored: Wed Mar 25 13:36:04 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Wed Mar 25 13:36:04 2015 +0300 ---------------------------------------------------------------------- .../processors/igfs/IgfsProcessorSelfTest.java | 18 +++++++++--------- .../cache/GridCacheOffHeapAndSwapSelfTest.java | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9833251/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java index 639271b..ddb662c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java @@ -63,7 +63,7 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest { protected IgniteFileSystem igfs; /** Meta cache. */ - private IgniteCache<Object, Object> metaCache; + private GridCache<Object, Object> metaCache; /** Meta cache name. */ private String metaCacheName; @@ -80,7 +80,7 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest { metaCacheName = cfgs[0].getMetaCacheName(); - metaCache = grid.cache(metaCacheName); + metaCache = grid.cachex(metaCacheName); } /** {@inheritDoc} */ @@ -337,8 +337,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest { // Create directories. igfs.mkdirs(path("/A/B1/C1")); - for (Cache.Entry<Object, Object> e : metaCache.localEntries()) - info("Entry in cache [key=" + e.getKey() + ", val=" + e.getValue() + ']'); + for (Object key : metaCache.keySet()) + info("Entry in cache [key=" + key + ", val=" + metaCache.get(key) + ']'); igfs.mkdirs(path("/A/B1/C2")); igfs.mkdirs(path("/A/B1/C3")); @@ -351,8 +351,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest { igfs.mkdirs(path("/A2/B2/C1")); igfs.mkdirs(path("/A2/B2/C2")); - for (Cache.Entry<Object, Object> e : metaCache.localEntries()) - info("Entry in cache [key=" + e.getKey() + ", val=" + e.getValue() + ']'); + for (Object key : metaCache.keySet()) + info("Entry in cache [key=" + key + ", val=" + metaCache.get(key) + ']'); // Check existence. assert igfs.exists(path("/A/B1/C1")); @@ -471,8 +471,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest { // Create directories. igfs.mkdirs(path("/A/B1/C1")); - for (Cache.Entry<Object, Object> e : metaCache.localEntries()) - info("Entry in cache [key=" + e.getKey() + ", val=" + metaCache.get(e.getValue()) + ']'); + for (Object key : metaCache.keySet()) + info("Entry in cache [key=" + key + ", val=" + metaCache.get(key) + ']'); // Move under itself. GridTestUtils.assertThrowsInherited(log, new Callable<Object>() { @@ -683,7 +683,7 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest { IgniteUuid fileId = U.field(igfs.info(path), "fileId"); - IgniteCache<IgniteUuid, IgfsFileInfo> metaCache = grid(0).cache(META_CACHE_NAME); + GridCache<IgniteUuid, IgfsFileInfo> metaCache = grid(0).cachex(META_CACHE_NAME); IgniteCache<IgfsBlockKey, byte[]> dataCache = grid(0).cache(DATA_CACHE_NAME); IgfsFileInfo info = metaCache.get(fileId); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9833251/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java index 0cfd0d6..fc18054 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java @@ -225,11 +225,11 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest { for (long i = 0; i < ENTRY_CNT; i++) { cache.localEvict(Collections.singleton(i)); - assertEquals(ENTRY_CNT - i - 1, cache.size()); + assertEquals(ENTRY_CNT - i - 1, cache.localSize(CachePeekMode.ONHEAP)); } // Ensure that part of entries located in off-heap memory and part is swapped. - assertEquals(0, cache.size()); + assertEquals(0, cache.localSize(CachePeekMode.ONHEAP)); assertTrue(cache.localSize(CachePeekMode.OFFHEAP) > 0); assertTrue(cache.localSize(CachePeekMode.OFFHEAP) < ENTRY_CNT); @@ -238,7 +238,7 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest { to = (ENTRY_CNT + cache.localSize(CachePeekMode.OFFHEAP)) / 2; for (long i = 0; i < ENTRY_CNT; i++) - assertNull(cache.localPeek(i)); + assertNull(cache.localPeek(i, CachePeekMode.ONHEAP)); assertEquals(ENTRY_CNT, offheapedCnt.get()); assertEquals(0, onheapedCnt.get()); @@ -247,7 +247,7 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest { resetCounters(); - return cache; + return grid(0).cache(null); } /** @@ -479,7 +479,7 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest { IgniteCache<Long, Long> cache = populate(); for (long i = from; i < to; i++) { - assertNull(cache.localPeek(i)); + assertNull(cache.localPeek(i, CachePeekMode.ONHEAP)); Long val = cache.localPeek(i, CachePeekMode.SWAP);