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-136 Added test eviction for local store.
Date Fri, 27 Feb 2015 14:57:00 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-136 3a466e8cb -> 2e115bf66


IGNITE-136 Added test eviction for local store.


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

Branch: refs/heads/ignite-136
Commit: 2e115bf663aef70f6141119adcbd11e2c7bbbaaa
Parents: 3a466e8
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Fri Feb 27 17:57:04 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Feb 27 17:57:04 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractLocalStoreSelfTest.java    | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e115bf6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index 781c6a6..c43b8f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.processors.cache.store.*;
 import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -35,6 +36,7 @@ import org.jetbrains.annotations.*;
 
 import javax.cache.*;
 import javax.cache.configuration.*;
+import javax.cache.expiry.*;
 import javax.cache.integration.*;
 import java.util.*;
 import java.util.concurrent.*;
@@ -170,6 +172,34 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     /**
      * @throws Exception If failed.
      */
+    public void testEvict() throws Exception {
+        Ignite ignite1 = startGrid(1);
+
+        IgniteCache<Object, Object> cache = ignite1.jcache(null).withExpiryPolicy(new
CreatedExpiryPolicy(
+            new Duration(TimeUnit.MILLISECONDS, 100L)));
+
+        // Putting entry.
+        for (int i = 0; i < KEYS; i++)
+            cache.put(i, i);
+
+        // Wait when entry 
+        U.sleep(200);
+
+        // Check that entry is evicted from cache, but local store does contain it.
+        for (int i = 0; i < KEYS; i++) {
+            cache.localEvict(Arrays.asList(i));
+
+            assertNull(cache.localPeek(i));
+
+            assertEquals(i, (int)LOCAL_STORE_1.load(i).get1());
+
+            assertEquals(i, cache.get(i));
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testPrimaryNode() throws Exception {
         Ignite ignite1 = startGrid(1);
 


Mime
View raw message