lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [04/15] lucenenet git commit: Lucene.Net.Tests.QueryParser: Added API consistency tests
Date Wed, 01 Feb 2017 05:19:03 GMT
Lucene.Net.Tests.QueryParser: Added API consistency tests


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b1efc526
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b1efc526
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b1efc526

Branch: refs/heads/api-work
Commit: b1efc52626bfe182de0441fb3a45c524ff14acad
Parents: 03d1387
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Feb 1 09:52:52 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Feb 1 09:52:52 2017 +0700

----------------------------------------------------------------------
 .../Lucene.Net.Tests.QueryParser.csproj         |   1 +
 .../TestApiConsistency.cs                       | 120 +++++++++++++++++++
 2 files changed, 121 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1efc526/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj b/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj
index 61c0e43..b19c814 100644
--- a/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj
+++ b/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj
@@ -82,6 +82,7 @@
     <Compile Include="Surround\Query\Test01Exceptions.cs" />
     <Compile Include="Surround\Query\Test02Boolean.cs" />
     <Compile Include="Surround\Query\Test03Distance.cs" />
+    <Compile Include="TestApiConsistency.cs" />
     <Compile Include="Util\QueryParserTestBase.cs" />
     <Compile Include="Xml\Builders\TestNumericRangeFilterBuilder.cs" />
     <Compile Include="Xml\Builders\TestNumericRangeQueryBuilder.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1efc526/src/Lucene.Net.Tests.QueryParser/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/TestApiConsistency.cs b/src/Lucene.Net.Tests.QueryParser/TestApiConsistency.cs
new file mode 100644
index 0000000..b28ace3
--- /dev/null
+++ b/src/Lucene.Net.Tests.QueryParser/TestApiConsistency.cs
@@ -0,0 +1,120 @@
+´╗┐using Lucene.Net.Attributes;
+using Lucene.Net.Util;
+using NUnit.Framework;
+using System;
+
+namespace Lucene.Net.QueryParsers
+{
+    /// <summary>
+    /// LUCENENET specific tests for ensuring API conventions are followed
+    /// </summary>
+    public class TestApiConsistency : ApiScanTestBase
+    {
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestProtectedFieldNames(Type typeFromTargetAssembly)
+        {
+            base.TestProtectedFieldNames(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestPrivateFieldNames(Type typeFromTargetAssembly)
+        {
+            base.TestPrivateFieldNames(typeFromTargetAssembly, @"Snowball\.Ext\..+Stemmer");
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestPublicFields(Type typeFromTargetAssembly)
+        {
+            base.TestPublicFields(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestMethodParameterNames(Type typeFromTargetAssembly)
+        {
+            base.TestMethodParameterNames(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestInterfaceNames(Type typeFromTargetAssembly)
+        {
+            base.TestInterfaceNames(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestClassNames(Type typeFromTargetAssembly)
+        {
+            base.TestClassNames(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForPropertiesWithNoGetter(Type typeFromTargetAssembly)
+        {
+            base.TestForPropertiesWithNoGetter(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForPropertiesThatReturnArray(Type typeFromTargetAssembly)
+        {
+            base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
+        {
+            base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForPublicMembersContainingComparer(Type typeFromTargetAssembly)
+        {
+            base.TestForPublicMembersContainingComparer(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForPublicMembersNamedSize(Type typeFromTargetAssembly)
+        {
+            base.TestForPublicMembersNamedSize(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForPublicMembersContainingNonNetNumeric(Type typeFromTargetAssembly)
+        {
+            base.TestForPublicMembersContainingNonNetNumeric(typeFromTargetAssembly);
+        }
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForPublicMembersWithNullableEnum(Type typeFromTargetAssembly)
+        {
+            base.TestForPublicMembersWithNullableEnum(typeFromTargetAssembly);
+        }
+
+        // LUCENENET NOTE: This test is only for identifying members who were changed from
+        // ICollection, IList or ISet to IEnumerable during the port (that should be changed
back)
+        //[Test, LuceneNetSpecific]
+        //[TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        //public override void TestForMembersAcceptingOrReturningIEnumerable(Type typeFromTargetAssembly)
+        //{
+        //    base.TestForMembersAcceptingOrReturningIEnumerable(typeFromTargetAssembly);
+        //}
+
+        [Test, LuceneNetSpecific]
+        [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
+        public override void TestForMembersAcceptingOrReturningListOrDictionary(Type typeFromTargetAssembly)
+        {
+            base.TestForMembersAcceptingOrReturningListOrDictionary(typeFromTargetAssembly);
+        }
+    }
+}


Mime
View raw message