ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [09/19] ignite git commit: Merge branch ignite-1.6.5 into ignite-1.8.5-p1
Date Tue, 18 Apr 2017 10:00:58 GMT
Merge branch ignite-1.6.5 into ignite-1.8.5-p1


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

Branch: refs/heads/master
Commit: 3be4e00373ec5a2b49788d70eb0aebccc3cb6ccf
Parents: ae435fb cf9f0a7
Author: Alexander Fedotov <alexander.fedotoff@gmail.com>
Authored: Fri Apr 7 14:59:00 2017 +0300
Committer: Alexander Fedotov <alexander.fedotoff@gmail.com>
Committed: Fri Apr 7 15:02:32 2017 +0300

----------------------------------------------------------------------
 .../IgniteCacheExpiryPolicyAbstractTest.java    | 39 ++++++++++++++++++++
 1 file changed, 39 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3be4e003/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
index b234631,9739350..3339f65
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
@@@ -1018,45 -1009,43 +1019,83 @@@ public abstract class IgniteCacheExpiry
      }
  
      /**
 +     * Put entry to server node and check how its expires in client NearCache.
 +     *
 +     * @throws Exception If failed.
 +     */
 +    public void testNearExpiresOnClient() throws Exception {
 +        if(cacheMode() != PARTITIONED)
 +            return;
 +
 +        factory =  CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS,1));
 +
 +        nearCache = true;
 +
 +        startGrids();
 +
 +        IgniteConfiguration clientCfg = getConfiguration("client").setClientMode(true);
 +
 +        ((TcpDiscoverySpi)clientCfg.getDiscoverySpi()).setForceServerMode(false);
 +
 +        Ignite client = startGrid("client", clientCfg);
 +
 +        IgniteCache<Object, Object> cache = client.cache(null);
 +
 +        Integer key = 1;
 +
 +        // Put on server node.
 +        jcache(0).put(key, 1);
 +
 +        // Make entry cached in client NearCache.
 +        assertEquals(1, cache.get(key));
 +
 +        assertEquals(1, cache.localPeek(key, CachePeekMode.NEAR));
 +
 +        waitExpired(key);
 +
 +        // Check client NearCache.
 +        assertNull(cache.localPeek(key, CachePeekMode.NEAR));
 +    }
 +
 +    /**
+      * @throws Exception If failed.
+      */
+     public void testNearExpiresWithCacheStore() throws Exception {
+         factory = CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, 1));
+ 
+         nearCache = true;
+ 
+         startGridsMultiThreaded(gridCount());
+ 
+         IgniteConfiguration clientCfg = getConfiguration("client").setClientMode(true);
+ 
+         ((TcpDiscoverySpi)clientCfg.getDiscoverySpi()).setForceServerMode(false);
+ 
+         Ignite client = startGrid("client", clientCfg);
+ 
+         CacheConfiguration ccfg = cacheConfiguration("testCache");
+ 
+         ccfg.setCacheStoreFactory(FactoryBuilder.factoryOf(GridCacheTestStore.class));
+ //        ccfg.setExpiryPolicyFactory( CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS,
1)));
+ 
+         IgniteCache<Object, Object> cache = client.getOrCreateCache(ccfg);
+ 
+         Integer key = 1;
+ 
+         cache.put(key, 1);
+ 
+         assertEquals(1, cache.localPeek(key, CachePeekMode.NEAR));
+         assertEquals(1, cache.get(key));
+ 
+         waitExpired(key);
+ 
+         for(int i = 0; i < gridCount(); i++)
+             assertNull(jcache(i).localPeek(key, CachePeekMode.BACKUP, CachePeekMode.PRIMARY));
+ 
+         assertEquals(null, cache.get(key));
+     }
++
+     /**
       * @return Test keys.
       * @throws Exception If failed.
       */


Mime
View raw message