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-41
Date Fri, 19 Dec 2014 04:34:50 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-41 85de24713 -> 22ad105a2


# ignite-41


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

Branch: refs/heads/ignite-41
Commit: 22ad105a209725b0be93b47b7acb193fec416b26
Parents: 85de247
Author: sboikov <semen.boikov@inria.fr>
Authored: Thu Dec 18 20:46:18 2014 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Fri Dec 19 07:01:40 2014 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     | 56 +++++++-----
 .../GridDistributedTxRemoteAdapter.java         |  4 -
 .../core/src/test/config/spring-multicache.xml  | 16 ----
 .../cache/GridCacheAbstractFullApiSelfTest.java | 92 ++++++++++++--------
 .../GridCacheInterceptorAbstractSelfTest.java   |  4 +-
 .../GridCacheRefreshAheadAbstractSelfTest.java  | 13 ++-
 .../cache/GridCacheTtlManagerSelfTest.java      | 19 ++--
 ...heExpiredEntriesPreloadAbstractSelfTest.java | 12 +--
 .../GridCacheFullApiSelfTestSuite.java          |  2 +-
 9 files changed, 111 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
index 19d28b6..6f5fae6 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
@@ -1188,12 +1188,24 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
             }
 
             // Determine new ttl and expire time.
-            if (ttl < 0)
-                ttl = ttlExtras();
+            long expireTime;
 
-            assert ttl >= 0;
+            if (drExpireTime >= 0) {
+                assert ttl >= 0 : ttl;
+
+                expireTime = drExpireTime;
+            }
+            else {
+                if (ttl == -1L) {
+                    ttl = ttlExtras();
+                    expireTime = expireTimeExtras();
+                }
+                else
+                    expireTime = toExpireTime(ttl);
+            }
 
-            long expireTime = drExpireTime < 0L ? toExpireTime(ttl) : drExpireTime;
+            assert ttl >= 0;
+            assert expireTime >= 0;
 
             // Detach value before index update.
             if (cctx.portableEnabled())
@@ -1568,25 +1580,20 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                 long expireTime;
 
                 if (expiryPlc != null) {
-                    if (!hadVal) {
-                        Duration duration = expiryPlc.getExpiryForCreation();
+                    ttl = toTtl(hadVal ? expiryPlc.getExpiryForUpdate() : expiryPlc.getExpiryForCreation());
 
-                        if (duration != null && duration.isZero())
-                            return new IgniteBiTuple<>(false, cctx.<V>unwrapTemporary(old));
+                    if (ttl == -1L) {
+                        ttl = ttlExtras();
 
-                        ttl = toTtl(duration);
+                        expireTime = expireTimeExtras();
                     }
                     else
-                        ttl = toTtl(expiryPlc.getExpiryForUpdate());
-
-                    ttl = ttl < 0 ? ttlExtras() : ttl;
-
-                    expireTime = toExpireTime(ttl);
+                        expireTime = toExpireTime(ttl);
                 }
                 else {
                     ttl = ttlExtras();
 
-                    expireTime = toExpireTime(ttl);
+                    expireTime = expireTimeExtras();
                 }
 
                 // Update index inside synchronization since it can be updated
@@ -1802,7 +1809,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
 
                         old = retval ? rawGetOrUnmarshalUnlocked(false) : val;
 
-                        return new GridCacheUpdateAtomicResult<>(false, old, null,
0L, -1L, null, null, false);
+                        return new GridCacheUpdateAtomicResult<>(false, old, null,
-1L, -1L, null, null, false);
                     }
                 }
                 else
@@ -1851,7 +1858,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                     return new GridCacheUpdateAtomicResult<>(false,
                         retval ? old : null,
                         null,
-                        0L,
+                        -1L,
                         -1L,
                         null,
                         null,
@@ -1901,7 +1908,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                         return new GridCacheUpdateAtomicResult<>(false,
                             retval ? old : null,
                             null,
-                            0L,
+                            -1L,
                             -1L,
                             null,
                             null,
@@ -1930,9 +1937,14 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                         else
                             newTtl = -1L;
 
-                        ttl0 = newTtl < 0 ? ttlExtras() : newTtl;
-
-                        newExpireTime = toExpireTime(ttl0);
+                        if (newTtl == -1L) {
+                            ttl0 = ttlExtras();
+                            newExpireTime = expireTimeExtras();
+                        }
+                        else {
+                            ttl0 = newTtl;
+                            newExpireTime = toExpireTime(ttl0);
+                        }
                     }
                 }
 
