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 6261618D98 for ; Tue, 24 Nov 2015 09:22:02 +0000 (UTC) Received: (qmail 78769 invoked by uid 500); 24 Nov 2015 09:22:02 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 78641 invoked by uid 500); 24 Nov 2015 09:22:01 -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 77615 invoked by uid 99); 24 Nov 2015 09:22:00 -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, 24 Nov 2015 09:22:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5E65CE0BC6; Tue, 24 Nov 2015 09:22:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Tue, 24 Nov 2015 09:22:41 -0000 Message-Id: <71428d6a4a5441b0a8ef5be95f797c49@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [43/50] [abbrv] ignite git commit: IGNITE-1983: .NET: Fixed continuous query tests. IGNITE-1983: .NET: Fixed continuous query tests. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/512fe6b0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/512fe6b0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/512fe6b0 Branch: refs/heads/ignite-1924 Commit: 512fe6b076331a3d187e1e0277f6bd565d8350bf Parents: dcbfbd2 Author: vozerov-gridgain Authored: Tue Nov 24 11:52:06 2015 +0300 Committer: vozerov-gridgain Committed: Tue Nov 24 11:52:06 2015 +0300 ---------------------------------------------------------------------- .../Continuous/ContinuousQueryAbstractTest.cs | 29 ++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/512fe6b0/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs index 720483a..bdca918 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs @@ -308,7 +308,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous // Put from local node. int key1 = PrimaryKey(cache1); cache1.GetAndPut(key1, Entry(key1)); - CheckFilterSingle(key1, null, Entry(key1), !loc); + CheckFilterSingle(key1, null, Entry(key1)); CheckCallbackSingle(key1, null, Entry(key1)); // Put from remote node. @@ -322,7 +322,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous } else { - CheckFilterSingle(key2, null, Entry(key2), true); + CheckFilterSingle(key2, null, Entry(key2)); CheckCallbackSingle(key2, null, Entry(key2)); } @@ -330,7 +330,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous // Ignored put from local node. cache1.GetAndPut(key1, Entry(key1 + 1)); - CheckFilterSingle(key1, Entry(key1), Entry(key1 + 1), !loc); + CheckFilterSingle(key1, Entry(key1), Entry(key1 + 1)); CheckNoCallback(100); // Ignored put from remote node. @@ -339,7 +339,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous if (loc) CheckNoFilter(100); else - CheckFilterSingle(key2, Entry(key2), Entry(key2 + 1), true); + CheckFilterSingle(key2, Entry(key2), Entry(key2 + 1)); CheckNoCallback(100); } @@ -621,6 +621,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous .Deserialize()); // 2. Remote put. + ClearEvents(); cache1.GetAndPut(PrimaryKey(cache2), Entry(2)); Assert.IsTrue(FILTER_EVTS.TryTake(out filterEvt, 500)); @@ -868,15 +869,10 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous /// Expected key. /// Expected old value. /// Expected value. - /// Whether there is a backup node to check.. - private void CheckFilterSingle(int expKey, BinarizableEntry expOldVal, BinarizableEntry expVal, - bool hasBackup = false) + private void CheckFilterSingle(int expKey, BinarizableEntry expOldVal, BinarizableEntry expVal) { CheckFilterSingle(expKey, expOldVal, expVal, 1000); - - // Filter is called on each cache node (primary and backup) - if (hasBackup) - CheckFilterSingle(expKey, expOldVal, expVal, 1000); + ClearEvents(); } /// @@ -895,6 +891,17 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous Assert.AreEqual(expKey, evt.entry.Key); Assert.AreEqual(expOldVal, evt.entry.OldValue); Assert.AreEqual(expVal, evt.entry.Value); + + ClearEvents(); + } + + /// + /// Clears the events collection. + /// + private static void ClearEvents() + { + while (FILTER_EVTS.Count > 0) + FILTER_EVTS.Take(); } ///