You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/01/20 11:51:11 UTC
ignite git commit: IGNITE-2414 .NET: TestWithExpiryPolicy is split
into two parts: one is fine, another one is muted due to IGNITE-1423.
Repository: ignite
Updated Branches:
refs/heads/ignite-1.5.4 612bcb6b4 -> 5ba47a034
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/5ba47a03
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5ba47a03
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5ba47a03
Branch: refs/heads/ignite-1.5.4
Commit: 5ba47a03411f507d9db661f83b8fe487b77bec1a
Parents: 612bcb6
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Wed Jan 20 13:48:41 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jan 20 13:50:51 2016 +0300
----------------------------------------------------------------------
.../Cache/CacheAbstractTest.cs | 70 ++++++++++++++------
1 file changed, 48 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5ba47a03/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 ce15739..781e612 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<int> { 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));
+ }
+
+ /// <summary>
+ /// Expiry policy tests for zero and negative expiry values.
+ /// </summary>
+ [Test]
+ [Ignore("IGNITE-1423")]
+ public void TestWithExpiryPolicyZeroNegative()
+ {
+ ICache<int, int> cache0 = Cache(0);
+
+ int key0;
+ int key1;
- cache0.RemoveAll(new List<int> { 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<int> { 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<int> { key0, key1 });
}
[Test]