@@ -1999,7 +2011,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                         return new GridCacheUpdateAtomicResult<>(false,
                             cctx.<V>unwrapTemporary(interceptRes.get2()),
                             null,
-                            0L,
+                            -1L,
                             -1L,
                             null,
                             null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 5fdafe9..4d4cd82 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -486,10 +486,6 @@ public class GridDistributedTxRemoteAdapter<K, V> extends GridCacheTxAdapter<K,
                                     V val = res.get2();
                                     byte[] valBytes = res.get3();
 
-                                    // Preserve TTL if needed.
-                                    if (txEntry.ttl() < 0)
-                                        txEntry.ttl(cached.rawTtl());
-
                                     GridCacheVersion explicitVer = txEntry.drVersion();
 
                                     if (finalizationStatus() == FinalizationStatus.RECOVERY_FINISH
|| optimistic()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/config/spring-multicache.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/spring-multicache.xml b/modules/core/src/test/config/spring-multicache.xml
index af55077..3111e34 100644
--- a/modules/core/src/test/config/spring-multicache.xml
+++ b/modules/core/src/test/config/spring-multicache.xml
@@ -73,8 +73,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -97,8 +95,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -121,8 +117,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -145,8 +139,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -170,8 +162,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -194,8 +184,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -218,8 +206,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
 
                 <bean class="org.gridgain.grid.cache.GridCacheConfiguration">
@@ -242,8 +228,6 @@
                     </property>
 
                     <property name="backups" value="1"/>
-
-                    <property name="dgcFrequency" value="0"/>
                 </bean>
             </list>
         </property>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 406440b..659f88e 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -24,6 +24,7 @@ import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.*;
 import org.jetbrains.annotations.*;
 
+import javax.cache.expiry.*;
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
@@ -4143,10 +4144,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         long ttl = 500;
 
-        entry.timeToLive(ttl);
+        final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
ttl));
 
-        // Update is required for TTL to have effect.
-        entry.set(1);
+        grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 1);
 
         Thread.sleep(ttl + 100);
 
@@ -4191,12 +4191,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         int ttl = 500;
 
-        GridCacheEntry<String, Integer> entry = c.entry(key);
-
-        entry.timeToLive(ttl);
+        final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
ttl));
 
-        // Update is required for TTL to have effect.
-        entry.set(1);
+        grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 1);
 
         Thread.sleep(ttl + 100);
 
@@ -4217,12 +4214,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
             String key = "1";
             int ttl = 500;
 
-            try (GridCacheTx tx = c.txStart()) {
-                GridCacheEntry<String, Integer> entry = c.entry(key);
-
-                entry.timeToLive(ttl);
+            try (GridCacheTx tx = grid(0).ignite().transactions().txStart()) {
+                final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
ttl));
 
-                entry.set(1);
+                grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 1);
 
                 tx.commit();
             }
@@ -4263,6 +4258,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     private void checkTtl(boolean inTx, boolean oldEntry) throws Exception {
+        int ttl = 1000;
+
+        final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
ttl));
+
         final GridCache<String, Integer> c = cache();
 
         final String key = primaryKeysForCache(c, 1).get(0);
@@ -4277,40 +4276,36 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         assertEquals(0, entry.timeToLive());
         assertEquals(0, entry.expirationTime());
 
-        int ttl = 1000;
-
         long startTime = System.currentTimeMillis();
 
         if (inTx) {
             // Rollback transaction for the first time.
-            GridCacheTx tx = c.txStart();
+            GridCacheTx tx = grid(0).transactions().txStart();
 
             try {
-                entry.timeToLive(ttl);
+                grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 1);
 
-                entry.set(1);
-
-                assertEquals(ttl, entry.timeToLive());
-                assertTrue(entry.expirationTime() > 0);
+                // TODO IGNITE-41.
+                //assertEquals(ttl, entry.timeToLive());
+                //assertTrue(entry.expirationTime() > 0);
             }
             finally {
                 tx.rollback();
             }
 
