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 4ABAB200D4F for ; Wed, 6 Dec 2017 17:44:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 49332160C0A; Wed, 6 Dec 2017 16:44:23 +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 40A06160BF3 for ; Wed, 6 Dec 2017 17:44:22 +0100 (CET) Received: (qmail 14978 invoked by uid 500); 6 Dec 2017 16:44:21 -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 14969 invoked by uid 99); 6 Dec 2017 16:44:21 -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, 06 Dec 2017 16:44:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 58118DFFAB; Wed, 6 Dec 2017 16:44:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: ptupitsyn@apache.org To: commits@ignite.apache.org Message-Id: <969daa6172ca4d0098e64c64a735f7a5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: IGNITE-7123 .NET: Verify metrics API parity with tests Date: Wed, 6 Dec 2017 16:44:21 +0000 (UTC) archived-at: Wed, 06 Dec 2017 16:44:23 -0000 Repository: ignite Updated Branches: refs/heads/master 280acbf83 -> 4717570cf IGNITE-7123 .NET: Verify metrics API parity with tests Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4717570c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4717570c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4717570c Branch: refs/heads/master Commit: 4717570cfc6263ca3beb2ef6df53f5edef365fdc Parents: 280acbf Author: Pavel Tupitsyn Authored: Wed Dec 6 19:44:12 2017 +0300 Committer: Pavel Tupitsyn Committed: Wed Dec 6 19:44:12 2017 +0300 ---------------------------------------------------------------------- .../Apache.Ignite.Core.Tests.csproj | 5 ++ .../ApiParity/CacheMetricsParityTest.cs | 64 ++++++++++++++++++++ .../ApiParity/ClusterMetricsParityTest.cs | 47 ++++++++++++++ .../ApiParity/DataRegionMetricsParityTest.cs | 54 +++++++++++++++++ .../ApiParity/DataStorageMetricsParityTest.cs | 38 ++++++++++++ .../ApiParity/ParityTest.cs | 4 +- .../ApiParity/TransactionMetricsParityTest.cs | 39 ++++++++++++ 7 files changed, 250 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/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 648df7e..a53b0de 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 @@ -71,12 +71,16 @@ + + + + @@ -86,6 +90,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/CacheMetricsParityTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/CacheMetricsParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/CacheMetricsParityTest.cs new file mode 100644 index 0000000..7e8be1e --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/CacheMetricsParityTest.cs @@ -0,0 +1,64 @@ +/* + * 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.ApiParity +{ + using System.Collections.Generic; + using Apache.Ignite.Core.Cache; + using NUnit.Framework; + + /// + /// Tests that has all APIs from Java Ignite interface. + /// + public class CacheMetricsParityTest + { + /** Known name mappings. */ + private static readonly Dictionary KnownMappings = new Dictionary + { + {"name", "CacheName"} + }; + + /** Properties that are missing on .NET side. */ + private static readonly string[] MissingProperties = + { + // IGNITE-7126 + "HeapEntriesCount", + "TotalPartitionsCount", + "RebalancingPartitionsCount", + "KeysToRebalanceLeft", + "RebalancingKeysRate", + "RebalancingBytesRate", + "isValidForReading", + "isValidForWriting", + "EstimatedRebalancingFinishTime", + "RebalancingStartTime" + }; + + /// + /// Tests the API parity. + /// + [Test] + public void TestCacheMetrics() + { + ParityTest.CheckInterfaceParity( + @"modules\core\src\main\java\org\apache\ignite\cache\CacheMetrics.java", + typeof(ICacheMetrics), + knownMappings: KnownMappings, + knownMissingMembers: MissingProperties); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ClusterMetricsParityTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ClusterMetricsParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ClusterMetricsParityTest.cs new file mode 100644 index 0000000..bb0b3cb --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ClusterMetricsParityTest.cs @@ -0,0 +1,47 @@ +/* + * 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.ApiParity +{ + using Apache.Ignite.Core.Cluster; + using NUnit.Framework; + + /// + /// Tests that has all APIs from Java Ignite interface. + /// + public class ClusterMetricsParityTest + { + /** Properties that are missing on .NET side. */ + private static readonly string[] MissingProperties = + { + // IGNITE-7127 + "TotalJobsExecutionTime" + }; + + /// + /// Tests the API parity. + /// + [Test] + public void TestClusterMetrics() + { + ParityTest.CheckInterfaceParity( + @"modules\core\src\main\java\org\apache\ignite\cluster\ClusterMetrics.java", + typeof(IClusterMetrics), + knownMissingMembers: MissingProperties); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataRegionMetricsParityTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataRegionMetricsParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataRegionMetricsParityTest.cs new file mode 100644 index 0000000..d85d391 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataRegionMetricsParityTest.cs @@ -0,0 +1,54 @@ +/* + * 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.ApiParity +{ + using System.Collections.Generic; + using NUnit.Framework; + + /// + /// Tests that has all APIs from Java Ignite interface. + /// + public class DataRegionMetricsParityTest + { + /** Known name mappings. */ + private static readonly Dictionary KnownMappings = new Dictionary + { + {"PagesFillFactor", "PageFillFactor"} + }; + + /** Properties that are missing on .NET side. */ + private static readonly string[] MissingProperties = + { + // IGNITE-7128 + "DirtyPages", "PagesReplaceRate", "PagesReplaceAge", "PhysicalMemoryPages" + }; + + /// + /// Tests the API parity. + /// + [Test] + public void TestDataRegionMetrics() + { + ParityTest.CheckInterfaceParity( + @"modules\core\src\main\java\org\apache\ignite\DataRegionMetrics.java", + typeof(IDataRegionMetrics), + knownMappings: KnownMappings, + knownMissingMembers: MissingProperties); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageMetricsParityTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageMetricsParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageMetricsParityTest.cs new file mode 100644 index 0000000..a8fe87d --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageMetricsParityTest.cs @@ -0,0 +1,38 @@ +/* + * 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.ApiParity +{ + using NUnit.Framework; + + /// + /// Tests that has all APIs from Java Ignite interface. + /// + public class DataStorageMetricsParityTest + { + /// + /// Tests the API parity. + /// + [Test] + public void TestDataStorageMetrics() + { + ParityTest.CheckInterfaceParity( + @"modules\core\src\main\java\org\apache\ignite\DataStorageMetrics.java", + typeof(IDataStorageMetrics)); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ParityTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ParityTest.cs index 63aa96f..d52ef14 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/ParityTest.cs @@ -116,12 +116,14 @@ namespace Apache.Ignite.Core.Tests.ApiParity .ToDictionary(x => x, x => x, StringComparer.OrdinalIgnoreCase); var sb = new StringBuilder(); + var codeSb = new StringBuilder(); foreach (var javaMissingProp in missingMembers) { if (!knownMissing.ContainsKey(javaMissingProp.Key)) { sb.AppendFormat("{0}.{1} member is missing in .NET.\n", type.Name, javaMissingProp.Key); + codeSb.AppendFormat("\"{0}\", ", javaMissingProp.Key); } } @@ -136,7 +138,7 @@ namespace Apache.Ignite.Core.Tests.ApiParity if (sb.Length > 0) { - Assert.Fail(sb.ToString()); + Assert.Fail(sb + "\nQuoted list: " + codeSb); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/4717570c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TransactionMetricsParityTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TransactionMetricsParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TransactionMetricsParityTest.cs new file mode 100644 index 0000000..0327e3a --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TransactionMetricsParityTest.cs @@ -0,0 +1,39 @@ +/* + * 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.ApiParity +{ + using Apache.Ignite.Core.Transactions; + using NUnit.Framework; + + /// + /// Tests that has all APIs from Java Ignite interface. + /// + public class TransactionMetricsParityTest + { + /// + /// Tests the API parity. + /// + [Test] + public void TestTransactionMetrics() + { + ParityTest.CheckInterfaceParity( + @"modules\core\src\main\java\org\apache\ignite\transactions\TransactionMetrics.java", + typeof(ITransactionMetrics)); + } + } +} \ No newline at end of file