Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C4CFF200C02 for ; Fri, 20 Jan 2017 10:56:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C34F8160B48; Fri, 20 Jan 2017 09:56:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7502E160B39 for ; Fri, 20 Jan 2017 10:56:38 +0100 (CET) Received: (qmail 57341 invoked by uid 500); 20 Jan 2017 09:56:37 -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 57332 invoked by uid 99); 20 Jan 2017 09:56:37 -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; Fri, 20 Jan 2017 09:56:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 923A3DFB8E; Fri, 20 Jan 2017 09:56:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ptupitsyn@apache.org To: commits@ignite.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: IGNITE-4563 .NET: Fix ICache.LoadCache failures on non-primitive arguments Date: Fri, 20 Jan 2017 09:56:37 +0000 (UTC) archived-at: Fri, 20 Jan 2017 09:56:40 -0000 Repository: ignite Updated Branches: refs/heads/master f1fca3ad5 -> 83b5bca6b IGNITE-4563 .NET: Fix ICache.LoadCache failures on non-primitive arguments Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/83b5bca6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/83b5bca6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/83b5bca6 Branch: refs/heads/master Commit: 83b5bca6bf402d2368d55ae5c7d6314ad7a225b4 Parents: f1fca3a Author: Pavel Tupitsyn Authored: Fri Jan 20 12:56:26 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jan 20 12:56:26 2017 +0300 ---------------------------------------------------------------------- .../platform/cache/PlatformCache.java | 11 +- .../Apache.Ignite.Core.Tests.csproj | 1 + .../Cache/Store/CacheParallelLoadStoreTest.cs | 9 +- .../Cache/Store/CacheStoreSessionTest.cs | 22 +- .../Cache/Store/CacheStoreTest.cs | 333 ++++++++++++------- .../Cache/Store/CacheTestStore.cs | 14 + .../Cache/Store/NamedNodeCacheStoreTest.cs | 34 ++ .../Apache.Ignite.Core/Impl/Cache/CacheImpl.cs | 14 +- 8 files changed, 294 insertions(+), 144 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java index aee317e..cc09f5e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java @@ -816,7 +816,16 @@ public class PlatformCache extends PlatformAbstractTarget { if (pred != null) filter = platformCtx.createCacheEntryFilter(pred, 0); - Object[] args = reader.readObjectArray(); + Object[] args = null; + + int argCnt = reader.readInt(); + + if (argCnt > 0) { + args = new Object[argCnt]; + + for (int i = 0; i < argCnt; i++) + args[i] = reader.readObjectDetached(); + } if (loc) cache.localLoadCache(filter, args); http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj index e09c682..08352b3 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj @@ -81,6 +81,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheParallelLoadStoreTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheParallelLoadStoreTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheParallelLoadStoreTest.cs index 105dea2..2e74b3f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheParallelLoadStoreTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheParallelLoadStoreTest.cs @@ -25,7 +25,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// /// Tests for GridCacheParallelLoadStoreAdapter. /// - public class CacheParallelLoadStoreTest + public sealed class CacheParallelLoadStoreTest { // object store name private const string ObjectStoreCacheName = "object_store_parallel"; @@ -34,11 +34,8 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// Set up test class. /// [TestFixtureSetUp] - public virtual void BeforeTests() + public void BeforeTests() { - TestUtils.KillProcesses(); - TestUtils.JvmDebug = true; - Ignition.Start(new IgniteConfiguration { JvmClasspath = TestUtils.CreateTestClasspath(), @@ -55,7 +52,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// Tear down test class. /// [TestFixtureTearDown] - public virtual void AfterTests() + public void AfterTests() { Ignition.StopAll(true); } http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs index 5cc0849..54e0414 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs @@ -22,14 +22,13 @@ namespace Apache.Ignite.Core.Tests.Cache.Store using System.Collections.Generic; using System.Linq; using Apache.Ignite.Core.Cache.Store; - using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.Resource; using NUnit.Framework; /// /// Tests for store session. /// - public class CacheStoreSessionTest + public sealed class CacheStoreSessionTest { /** Grid name. */ private const string IgniteName = "grid"; @@ -47,7 +46,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// Set up routine. /// [TestFixtureSetUp] - public virtual void BeforeTests() + public void BeforeTests() { //TestUtils.JVM_DEBUG = true; @@ -71,7 +70,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// Tear down routine. /// [TestFixtureTearDown] - public virtual void AfterTests() + public void AfterTests() { Ignition.StopAll(true); } @@ -147,7 +146,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// Dump operations. /// /// Dump. - internal static void DumpOperations(ICollection dump) + private static void DumpOperations(ICollection dump) { _dumps.Add(dump); } @@ -155,6 +154,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// /// Test store implementation. /// + // ReSharper disable once UnusedMember.Global public class Store : CacheStoreAdapter { /** Store session. */ @@ -215,7 +215,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// /// Logged operation. /// - internal class Operation + private class Operation { /// /// Constructor. @@ -244,22 +244,22 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// /// Cache name. /// - public string CacheName { get; set; } + public string CacheName { get; private set; } /// /// Operation type. /// - public OperationType Type { get; set; } + public OperationType Type { get; private set; } /// /// Key. /// - public int Key { get; set; } + public int Key { get; private set; } /// /// Value. /// - public int Value { get; set; } + public int Value { get; private set; } /// /// Commit flag. @@ -270,7 +270,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /// /// Operation types. /// - internal enum OperationType + private enum OperationType { /** Write. */ Write, http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs index d39ccde..869336c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs @@ -28,92 +28,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store using NUnit.Framework; /// - /// - /// - class Key - { - private readonly int _idx; - - public Key(int idx) - { - _idx = idx; - } - - public int Index() - { - return _idx; - } - - public override bool Equals(object obj) - { - if (obj == null || obj.GetType() != GetType()) - return false; - - Key key = (Key)obj; - - return key._idx == _idx; - } - - public override int GetHashCode() - { - return _idx; - } - } - - /// - /// - /// - class Value - { - private int _idx; - - public Value(int idx) - { - _idx = idx; - } - - public int Index() - { - return _idx; - } - } - - /// - /// Cache entry predicate. - /// - [Serializable] - public class CacheEntryFilter : ICacheEntryFilter - { - /** */ - public bool Invoke(ICacheEntry entry) - { - return entry.Key >= 105; - } - } - - /// - /// Cache entry predicate that throws an exception. - /// - [Serializable] - public class ExceptionalEntryFilter : ICacheEntryFilter - { - /** */ - public bool Invoke(ICacheEntry entry) - { - throw new Exception("Expected exception in ExceptionalEntryFilter"); - } - } - - /// - /// Filter that can't be serialized. - /// - public class InvalidCacheEntryFilter : CacheEntryFilter - { - // No-op. - } - - /// - /// + /// Tests cache store functionality. /// public class CacheStoreTest { @@ -129,19 +44,12 @@ namespace Apache.Ignite.Core.Tests.Cache.Store /** */ private const string TemplateStoreCacheName = "template_store*"; - /** */ - private volatile int _storeCount = 3; - /// - /// + /// Fixture set up. /// [TestFixtureSetUp] public virtual void BeforeTests() { - TestUtils.KillProcesses(); - - TestUtils.JvmDebug = true; - var cfg = new IgniteConfiguration { GridName = GridName, @@ -155,7 +63,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store } /// - /// + /// Fixture tear down. /// [TestFixtureTearDown] public void AfterTests() @@ -164,16 +72,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store } /// - /// - /// - [SetUp] - public void BeforeTest() - { - Console.WriteLine("Test started: " + TestContext.CurrentContext.Test.Name); - } - - /// - /// + /// Test tear down. /// [TearDown] public void AfterTest() @@ -188,11 +87,12 @@ namespace Apache.Ignite.Core.Tests.Cache.Store "Cache is not empty: " + string.Join(", ", cache.Select(x => string.Format("[{0}:{1}]", x.Key, x.Value)))); - TestUtils.AssertHandleRegistryHasItems(300, _storeCount, Ignition.GetIgnite(GridName)); - - Console.WriteLine("Test finished: " + TestContext.CurrentContext.Test.Name); + TestUtils.AssertHandleRegistryHasItems(300, 3, Ignition.GetIgnite(GridName)); } + /// + /// Tests that simple cache loading works and exceptions are propagated properly. + /// [Test] public void TestLoadCache() { @@ -219,6 +119,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store cache.LoadCache(new CacheEntryFilter(), 100, 10)).InnerException); } + /// + /// Tests cache loading in local mode. + /// [Test] public void TestLocalLoadCache() { @@ -234,6 +137,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual("val_" + i, cache.Get(i)); } + /// + /// Tests that object metadata propagates properly during cache loading. + /// [Test] public void TestLoadCacheMetadata() { @@ -254,6 +160,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual("Value", meta.TypeName); } + /// + /// Tests asynchronous cache load. + /// [Test] public void TestLoadCacheAsync() { @@ -278,6 +187,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store .InnerException); } + /// + /// Tests write-through and read-through behavior. + /// [Test] public void TestPutLoad() { @@ -285,7 +197,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store cache.Put(1, "val"); - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(1, map.Count); @@ -305,6 +217,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store CheckCustomStoreError(Assert.Throws(() => cache.Get(1)).InnerException); } + /// + /// Tests write-through and read-through behavior with binarizable values. + /// [Test] public void TestPutLoadBinarizable() { @@ -312,7 +227,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store cache.Put(1, new Value(1)); - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(1, map.Count); @@ -324,11 +239,14 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual(0, cache.GetSize()); - Assert.AreEqual(1, cache.Get(1).Index()); + Assert.AreEqual(1, cache.Get(1).Index); Assert.AreEqual(1, cache.GetSize()); } + /// + /// Tests write-through and read-through behavior with storeKeepBinary=false. + /// [Test] public void TestPutLoadObjects() { @@ -336,23 +254,26 @@ namespace Apache.Ignite.Core.Tests.Cache.Store cache.Put(1, new Value(1)); - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(1, map.Count); Value v = (Value)map[1]; - Assert.AreEqual(1, v.Index()); + Assert.AreEqual(1, v.Index); cache.LocalEvict(new[] { 1 }); Assert.AreEqual(0, cache.GetSize()); - Assert.AreEqual(1, cache.Get(1).Index()); + Assert.AreEqual(1, cache.Get(1).Index); Assert.AreEqual(1, cache.GetSize()); } + /// + /// Tests cache store LoadAll functionality. + /// [Test] public void TestPutLoadAll() { @@ -365,7 +286,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store cache.PutAll(putMap); - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(10, map.Count); @@ -391,6 +312,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual(10, cache.GetSize()); } + /// + /// Tests cache store removal. + /// [Test] public void TestRemove() { @@ -399,7 +323,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store for (int i = 0; i < 10; i++) cache.Put(i, "val_" + i); - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(10, map.Count); @@ -412,6 +336,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual("val_" + i, map[i]); } + /// + /// Tests cache store removal. + /// [Test] public void TestRemoveAll() { @@ -420,7 +347,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store for (int i = 0; i < 10; i++) cache.Put(i, "val_" + i); - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(10, map.Count); @@ -432,6 +359,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual("val_" + i, map[i]); } + /// + /// Tests cache store with transactions. + /// [Test] public void TestTx() { @@ -446,13 +376,16 @@ namespace Apache.Ignite.Core.Tests.Cache.Store tx.Commit(); } - IDictionary map = StoreMap(); + IDictionary map = GetStoreMap(); Assert.AreEqual(1, map.Count); Assert.AreEqual("val", map[1]); } + /// + /// Tests multithreaded cache loading. + /// [Test] public void TestLoadCacheMultithreaded() { @@ -470,6 +403,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual("val_" + i, cache.Get(i)); } + /// + /// Tests that cache store property values are propagated from Spring XML. + /// [Test] public void TestCustomStoreProperties() { @@ -480,6 +416,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual("String value", CacheTestStore.stringProperty); } + /// + /// Tests cache store with dynamically started cache. + /// [Test] public void TestDynamicStoreStart() { @@ -498,6 +437,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Assert.AreEqual(handleCount, reg.Count); } + /// + /// Tests the load all. + /// [Test] public void TestLoadAll([Values(true, false)] bool isAsync) { @@ -529,6 +471,49 @@ namespace Apache.Ignite.Core.Tests.Cache.Store } /// + /// Tests the argument passing to LoadCache method. + /// + [Test] + public void TestArgumentPassing() + { + var cache = GetBinaryStoreCache(); + + Action checkValue = o => + { + cache.Clear(); + Assert.AreEqual(0, cache.GetSize()); + cache.LoadCache(null, null, 1, o); + Assert.AreEqual(o, cache[1]); + }; + + // Null. + cache.LoadCache(null, null); + Assert.AreEqual(0, cache.GetSize()); + + // Empty args array. + cache.LoadCache(null); + Assert.AreEqual(0, cache.GetSize()); + + // Simple types. + checkValue(1); + checkValue(new[] {1, 2, 3}); + + checkValue("1"); + checkValue(new[] {"1", "2"}); + + checkValue(Guid.NewGuid()); + checkValue(new[] {Guid.NewGuid(), Guid.NewGuid()}); + + checkValue(DateTime.Now); + checkValue(new[] {DateTime.Now, DateTime.UtcNow}); + + // Collections. + checkValue(new ArrayList {1, "2", 3.3}); + checkValue(new List {1, 2}); + checkValue(new Dictionary {{1, "foo"}}); + } + + /// /// Get's grid name for this test. /// /// Grid name. @@ -537,31 +522,49 @@ namespace Apache.Ignite.Core.Tests.Cache.Store get { return null; } } - private IDictionary StoreMap() + /// + /// Gets the store map. + /// + private static IDictionary GetStoreMap() { return CacheTestStore.Map; } + /// + /// Gets the cache. + /// private ICache GetCache() { return GetBinaryStoreCache(); } + /// + /// Gets the binary store cache. + /// private ICache GetBinaryStoreCache() { return Ignition.GetIgnite(GridName).GetCache(BinaryStoreCacheName); } + /// + /// Gets the object store cache. + /// private ICache GetObjectStoreCache() { return Ignition.GetIgnite(GridName).GetCache(ObjectStoreCacheName); } + /// + /// Gets the custom store cache. + /// private ICache GetCustomStoreCache() { return Ignition.GetIgnite(GridName).GetCache(CustomStoreCacheName); } + /// + /// Gets the template store cache. + /// private ICache GetTemplateStoreCache() { var cacheName = TemplateStoreCacheName.Replace("*", Guid.NewGuid().ToString()); @@ -569,6 +572,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Store return Ignition.GetIgnite(GridName).GetOrCreateCache(cacheName); } + /// + /// Checks the custom store error. + /// private static void CheckCustomStoreError(Exception err) { var customErr = err as CacheTestStore.CustomStoreException ?? @@ -581,14 +587,93 @@ namespace Apache.Ignite.Core.Tests.Cache.Store } /// - /// + /// Cache key. /// - public class NamedNodeCacheStoreTest : CacheStoreTest + internal class Key { - /** */ - protected override string GridName + /** */ + private readonly int _idx; + + /// + /// Initializes a new instance of the class. + /// + public Key(int idx) + { + _idx = idx; + } + + /** */ + public override bool Equals(object obj) { - get { return "name"; } + if (obj == null || obj.GetType() != GetType()) + return false; + + return ((Key)obj)._idx == _idx; } + + /** */ + public override int GetHashCode() + { + return _idx; + } + } + + /// + /// Cache value. + /// + internal class Value + { + /** */ + private readonly int _idx; + + /// + /// Initializes a new instance of the class. + /// + public Value(int idx) + { + _idx = idx; + } + + /// + /// Gets the index. + /// + public int Index + { + get { return _idx; } + } + } + + /// + /// Cache entry predicate. + /// + [Serializable] + public class CacheEntryFilter : ICacheEntryFilter + { + /** */ + public bool Invoke(ICacheEntry entry) + { + return entry.Key >= 105; + } + } + + /// + /// Cache entry predicate that throws an exception. + /// + [Serializable] + public class ExceptionalEntryFilter : ICacheEntryFilter + { + /** */ + public bool Invoke(ICacheEntry entry) + { + throw new Exception("Expected exception in ExceptionalEntryFilter"); + } + } + + /// + /// Filter that can't be serialized. + /// + public class InvalidCacheEntryFilter : CacheEntryFilter + { + // No-op. } } http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheTestStore.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheTestStore.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheTestStore.cs index 4224835..f80f5ce 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheTestStore.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheTestStore.cs @@ -66,6 +66,20 @@ namespace Apache.Ignite.Core.Tests.Cache.Store Debug.Assert(_grid != null); + if (args == null || args.Length == 0) + return; + + if (args.Length == 3 && args[0] == null) + { + // Testing arguments passing. + var key = args[1]; + var val = args[2]; + + act(key, val); + + return; + } + if (LoadMultithreaded) { int cnt = 0; http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/NamedNodeCacheStoreTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/NamedNodeCacheStoreTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/NamedNodeCacheStoreTest.cs new file mode 100644 index 0000000..02e257f --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/NamedNodeCacheStoreTest.cs @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace Apache.Ignite.Core.Tests.Cache.Store +{ + using NUnit.Framework; + + /// + /// Cache store test with named node. + /// + [TestFixture] + public class NamedNodeCacheStoreTest : CacheStoreTest + { + /** */ + protected override string GridName + { + get { return "name"; } + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/83b5bca6/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs index 186737c..b8dc6cb 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs @@ -225,7 +225,7 @@ namespace Apache.Ignite.Core.Impl.Cache /// /// Writes the load cache data to the writer. /// - private void WriteLoadCacheData(IBinaryRawWriter writer, ICacheEntryFilter p, object[] args) + private void WriteLoadCacheData(BinaryWriter writer, ICacheEntryFilter p, object[] args) { if (p != null) { @@ -237,7 +237,17 @@ namespace Apache.Ignite.Core.Impl.Cache else writer.WriteObject(null); - writer.WriteArray(args); + if (args != null && args.Length > 0) + { + writer.WriteInt(args.Length); + + foreach (var o in args) + writer.WriteObject(o); + } + else + { + writer.WriteInt(0); + } } /** */