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 B944E18591 for ; Thu, 21 Jan 2016 07:32:49 +0000 (UTC) Received: (qmail 81502 invoked by uid 500); 21 Jan 2016 07:32:49 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 81357 invoked by uid 500); 21 Jan 2016 07:32:49 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 81089 invoked by uid 99); 21 Jan 2016 07:32:49 -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; Thu, 21 Jan 2016 07:32:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 529B9E00DC; Thu, 21 Jan 2016 07:32:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agoncharuk@apache.org To: commits@ignite.apache.org Date: Thu, 21 Jan 2016 07:32:58 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/19] ignite git commit: IGNITE-2414 .NET: TestWithExpiryPolicy is split into two parts: one is fine, another one is muted due to IGNITE-1423. IGNITE-2414 .NET: TestWithExpiryPolicy is split into two parts: one is fine, another one is muted due to IGNITE-1423. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5cea2330 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5cea2330 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5cea2330 Branch: refs/heads/sql-store Commit: 5cea23302f44ddd279df7a5e9ddd0a814b781ffb Parents: c1c2081 Author: Pavel Tupitsyn Authored: Wed Jan 20 13:48:41 2016 +0300 Committer: vozerov-gridgain Committed: Wed Jan 20 13:48:41 2016 +0300 ---------------------------------------------------------------------- .../Cache/CacheAbstractTest.cs | 70 ++++++++++++++------ 1 file changed, 48 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5cea2330/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs index 57e4949..0237a41 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs @@ -935,35 +935,66 @@ namespace Apache.Ignite.Core.Tests.Cache cache0.RemoveAll(new List { key0, key1 }); - // Test zero expiration. - cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero)); + // Test regular expiration. + cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(100), + TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100))); cache.Put(key0, key0); cache.Put(key1, key1); + Assert.IsTrue(cache0.ContainsKey(key0)); + Assert.IsTrue(cache0.ContainsKey(key1)); + Thread.Sleep(200); Assert.IsFalse(cache0.ContainsKey(key0)); Assert.IsFalse(cache0.ContainsKey(key1)); cache0.Put(key0, key0); cache0.Put(key1, key1); - Assert.IsTrue(cache0.ContainsKey(key0)); - Assert.IsTrue(cache0.ContainsKey(key1)); cache.Put(key0, key0 + 1); cache.Put(key1, key1 + 1); + Assert.IsTrue(cache0.ContainsKey(key0)); + Assert.IsTrue(cache0.ContainsKey(key1)); + Thread.Sleep(200); Assert.IsFalse(cache0.ContainsKey(key0)); Assert.IsFalse(cache0.ContainsKey(key1)); cache0.Put(key0, key0); cache0.Put(key1, key1); - cache.Get(key0); + cache.Get(key0); cache.Get(key1); + Assert.IsTrue(cache0.ContainsKey(key0)); + Assert.IsTrue(cache0.ContainsKey(key1)); + Thread.Sleep(200); Assert.IsFalse(cache0.ContainsKey(key0)); Assert.IsFalse(cache0.ContainsKey(key1)); + } + + /// + /// Expiry policy tests for zero and negative expiry values. + /// + [Test] + [Ignore("IGNITE-1423")] + public void TestWithExpiryPolicyZeroNegative() + { + ICache cache0 = Cache(0); + + int key0; + int key1; - cache0.RemoveAll(new List { key0, key1 }); + if (LocalCache()) + { + key0 = 0; + key1 = 1; + } + else + { + key0 = PrimaryKeyForCache(cache0); + key1 = PrimaryKeyForCache(Cache(1)); + } - // Test negative expiration. - cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(-100), - TimeSpan.FromMilliseconds(-100), TimeSpan.FromMilliseconds(-100))); + var cache = cache0.WithExpiryPolicy(new ExpiryPolicy(null, null, null)); + + // Test zero expiration. + cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero)); cache.Put(key0, key0); cache.Put(key1, key1); @@ -988,37 +1019,32 @@ namespace Apache.Ignite.Core.Tests.Cache cache0.RemoveAll(new List { key0, key1 }); - // Test regular expiration. - cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(100), - TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100))); + // Test negative expiration. + cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(-100), + TimeSpan.FromMilliseconds(-100), TimeSpan.FromMilliseconds(-100))); cache.Put(key0, key0); cache.Put(key1, key1); - Assert.IsTrue(cache0.ContainsKey(key0)); - Assert.IsTrue(cache0.ContainsKey(key1)); - Thread.Sleep(200); Assert.IsFalse(cache0.ContainsKey(key0)); Assert.IsFalse(cache0.ContainsKey(key1)); cache0.Put(key0, key0); cache0.Put(key1, key1); - cache.Put(key0, key0 + 1); - cache.Put(key1, key1 + 1); Assert.IsTrue(cache0.ContainsKey(key0)); Assert.IsTrue(cache0.ContainsKey(key1)); - Thread.Sleep(200); + cache.Put(key0, key0 + 1); + cache.Put(key1, key1 + 1); Assert.IsFalse(cache0.ContainsKey(key0)); Assert.IsFalse(cache0.ContainsKey(key1)); cache0.Put(key0, key0); cache0.Put(key1, key1); - cache.Get(key0); + cache.Get(key0); cache.Get(key1); - Assert.IsTrue(cache0.ContainsKey(key0)); - Assert.IsTrue(cache0.ContainsKey(key1)); - Thread.Sleep(200); Assert.IsFalse(cache0.ContainsKey(key0)); Assert.IsFalse(cache0.ContainsKey(key1)); + + cache0.RemoveAll(new List { key0, key1 }); } [Test]