ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: Fix AfterTest to use enumerator.
Date Fri, 27 Nov 2015 08:48:48 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1956 00eb4d85c -> 82d5ccc9a


Fix AfterTest to use enumerator.


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

Branch: refs/heads/ignite-1956
Commit: 82d5ccc9aa557bf835fde6f14a42bd81a3dbf2b1
Parents: 00eb4d8
Author: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Authored: Fri Nov 27 11:48:37 2015 +0300
Committer: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Committed: Fri Nov 27 11:48:37 2015 +0300

----------------------------------------------------------------------
 .../Cache/CacheAbstractTest.cs                       | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/82d5ccc9/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 64124d7..11bf8f1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
@@ -347,17 +347,14 @@ namespace Apache.Ignite.Core.Tests.Cache
             for (int i = 0; i < GridCount(); i++)
             {
                 var cache = Cache(i);
+                var entries = cache.Select(pair => pair.ToString() + GetKeyAffinity(cache,
pair.Key)).ToArray();
 
-                if (!cache.IsEmpty())
-                {
-                    var entries = Enumerable.Range(0, 2000)
-                        .Select(x => new KeyValuePair<int, int>(x, cache.LocalPeek(x)))
-                        .Where(x => x.Value != 0)
-                        .Select(pair => pair.ToString() + GetKeyAffinity(cache, pair.Key))
-                        .Aggregate((acc, val) => string.Format("{0}, {1}", acc, val));
+                if (entries.Any())
+                    Assert.Fail("Cache '{0}' is not empty in grid [{1}]: ({2})", CacheName(),
i,
+                        entries.Aggregate((acc, val) => string.Format("{0}, {1}", acc,
val)));
 
-                    Assert.Fail("Cache '{0}' is not empty in grid [{1}]: ({2})", CacheName(),
i, entries);
-                }
+                var size = cache.GetSize();
+                Assert.AreEqual(0, size, "Cache enumerator returned no entries, but cache
size is " + size);
             }
 
             Console.WriteLine("Test finished: " + TestContext.CurrentContext.Test.Name);


Mime
View raw message