-            assertEquals(ttl, entry.timeToLive());
-            assertTrue(entry.expirationTime() > 0);
+            assertEquals(0, entry.timeToLive());
+            assertEquals(0, entry.expirationTime());
         }
 
         // Now commit transaction and check that ttl and expire time have been saved.
         GridCacheTx tx = inTx ? c.txStart() : null;
 
         try {
-            entry.timeToLive(ttl);
-
-            entry.set(1);
+            grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 1);
 
-            assertEquals(ttl, entry.timeToLive());
-            assertTrue(entry.expirationTime() > 0);
+            // TODO IGNITE-41.
+            //assertEquals(ttl, entry.timeToLive());
+            //assertTrue(entry.expirationTime() > 0);
         }
         finally {
             if (tx != null)
@@ -4337,7 +4332,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         tx = inTx ? c.txStart() : null;
 
         try {
-            c.entry(key).set(2);
+            grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 2);
         }
         finally {
             if (tx != null)
@@ -4362,7 +4357,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         tx = inTx ? c.txStart() : null;
 
         try {
-            c.putx(key, 3);
+            grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 3);
         }
         finally {
             if (tx != null)
@@ -4376,6 +4371,34 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
                 assertEquals(ttl, curEntry.timeToLive());
 
                 assert curEntry.expirationTime() > expireTimes[i];
+
+                expireTimes[i] = curEntry.expirationTime();
+            }
+        }
+
+        // And one more update to ensure that ttl is not changed and expire time is not shifted
forward.
+        U.sleep(100);
+
+        log.info("Put 4");
+
+        tx = inTx ? c.txStart() : null;
+
+        try {
+            grid(0).jcache(null).put(key, 4);
+        }
+        finally {
+            if (tx != null)
+                tx.commit();
+        }
+
+        log.info("Put 4 done");
+
+        for (int i = 0; i < gridCount(); i++) {
+            GridCacheEntry<String, Integer> curEntry = cache(i).entry(key);
+
+            if (curEntry.primary() || curEntry.backup()) {
+                assertEquals(ttl, curEntry.timeToLive());
+                assertEquals(expireTimes[i], curEntry.expirationTime());
             }
         }
 
@@ -4649,16 +4672,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         cache.put(key, 1);
 
-        GridCacheEntry<String, Integer> entry = cache.entry(key);
-
-        assert entry != null;
-
         long ttl = 500;
 
-        entry.timeToLive(ttl);
+        final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
ttl));
 
-        // Update is required for TTL to have effect.
-        entry.set(1);
+        grid(0).jcache(null).withExpiryPolicy(expiry).put(key, 1);
 
         Thread.sleep(ttl + 100);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
