Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3EBC510E9A for ; Tue, 3 Mar 2015 21:38:49 +0000 (UTC) Received: (qmail 9981 invoked by uid 500); 3 Mar 2015 21:38:49 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 9936 invoked by uid 500); 3 Mar 2015 21:38:49 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 9927 invoked by uid 99); 3 Mar 2015 21:38:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 21:38:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 03 Mar 2015 21:38:24 +0000 Received: (qmail 9385 invoked by uid 99); 3 Mar 2015 21:38:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 21:38:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AF2F9E1021; Tue, 3 Mar 2015 21:38:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 03 Mar 2015 21:38:25 -0000 Message-Id: <4fed66412cf746ca9101f6d79bfc643f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [05/50] incubator-ignite git commit: IGNITE-136 Added test eviction for local store. X-Virus-Checked: Checked by ClamAV on apache.org 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-sql-tests Commit: 2e115bf663aef70f6141119adcbd11e2c7bbbaaa Parents: 3a466e8 Author: nikolay_tikhonov Authored: Fri Feb 27 17:57:04 2015 +0300 Committer: nikolay_tikhonov 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 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);