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 1838618BA9 for ; Wed, 18 Nov 2015 10:39:17 +0000 (UTC) Received: (qmail 39736 invoked by uid 500); 18 Nov 2015 10:39:17 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 39631 invoked by uid 500); 18 Nov 2015 10:39:16 -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 39501 invoked by uid 99); 18 Nov 2015 10:39:16 -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; Wed, 18 Nov 2015 10:39:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 90701E0A36; Wed, 18 Nov 2015 10:39:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Wed, 18 Nov 2015 10:39:22 -0000 Message-Id: <5a8219e109b842818c3f64f548b8b67b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/17] ignite git commit: IGNITE-1881: Internal portable -> binary renamings. http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs index cb582b7..68616ab 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs @@ -39,8 +39,8 @@ namespace Apache.Ignite.Core.Tests.Compute /** Echo task name. */ private const string EchoTask = "org.apache.ignite.platform.PlatformComputeEchoTask"; - /** Portable argument task name. */ - private const string PortableArgTask = "org.apache.ignite.platform.PlatformComputePortableArgTask"; + /** Binary argument task name. */ + private const string BinaryArgTask = "org.apache.ignite.platform.PlatformComputeBinarizableArgTask"; /** Broadcast task name. */ private const string BroadcastTask = "org.apache.ignite.platform.PlatformComputeBroadcastTask"; @@ -48,8 +48,8 @@ namespace Apache.Ignite.Core.Tests.Compute /** Broadcast task name. */ private const string DecimalTask = "org.apache.ignite.platform.PlatformComputeDecimalTask"; - /** Java portable class name. */ - private const string JavaPortableCls = "GridInteropComputeJavaPortable"; + /** Java binary class name. */ + private const string JavaBinaryCls = "PlatformComputeJavaBinarizable"; /** Echo type: null. */ private const int EchoTypeNull = 0; @@ -87,17 +87,17 @@ namespace Apache.Ignite.Core.Tests.Compute /** Echo type: map. */ private const int EchoTypeMap = 11; - /** Echo type: portable. */ - private const int EchoTypePortable = 12; + /** Echo type: binarizable. */ + private const int EchoTypeBinarizable = 12; - /** Echo type: portable (Java only). */ - private const int EchoTypePortableJava = 13; + /** Echo type: binary (Java only). */ + private const int EchoTypeBinarizableJava = 13; /** Type: object array. */ private const int EchoTypeObjArray = 14; - /** Type: portable object array. */ - private const int EchoTypePortableArray = 15; + /** Type: binary object array. */ + private const int EchoTypeBinarizableArray = 15; /** Type: enum. */ private const int EchoTypeEnum = 16; @@ -799,34 +799,34 @@ namespace Apache.Ignite.Core.Tests.Compute } /// - /// Test echo task returning portable object. + /// Test echo task returning binary object. /// [Test] - public void TestEchoTaskPortable() + public void TestEchoTaskBinarizable() { - PlatformComputePortable res = _grid1.GetCompute().ExecuteJavaTask(EchoTask, EchoTypePortable); + var res = _grid1.GetCompute().ExecuteJavaTask(EchoTask, EchoTypeBinarizable); Assert.AreEqual(1, res.Field); } /// - /// Test echo task returning portable object with no corresponding class definition. + /// Test echo task returning binary object with no corresponding class definition. /// [Test] - public void TestEchoTaskPortableNoClass() + public void TestEchoTaskBinarizableNoClass() { ICompute compute = _grid1.GetCompute(); compute.WithKeepBinary(); - IBinaryObject res = compute.ExecuteJavaTask(EchoTask, EchoTypePortableJava); + IBinaryObject res = compute.ExecuteJavaTask(EchoTask, EchoTypeBinarizableJava); Assert.AreEqual(1, res.GetField("field")); - // This call must fail because "keepPortable" flag is reset. + // This call must fail because "keepBinary" flag is reset. Assert.Catch(typeof(BinaryObjectException), () => { - compute.ExecuteJavaTask(EchoTask, EchoTypePortableJava); + compute.ExecuteJavaTask(EchoTask, EchoTypeBinarizableJava); }); } @@ -842,17 +842,17 @@ namespace Apache.Ignite.Core.Tests.Compute } /// - /// Tests the echo task returning portable array. + /// Tests the echo task returning binary array. /// [Test] - public void TestEchoTaskPortableArray() + public void TestEchoTaskBinarizableArray() { - var res = _grid1.GetCompute().ExecuteJavaTask(EchoTask, EchoTypePortableArray); + var res = _grid1.GetCompute().ExecuteJavaTask(EchoTask, EchoTypeBinarizableArray); Assert.AreEqual(3, res.Length); for (var i = 0; i < res.Length; i++) - Assert.AreEqual(i + 1, ((PlatformComputePortable) res[i]).Field); + Assert.AreEqual(i + 1, ((PlatformComputeBinarizable) res[i]).Field); } /// @@ -883,20 +883,20 @@ namespace Apache.Ignite.Core.Tests.Compute } /// - /// Test for portable argument in Java. + /// Test for binary argument in Java. /// [Test] - public void TestPortableArgTask() + public void TestBinarizableArgTask() { ICompute compute = _grid1.GetCompute(); compute.WithKeepBinary(); - PlatformComputeNetPortable arg = new PlatformComputeNetPortable(); + PlatformComputeNetBinarizable arg = new PlatformComputeNetBinarizable(); arg.Field = 100; - int res = compute.ExecuteJavaTask(PortableArgTask, arg); + int res = compute.ExecuteJavaTask(BinaryArgTask, arg); Assert.AreEqual(arg.Field, res); } @@ -1109,9 +1109,9 @@ namespace Apache.Ignite.Core.Tests.Compute ICollection portTypeCfgs = new List(); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PlatformComputePortable))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PlatformComputeNetPortable))); - portTypeCfgs.Add(new BinaryTypeConfiguration(JavaPortableCls)); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PlatformComputeBinarizable))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PlatformComputeNetBinarizable))); + portTypeCfgs.Add(new BinaryTypeConfiguration(JavaBinaryCls)); portCfg.TypeConfigurations = portTypeCfgs; @@ -1127,7 +1127,7 @@ namespace Apache.Ignite.Core.Tests.Compute } } - class PlatformComputePortable + class PlatformComputeBinarizable { public int Field { @@ -1136,7 +1136,7 @@ namespace Apache.Ignite.Core.Tests.Compute } } - class PlatformComputeNetPortable : PlatformComputePortable + class PlatformComputeNetBinarizable : PlatformComputeBinarizable { } http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/FailoverTaskSelfTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/FailoverTaskSelfTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/FailoverTaskSelfTest.cs index 044b5a6..34a1573 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/FailoverTaskSelfTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/FailoverTaskSelfTest.cs @@ -73,10 +73,10 @@ namespace Apache.Ignite.Core.Tests.Compute } /// - /// Test for GridComputeJobFailoverException with portable job. + /// Test for GridComputeJobFailoverException with binary job. /// [Test] - public void TestTaskAdapterFailoverExceptionPortable() + public void TestTaskAdapterFailoverExceptionBinarizable() { TestTaskAdapterFailoverException(false); } @@ -111,9 +111,9 @@ namespace Apache.Ignite.Core.Tests.Compute } /** */ - override protected void PortableTypeConfigurations(ICollection portTypeCfgs) + override protected void GetBinaryTypeConfigurations(ICollection portTypeCfgs) { - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(TestPortableJob))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(TestBinarizableJob))); } /// @@ -138,7 +138,7 @@ namespace Apache.Ignite.Core.Tests.Compute if (serializable) job = new TestSerializableJob(); else - job = new TestPortableJob(); + job = new TestBinarizableJob(); foreach (IClusterNode node in subgrid) { bool add = local ? node.IsLocal : !node.IsLocal; @@ -172,7 +172,7 @@ namespace Apache.Ignite.Core.Tests.Compute class TestClosure : IComputeFunc { [InstanceResource] - private IIgnite _grid = null; + private readonly IIgnite _grid = null; /** */ public int Invoke() @@ -188,7 +188,7 @@ namespace Apache.Ignite.Core.Tests.Compute class TestSerializableJob : IComputeJob { [InstanceResource] - private IIgnite _grid = null; + private readonly IIgnite _grid = null; /** */ public int Execute() @@ -206,10 +206,10 @@ namespace Apache.Ignite.Core.Tests.Compute /// /// /// - class TestPortableJob : IComputeJob + class TestBinarizableJob : IComputeJob { [InstanceResource] - private IIgnite _grid = null; + private readonly IIgnite _grid = null; /** */ public int Execute() http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedBinarizableClosureTaskTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedBinarizableClosureTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedBinarizableClosureTaskTest.cs new file mode 100644 index 0000000..315bbbe --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedBinarizableClosureTaskTest.cs @@ -0,0 +1,30 @@ +/* + * 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.Compute.Forked +{ + /// + /// Forked closure execution tests for binary objects. + /// + public class ForkedBinarizableClosureTaskTest : BinarizableClosureTaskTest + { + /// + /// Constructor. + /// + public ForkedBinarizableClosureTaskTest() : base(true) { } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedPortableClosureTaskTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedPortableClosureTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedPortableClosureTaskTest.cs deleted file mode 100644 index 4ce917b..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedPortableClosureTaskTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.Compute.Forked -{ - /// - /// Forked closure execution tests for portable objects. - /// - public class ForkedPortableClosureTaskTest : PortableClosureTaskTest - { - /// - /// Constructor. - /// - public ForkedPortableClosureTaskTest() : base(true) { } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedResourceTaskTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedResourceTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedResourceTaskTest.cs index 84c1ba2..a16db03 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedResourceTaskTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedResourceTaskTest.cs @@ -17,12 +17,9 @@ namespace Apache.Ignite.Core.Tests.Compute.Forked { - using NUnit.Framework; - /// /// Forked resource task test. /// - [Ignore("IGNITE-1381")] public class ForkedResourceTaskTest : ResourceTaskTest { /// http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedSerializableClosureTaskTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedSerializableClosureTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedSerializableClosureTaskTest.cs index 0324125..c6582ad 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedSerializableClosureTaskTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/Forked/ForkedSerializableClosureTaskTest.cs @@ -17,12 +17,9 @@ namespace Apache.Ignite.Core.Tests.Compute.Forked { - using NUnit.Framework; - /// /// Forked closure execution tests for serializable objects. /// - [Ignore("IGNITE-1381")] public class ForkedSerializableClosureTaskTest : SerializableClosureTaskTest { /// http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableClosureTaskTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableClosureTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableClosureTaskTest.cs deleted file mode 100644 index bca5ab6..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableClosureTaskTest.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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.Compute -{ - using System; - using System.Collections.Generic; - using Apache.Ignite.Core.Binary; - using Apache.Ignite.Core.Compute; - using NUnit.Framework; - - /// - /// Closure execution tests for portable objects. - /// - public class PortableClosureTaskTest : ClosureTaskTest - { - /// - /// Constructor. - /// - public PortableClosureTaskTest() : base(false) { } - - /// - /// Constructor. - /// - /// Fork flag. - protected PortableClosureTaskTest(bool fork) : base(fork) { } - - /** */ - protected override void PortableTypeConfigurations(ICollection portTypeCfgs) - { - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableOutFunc))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableFunc))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableResult))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableException))); - } - - /** */ - protected override IComputeFunc OutFunc(bool err) - { - return new PortableOutFunc(err); - } - - /** */ - protected override IComputeFunc Func(bool err) - { - return new PortableFunc(err); - } - - /** */ - protected override void CheckResult(object res) - { - Assert.IsTrue(res != null); - - PortableResult res0 = res as PortableResult; - - Assert.IsTrue(res0 != null); - Assert.AreEqual(1, res0.Res); - } - - /** */ - protected override void CheckError(Exception err) - { - Assert.IsTrue(err != null); - - PortableException err0 = err as PortableException; - - Assert.IsTrue(err0 != null); - Assert.AreEqual(ErrMsg, err0.Msg); - } - - /// - /// - /// - private class PortableOutFunc : IComputeFunc - { - /** Error. */ - private bool _err; - - /// - /// - /// - public PortableOutFunc() - { - // No-op. - } - - /// - /// - /// - /// - public PortableOutFunc(bool err) - { - _err = err; - } - - /** */ - public object Invoke() - { - if (_err) - throw new PortableException(ErrMsg); - return new PortableResult(1); - } - } - - /// - /// - /// - private class PortableFunc : IComputeFunc - { - /** Error. */ - private bool _err; - - /// - /// - /// - public PortableFunc() - { - // No-op. - } - - /// - /// - /// - /// - public PortableFunc(bool err) - { - _err = err; - } - - /** */ - public object Invoke(object arg) - { - if (_err) - throw new PortableException(ErrMsg); - return new PortableResult(1); - } - } - - /// - /// - /// - private class PortableException : Exception, IBinarizable - { - /** */ - public string Msg; - - /// - /// - /// - public PortableException() - { - // No-op. - } - - /// - /// - /// - /// - public PortableException(string msg) : this() - { - Msg = msg; - } - - /** */ - public void WriteBinary(IBinaryWriter writer) - { - writer.GetRawWriter().WriteString(Msg); - } - - /** */ - public void ReadBinary(IBinaryReader reader) - { - Msg = reader.GetRawReader().ReadString(); - } - } - - /// - /// - /// - private class PortableResult - { - /** */ - public int Res; - - /// - /// - /// - public PortableResult() - { - // No-op. - } - - /// - /// - /// - /// - public PortableResult(int res) - { - Res = res; - } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableTaskTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableTaskTest.cs deleted file mode 100644 index 40a0f72..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/PortableTaskTest.cs +++ /dev/null @@ -1,269 +0,0 @@ -/* - * 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.Compute -{ - using System.Collections.Generic; - using Apache.Ignite.Core.Binary; - using Apache.Ignite.Core.Cluster; - using Apache.Ignite.Core.Compute; - using Apache.Ignite.Core.Resource; - using NUnit.Framework; - - /// - /// Task test result. - /// - public class PortableTaskTest : AbstractTaskTest - { - /// - /// Constructor. - /// - public PortableTaskTest() : base(false) { } - - /// - /// Constructor. - /// - /// Fork flag. - protected PortableTaskTest(bool fork) : base(fork) { } - - /// - /// Test for task result. - /// - [Test] - public void TestPortableObjectInTask() - { - var taskArg = new PortableWrapper {Item = ToPortable(Grid1, new PortableTaskArgument(100))}; - - TestTask task = new TestTask(Grid1, taskArg); - - var res = Grid1.GetCompute().Execute(task, taskArg).Item; - - Assert.NotNull(res); - - Assert.AreEqual(400, res.GetField("val")); - - PortableTaskResult resObj = res.Deserialize(); - - Assert.AreEqual(400, resObj.Val); - } - - private static IBinaryObject ToPortable(IIgnite grid, object obj) - { - var cache = grid.GetCache(Cache1Name).WithKeepBinary(); - - cache.Put(1, obj); - - return (IBinaryObject) cache.Get(1); - } - - /** */ - override protected void PortableTypeConfigurations(ICollection portTypeCfgs) - { - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableJobArgument))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableJobResult))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableTaskArgument))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableTaskResult))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableJob))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableWrapper))); - } - - /// - /// Test task. - /// - class TestTask : ComputeTaskAdapter - { - /** */ - private readonly IIgnite _grid; - - private readonly PortableWrapper _taskArgField; - - public TestTask(IIgnite grid, PortableWrapper taskArgField) - { - _grid = grid; - _taskArgField = taskArgField; - } - - /** */ - override public IDictionary, IClusterNode> Map(IList subgrid, PortableWrapper arg) - { - Assert.AreEqual(3, subgrid.Count); - Assert.NotNull(_grid); - - var taskArg = arg; - - CheckTaskArgument(taskArg); - - CheckTaskArgument(_taskArgField); - - var jobs = new Dictionary, IClusterNode>(); - - - foreach (IClusterNode node in subgrid) - { - if (!Grid3Name.Equals(node.GetAttribute("org.apache.ignite.ignite.name"))) // Grid3 does not have cache. - { - var job = new PortableJob - { - Arg = new PortableWrapper {Item = ToPortable(_grid, new PortableJobArgument(200))} - }; - - jobs.Add(job, node); - } - } - - Assert.AreEqual(2, jobs.Count); - - return jobs; - } - - private void CheckTaskArgument(PortableWrapper arg) - { - Assert.IsNotNull(arg); - - var taskArg = arg.Item; - - Assert.IsNotNull(taskArg); - - Assert.AreEqual(100, taskArg.GetField("val")); - - PortableTaskArgument taskArgObj = taskArg.Deserialize(); - - Assert.AreEqual(100, taskArgObj.Val); - } - - /** */ - override public PortableWrapper Reduce(IList> results) - { - Assert.NotNull(_grid); - - Assert.AreEqual(2, results.Count); - - foreach (var res in results) - { - var jobRes = res.Data.Item; - - Assert.NotNull(jobRes); - - Assert.AreEqual(300, jobRes.GetField("val")); - - PortableJobResult jobResObj = jobRes.Deserialize(); - - Assert.AreEqual(300, jobResObj.Val); - } - - return new PortableWrapper {Item = ToPortable(_grid, new PortableTaskResult(400))}; - } - } - - /// - /// - /// - class PortableJobArgument - { - /** */ - public int Val; - - public PortableJobArgument(int val) - { - Val = val; - } - } - - /// - /// - /// - class PortableJobResult - { - /** */ - public int Val; - - public PortableJobResult(int val) - { - Val = val; - } - } - - /// - /// - /// - class PortableTaskArgument - { - /** */ - public int Val; - - public PortableTaskArgument(int val) - { - Val = val; - } - } - - /// - /// - /// - class PortableTaskResult - { - /** */ - public int Val; - - public PortableTaskResult(int val) - { - Val = val; - } - } - - /// - /// - /// - class PortableJob : IComputeJob - { - [InstanceResource] - private IIgnite _grid = null; - - /** */ - public PortableWrapper Arg; - - /** */ - - public PortableWrapper Execute() - { - Assert.IsNotNull(Arg); - - var arg = Arg.Item; - - Assert.IsNotNull(arg); - - Assert.AreEqual(200, arg.GetField("val")); - - PortableJobArgument argObj = arg.Deserialize(); - - Assert.AreEqual(200, argObj.Val); - - return new PortableWrapper {Item = ToPortable(_grid, new PortableJobResult(300))}; - } - - public void Cancel() - { - // No-op. - } - } - - class PortableWrapper - { - public IBinaryObject Item { get; set; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs index 57e23b8..8418306 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs @@ -88,7 +88,7 @@ namespace Apache.Ignite.Core.Tests.Compute /// Test for job adapter. /// [Test] - public void TestPortableJobAdapter() + public void TestBinarizableJobAdapter() { for (int i = 0; i < 10; i++) { @@ -99,9 +99,9 @@ namespace Apache.Ignite.Core.Tests.Compute } /** */ - override protected void PortableTypeConfigurations(ICollection portTypeCfgs) + override protected void GetBinaryTypeConfigurations(ICollection portTypeCfgs) { - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableJob))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(BinarizableJob))); } /// @@ -158,7 +158,7 @@ namespace Apache.Ignite.Core.Tests.Compute if (serializable) jobs.Add(new SerializableJob(100, "str")); else - jobs.Add(new PortableJob(100, "str")); + jobs.Add(new BinarizableJob(100, "str")); return jobs; } @@ -236,14 +236,14 @@ namespace Apache.Ignite.Core.Tests.Compute } /// - /// Test portable job. + /// Test binary job. /// - public class PortableJob : ComputeJobAdapter + public class BinarizableJob : ComputeJobAdapter { [InstanceResource] private IIgnite _grid = null; - public PortableJob(params object[] args) : base(args) + public BinarizableJob(params object[] args) : base(args) { // No-op. } http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs index 20b19a1..4bf1e21 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs @@ -99,19 +99,19 @@ namespace Apache.Ignite.Core.Tests.Compute /// Test for task result. /// [Test] - public void TestTaskResultPortable() + public void TestTaskResultBinarizable() { - TestTask task = new TestTask(); + TestTask task = new TestTask(); - PortableResult val = new PortableResult(100); + BinarizableResult val = new BinarizableResult(100); - PortableResult res = Grid1.GetCompute().Execute(task, new Tuple(true, val)); + BinarizableResult res = Grid1.GetCompute().Execute(task, new Tuple(true, val)); Assert.AreEqual(val.Val, res.Val); val.Val = 101; - res = Grid1.GetCompute().Execute(task, new Tuple(false, val)); + res = Grid1.GetCompute().Execute(task, new Tuple(false, val)); Assert.AreEqual(val.Val, res.Val); } @@ -156,18 +156,18 @@ namespace Apache.Ignite.Core.Tests.Compute } /** */ - override protected void PortableTypeConfigurations(ICollection portTypeCfgs) + override protected void GetBinaryTypeConfigurations(ICollection portTypeCfgs) { - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableResult))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(TestPortableJob))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableOutFunc))); - portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(PortableFunc))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(BinarizableResult))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(TestBinarizableJob))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(BinarizableOutFunc))); + portTypeCfgs.Add(new BinaryTypeConfiguration(typeof(BinarizableFunc))); } [Test] public void TestOutFuncResultPrimitive1() { - ICollection res = Grid1.GetCompute().Broadcast(new PortableOutFunc()); + ICollection res = Grid1.GetCompute().Broadcast(new BinarizableOutFunc()); Assert.AreEqual(3, res.Count); @@ -189,7 +189,7 @@ namespace Apache.Ignite.Core.Tests.Compute [Test] public void TestFuncResultPrimitive1() { - ICollection res = Grid1.GetCompute().Broadcast(new PortableFunc(), 10); + ICollection res = Grid1.GetCompute().Broadcast(new BinarizableFunc(), 10); Assert.AreEqual(3, res.Count); @@ -216,7 +216,7 @@ namespace Apache.Ignite.Core.Tests.Compute /// /// Test function. /// - public class PortableFunc : IComputeFunc, IUserInterface + public class BinarizableFunc : IComputeFunc, IUserInterface { int IComputeFunc.Invoke(int arg) { @@ -252,7 +252,7 @@ namespace Apache.Ignite.Core.Tests.Compute /// /// Test function. /// - public class PortableOutFunc : IComputeFunc + public class BinarizableOutFunc : IComputeFunc { public int Invoke() { @@ -291,9 +291,9 @@ namespace Apache.Ignite.Core.Tests.Compute IComputeJob job; - if (res is PortableResult) + if (res is BinarizableResult) { - TestPortableJob job0 = new TestPortableJob(); + TestBinarizableJob job0 = new TestBinarizableJob(); job0.SetArguments(res); @@ -365,12 +365,12 @@ namespace Apache.Ignite.Core.Tests.Compute /// /// /// - class PortableResult + class BinarizableResult { /** */ public int Val; - public PortableResult(int val) + public BinarizableResult(int val) { Val = val; } @@ -398,7 +398,7 @@ namespace Apache.Ignite.Core.Tests.Compute class TestJob : ComputeJobAdapter { [InstanceResource] - private IIgnite _grid = null; + private readonly IIgnite _grid = null; /** */ override public T Execute() @@ -416,19 +416,19 @@ namespace Apache.Ignite.Core.Tests.Compute /// /// /// - class TestPortableJob : ComputeJobAdapter + class TestBinarizableJob : ComputeJobAdapter { [InstanceResource] - private IIgnite _grid = null; + private readonly IIgnite _grid = null; /** */ - override public PortableResult Execute() + override public BinarizableResult Execute() { Assert.IsNotNull(_grid); _gridName = _grid.Name; - PortableResult res = GetArgument(0); + BinarizableResult res = GetArgument(0); return res; } http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml index 0ad0070..e373b89 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml @@ -67,16 +67,16 @@ - + - + - + http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml index 6447b4e..ddedf40 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml @@ -61,20 +61,20 @@ Apache.Ignite.Core.Tests.ExecutableTest+RemoteConfiguration Apache.Ignite.Core.Tests.ExecutableTest+RemoteConfigurationClosure - Apache.Ignite.Core.Tests.Compute.TaskAdapterTest+PortableJob - Apache.Ignite.Core.Tests.Compute.PortableClosureTaskTest+PortableOutFunc - Apache.Ignite.Core.Tests.Compute.PortableClosureTaskTest+PortableFunc - Apache.Ignite.Core.Tests.Compute.PortableClosureTaskTest+PortableResult - Apache.Ignite.Core.Tests.Compute.PortableClosureTaskTest+PortableException + Apache.Ignite.Core.Tests.Compute.TaskAdapterTest+BinarizableJob + Apache.Ignite.Core.Tests.Compute.BinarizableClosureTaskTest+BinarizableOutFunc + Apache.Ignite.Core.Tests.Compute.BinarizableClosureTaskTest+BinarizableFunc + Apache.Ignite.Core.Tests.Compute.BinarizableClosureTaskTest+BinarizableResult + Apache.Ignite.Core.Tests.Compute.BinarizableClosureTaskTest+BinarizableException - + - + http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/binary.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/binary.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/binary.xml new file mode 100644 index 0000000..f013749 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/binary.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 127.0.0.1:47500..47502 + + + + + + + + http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml new file mode 100644 index 0000000..a31a450 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64] + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Type] + Apache.Ignite.Core.Tests.TestGenericBinarizable[Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64]] + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Collections.Generic.List[System.Tuple[System.Int64,System.String]]] + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64,System.String] + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64,Apache.Ignite.Core.Tests.TestGenericBinarizable[System.String]] + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64,System.String,System.Type] + Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64,System.String,Apache.Ignite.Core.Tests.TestGenericBinarizable[System.Int64,System.String,System.Type]] + + + + + + + + + + + + + + + + + + + + + + + + + 127.0.0.1:47500..47501 + + + + + + + + http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml deleted file mode 100644 index 26bf87b..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-portables.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64] - Apache.Ignite.Core.Tests.TestGenericPortable[System.Type] - Apache.Ignite.Core.Tests.TestGenericPortable[Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64]] - Apache.Ignite.Core.Tests.TestGenericPortable[System.Collections.Generic.List[System.Tuple[System.Int64,System.String]]] - Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64,System.String] - Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64,Apache.Ignite.Core.Tests.TestGenericPortable[System.String]] - Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64,System.String,System.Type] - Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64,System.String,Apache.Ignite.Core.Tests.TestGenericPortable[System.Int64,System.String,System.Type]] - - - - - - - - - - - - - - - - - - - - - - - - - 127.0.0.1:47500..47501 - - - - - - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/d69362f8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml index 7f9ce40..86a46e4 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml @@ -40,7 +40,7 @@