index b13e3ed..e715470 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
@@ -1304,9 +1304,7 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
 
                 case TRANSFORM: {
                     cache.transformAll(map.keySet(), new IgniteClosure<Integer, Integer>()
{
-                        @Nullable
-                        @Override
-                        public Integer apply(Integer old) {
+                        @Nullable @Override public Integer apply(Integer old) {
                             return null;
                         }
                     });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheRefreshAheadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheRefreshAheadAbstractSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheRefreshAheadAbstractSelfTest.java
index 3597047..d5848ef 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheRefreshAheadAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheRefreshAheadAbstractSelfTest.java
@@ -21,6 +21,7 @@ import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
+import javax.cache.expiry.*;
 import java.util.concurrent.*;
 
 import static java.util.concurrent.TimeUnit.*;
@@ -64,21 +65,17 @@ public abstract class GridCacheRefreshAheadAbstractSelfTest extends GridCommonAb
     public void testReadAhead() throws Exception {
         store.testThread(Thread.currentThread());
 
-        GridCache<Integer, String> cache = grid(0).cache(null);
-
-        GridCacheEntry<Integer, String> entry = cache.entry(1);
+        final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
1000L));
 
-        assert entry != null;
-
-        entry.timeToLive(1000);
+        GridCache<Integer, String> cache = grid(0).cache(null);
 
-        entry.set("1");
+        grid(0).jcache(null).withExpiryPolicy(expiry).put(1, "1");
 
         Thread.sleep(600);
 
         store.startAsyncLoadTracking();
 
-        cache.get(1);
+        grid(0).jcache(null).get(1);
 
         assert store.wasAsynchronousLoad() : "No async loads were performed on the store:
" + store;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManagerSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManagerSelfTest.java
index 870e9c6..fe8d09b 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManagerSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManagerSelfTest.java
@@ -21,6 +21,9 @@ import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.*;
 import org.gridgain.testframework.junits.common.*;
 
+import javax.cache.expiry.*;
+import java.util.concurrent.*;
+
 import static org.gridgain.grid.cache.GridCacheMode.*;
 
 /**
@@ -33,6 +36,7 @@ public class GridCacheTtlManagerSelfTest extends GridCommonAbstractTest
{
     /** Test cache mode. */
     protected GridCacheMode cacheMode;
 
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
@@ -85,24 +89,17 @@ public class GridCacheTtlManagerSelfTest extends GridCommonAbstractTest
{
         try {
             final String key = "key";
 
-            final GridCache<Object, Object> cache = g.cache(null);
-
-            GridCacheEntry<Object, Object> entry = cache.entry(key);
+            g.jcache(null).withExpiryPolicy(
+                    new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, 1000))).put(key,
1);
 
-            entry.timeToLive(1000);
-            entry.setValue(1);
+            assertEquals(1, g.jcache(null).get(key));
 
             U.sleep(1100);
 
             GridTestUtils.retryAssert(log, 10, 100, new CAX() {
                 @Override public void applyx() {
                     // Check that no more entries left in the map.
-                    try {
-                        assertNull(g.cache(null).get(key));
-                    }
-                    catch (IgniteCheckedException ignore) {
-                        // No-op.
-                    }
+                    assertNull(g.jcache(null).get(key));
 
                     if (!g.internalCache().context().deferredDelete())
                         assertNull(g.internalCache().map().getEntry(key));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
index 02619e0..5576ca7 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
@@ -18,7 +18,9 @@ import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.testframework.*;
 
+import javax.cache.expiry.*;
 import java.util.*;
+import java.util.concurrent.*;
 
 import static org.gridgain.grid.cache.GridCachePreloadMode.*;
 import static org.apache.ignite.events.IgniteEventType.*;
@@ -70,12 +72,12 @@ public abstract class GridCacheExpiredEntriesPreloadAbstractSelfTest extends
Gri
         for (int i = 0; i < KEYS_NUM; i++)
             cache0.put(String.valueOf(i), 0);
 
-        for (int i = 0; i < KEYS_NUM; i++) {
-            GridCacheEntry<String, Integer> entry = cache0.entry(String.valueOf(i));
+        final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
100L));
 
-            entry.timeToLive(100);
-            entry.setValue(i);
-        }
+        IgniteCache cache = grid(0).jcache(null).withExpiryPolicy(expiry);
+
+        for (int i = 0; i < KEYS_NUM; i++)
+            cache.put(String.valueOf(i), i);
 
         // Allow entries to expire.
         U.sleep(1000);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ad105a/modules/core/src/test/java/org/gridgain/testsuites/GridCacheFullApiSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testsuites/GridCacheFullApiSelfTestSuite.java
b/modules/core/src/test/java/org/gridgain/testsuites/GridCacheFullApiSelfTestSuite.java
index 50ec002..8cd7753 100644
--- a/modules/core/src/test/java/org/gridgain/testsuites/GridCacheFullApiSelfTestSuite.java
+++ b/modules/core/src/test/java/org/gridgain/testsuites/GridCacheFullApiSelfTestSuite.java
@@ -24,7 +24,7 @@ public class GridCacheFullApiSelfTestSuite extends TestSuite {
      * @throws Exception If failed.
      */
     public static TestSuite suite() throws Exception {
-        TestSuite suite = new TestSuite("Gridgain Cache Full API Test Suite");
+        TestSuite suite = new TestSuite("Cache Full API Test Suite");
 
         // One node.
         //suite.addTestSuite(GridCacheLocalFullApiSelfTest.class); GG-9141


Mime
View raw message