Add local test, remove assert
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5a5584b2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5a5584b2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5a5584b2 Branch: refs/heads/ignite-2977 Commit: 5a5584b2273266943711427c7e58cca17f731452 Parents: f44198d Author: Pavel Tupitsyn <[email protected]> Authored: Wed Apr 13 17:17:34 2016 +0300 Committer: Pavel Tupitsyn <[email protected]> Committed: Wed Apr 13 17:17:34 2016 +0300 ---------------------------------------------------------------------- .../cache/query/PlatformContinuousQueryImpl.java | 1 - .../Continuous/ContinuousQueryJavaFilterTest.cs | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5a5584b2/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java index db77d0e..f8244a9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java @@ -125,7 +125,6 @@ public class PlatformContinuousQueryImpl implements PlatformContinuousQuery { @SuppressWarnings("unchecked") @Override public void start(IgniteCacheProxy cache, boolean loc, int bufSize, long timeInterval, boolean autoUnsubscribe, Query initialQry) throws IgniteCheckedException { - assert !loc || filter == null; lock.writeLock().lock(); http://git-wip-us.apache.org/repos/asf/ignite/blob/5a5584b2/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryJavaFilterTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryJavaFilterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryJavaFilterTest.cs index aa5676f..fa73621 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryJavaFilterTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryJavaFilterTest.cs @@ -207,14 +207,28 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous /// </summary> private void TestFilter(ICacheEntryEventFilter<int, string> pred) { + TestFilter(pred, false); + TestFilter(pred, true); + } + + /// <summary> + /// Tests the specified filter. + /// </summary> + private void TestFilter(ICacheEntryEventFilter<int, string> pred, bool local) + { var cache = _ignite.GetOrCreateCache<int, string>("qry"); - var qry = new ContinuousQuery<int, string>(new QueryListener(), pred); + var qry = new ContinuousQuery<int, string>(new QueryListener(), pred, local); + var aff = _ignite.GetAffinity("qry"); + var localNode = _ignite.GetCluster().GetLocalNode(); using (cache.QueryContinuous(qry)) { // Run on many keys to test all nodes for (var i = 0; i < 200; i++) { + if (local && aff.MapKeyToNode(i).Id != localNode.Id) + continue; + _lastEvent = null; cache[i] = "validValue"; // ReSharper disable once PossibleNullReferenceException
