lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [1/4] git commit: setting the version to 5.0. removing TestFramework from the namespace. adding constant tests. adding constants output.
Date Fri, 01 Aug 2014 17:35:28 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/pcl ed43cd6fe -> 2c8e873b4


setting the version to 5.0. removing TestFramework from the namespace. adding constant tests.
adding constants output.


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

Branch: refs/heads/pcl
Commit: 2c22a123c24398a1dd7148560822e0487c8256f3
Parents: ed43cd6
Author: Michael Herndon <mherndon@michaelherndon.com>
Authored: Thu Jul 24 14:45:47 2014 -0400
Committer: Michael Herndon <mherndon@michaelherndon.com>
Committed: Thu Jul 24 14:45:47 2014 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Constants.cs           | 18 +++--
 src/Lucene.Net.Core/Util/SystemProps.cs         | 17 ++--
 src/Lucene.Net.Core/project.json                |  1 +
 .../Lucene.Net.Core.Tests.csproj                |  1 +
 .../Lucene.Net.Core.Tests.kproj                 |  1 +
 .../Support/ICloneableTests.cs                  |  2 +-
 .../Lucene.Net.Core.Tests/Util/TestConstants.cs | 85 ++++++++++++++++++++
 test/Lucene.Net.Core.Tests/project.json         |  6 +-
 .../Lucene.Net.TestFramework.csproj             |  3 +-
 .../Lucene.Net.TestFramework.kproj              |  1 -
 .../Util/LuceneTestCase.cs                      |  2 +-
 .../Util/TestAttribute.cs                       |  2 +-
 test/Lucene.Net.TestFramework/Util/TestUtil.cs  | 17 ----
 test/Lucene.Net.TestFramework/project.json      |  1 +
 14 files changed, 120 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/src/Lucene.Net.Core/Util/Constants.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Constants.cs b/src/Lucene.Net.Core/Util/Constants.cs
index 274ed2d..22df3ef 100644
--- a/src/Lucene.Net.Core/Util/Constants.cs
+++ b/src/Lucene.Net.Core/Util/Constants.cs
@@ -39,7 +39,7 @@ namespace Lucene.Net.Util
 
             if(version == null)
             {
-                version = EnsureMainVersionWithoutAlphaBeta() + "-SNAPSHOT";
+                version = MainVersionWithoutAlphaBeta + "-SNAPSHOT";
             }
 
             LUCENE_VERSION = version;
@@ -117,16 +117,20 @@ namespace Lucene.Net.Util
             return s.ToString();
         }
 
+      
 
-        private static string EnsureMainVersionWithoutAlphaBeta()
+        public static string MainVersionWithoutAlphaBeta
         {
-            var parts = LUCENE_MAIN_VERSION.Split('.');
-            if (parts.Length == 4 && "0".Equals(parts[2]))
+            get
             {
-                return parts[0] + "." + parts[1];
-            }
+                var parts = LUCENE_MAIN_VERSION.Split('.');
+                if (parts.Length == 4 && "0".Equals(parts[2]))
+                {
+                    return parts[0] + "." + parts[1];
+                }
 
-            return LUCENE_MAIN_VERSION;
+                return LUCENE_MAIN_VERSION;
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/src/Lucene.Net.Core/Util/SystemProps.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/SystemProps.cs b/src/Lucene.Net.Core/Util/SystemProps.cs
index b62df21..f5fbf70 100644
--- a/src/Lucene.Net.Core/Util/SystemProps.cs
+++ b/src/Lucene.Net.Core/Util/SystemProps.cs
@@ -20,13 +20,14 @@ namespace Lucene.Net.Util
     using Microsoft.Framework.ConfigurationModel;
     using System;
 
+
     /// <summary>
     /// SystemProps gets configuration properties for Lucene.Net. By default, it loads 
     /// <see cref="EnvironmentVariablesConfigurationSource"/> for the <see cref="Constants"/>
class.
     /// Other configuration sources may be added at runtime. 
     /// </summary>
-    [CLSCompliant(false)]
-    public static class SystemProps
+
+    public class SystemProps
     {
         private static Configuration s_config = new Configuration();
 
@@ -39,7 +40,9 @@ namespace Lucene.Net.Util
         /// Adds the <see cref="IConfigurationSource"/> to what is available in <see
cref="SystemProps"/>.
         /// </summary>
         /// <param name="configurationSource"></param>
+#pragma warning disable "CS3001"
         public static void Add(IConfigurationSource configurationSource)
+#pragma warning restore "CS3001"
         {
             s_config.Add(configurationSource);
         }
@@ -71,7 +74,7 @@ namespace Lucene.Net.Util
         /// <typeparam name="T">The expected value type</typeparam>
         /// <param name="key">The identifier associated with a value.</param>
         /// <param name="defaultValue">The default value that will be supplied if the
key returns null.</param>
-        /// <returns>The <typeparamref name="T"/> value.</returns>
+        /// <returns></returns>
         public static T Get<T>(string key, T defaultValue)
         {
             var value = s_config.Get(key);
@@ -83,12 +86,16 @@ namespace Lucene.Net.Util
 
 
         /// <summary>
-        /// Instructs the SystemProps to use this configuration object for Lucene.Net
+        /// 
         /// </summary>
-        /// <param name="configuration">The <see cref="Configuration"/> object.</param>
+        /// <param name="configuration"></param>
+
+#pragma warning disable "CS3001"
         public static void UseConfiguration(Configuration configuration)
+#pragma warning restore "CS3001"
         {
             s_config = configuration;
         }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/src/Lucene.Net.Core/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/project.json b/src/Lucene.Net.Core/project.json
index c00b765..eebe593 100644
--- a/src/Lucene.Net.Core/project.json
+++ b/src/Lucene.Net.Core/project.json
@@ -1,5 +1,6 @@
 {
     "licenses": ["apache 2.0"],
+     "version": "5.0.0.0",
     "dependencies": {
         "Microsoft.Framework.ConfigurationModel": "1.0.0-alpha2"
     },

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
index 5a31c2c..29e731e 100644
--- a/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
+++ b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
@@ -61,6 +61,7 @@
     <Compile Include="Support\ICloneableTests.cs" />
     <Compile Include="Util\BaseSorterTestCase.cs" />
     <Compile Include="Util\TestBits.cs" />
+    <Compile Include="Util\TestConstants.cs" />
     <Compile Include="Util\TestInPlaceMergeSorter.cs" />
     <Compile Include="Util\TestRamEstimatorUsage.cs" />
     <Compile Include="Util\TestVersion.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
index 17c2ff7..a5d68f4 100644
--- a/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
+++ b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
@@ -55,6 +55,7 @@
     <Compile Include="Support\ICloneableTests.cs" />
     <Compile Include="Util\BaseSorterTestCase.cs" />
     <Compile Include="Util\TestBits.cs" />
+    <Compile Include="Util\TestConstants.cs" />
     <Compile Include="Util\TestInPlaceMergeSorter.cs" />
     <Compile Include="Util\TestRamEstimatorUsage.cs" />
     <Compile Include="Util\TestVersion.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.Core.Tests/Support/ICloneableTests.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Support/ICloneableTests.cs b/test/Lucene.Net.Core.Tests/Support/ICloneableTests.cs
index cd0eef6..53202ce 100644
--- a/test/Lucene.Net.Core.Tests/Support/ICloneableTests.cs
+++ b/test/Lucene.Net.Core.Tests/Support/ICloneableTests.cs
@@ -22,7 +22,7 @@
 
 namespace Lucene.Net.Support
 {
-    using Lucene.Net.TestFramework;
+    using Lucene.Net.Util;
     using System;
 
     /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.Core.Tests/Util/TestConstants.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Util/TestConstants.cs b/test/Lucene.Net.Core.Tests/Util/TestConstants.cs
new file mode 100644
index 0000000..ffcd3b0
--- /dev/null
+++ b/test/Lucene.Net.Core.Tests/Util/TestConstants.cs
@@ -0,0 +1,85 @@
+/*
+* 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 Lucene.Net.Util
+{
+    using System;
+    using System.Text.RegularExpressions;
+    using Lucene.Net.Support;
+    using Lucene.Net.TestFramework;
+
+
+    [System.CLSCompliant(false)]
+    public class TestConstants : LuceneTestCase
+    {
+
+        private string VersionDetails
+        {
+            get
+            {
+                return " (LUCENE_MAIN_VERSION=" + Constants.LUCENE_MAIN_VERSION + ", LUCENE_MAIN_VERSION(without
alpha/beta)=" + Constants.MainVersionWithoutAlphaBeta + ", LUCENE_VERSION=" + Constants.LUCENE_VERSION
+ ")";
+            }
+        }
+
+        [Test]
+        public void AssertValuesExist()
+        {
+            Ok(Constants.OS_NAME != null);
+            Ok(Constants.OS_VERSION != null);
+            Ok(Constants.OS_ARCH != null);
+            Ok(Constants.LUCENE_VERSION != null);
+            Console.WriteLine(" ");
+            Console.WriteLine("Constants");
+            Console.WriteLine("---------------------------------------");
+            Console.WriteLine("OS:              {0}", Constants.OS_NAME);
+            Console.WriteLine("OS Version:      {0}", Constants.OS_VERSION);
+            Console.WriteLine("OS Arch:         {0}", Constants.OS_ARCH);
+            Console.WriteLine("Lucene Version:  {0}", Constants.LUCENE_VERSION);
+            Console.WriteLine(" ");
+        }
+
+        [Test]
+        public virtual void TestLuceneMainVersionConstant()
+        {
+            Ok(Regex.IsMatch(Constants.LUCENE_MAIN_VERSION, "\\d+\\.\\d+(|\\.0\\.\\d+)",
RegexOptions.IgnoreCase), "LUCENE_MAIN_VERSION does not follow pattern: 'x.y' (stable release)
or 'x.y.0.z' (alpha/beta version)" + VersionDetails);
+            Ok(Constants.LUCENE_VERSION.StartsWith(Constants.MainVersionWithoutAlphaBeta),
"LUCENE_VERSION does not start with LUCENE_MAIN_VERSION (without alpha/beta marker)" + VersionDetails);
+        }
+
+        [Test]
+        public virtual void TestBuildSetup()
+        {
+            // common-build.xml sets lucene.version, if not, we skip this test!
+            string defaultVersion = "5.0";
+            string version = SystemProps.Get("lucene.version", defaultVersion);
+            Ok(version != null);
+
+            if (version != "5.0")
+            {
+                
+
+                // remove anything after a "-" from the version string:
+                version = Regex.Replace(version, "-.*$", "");
+                string versionConstant = Regex.Replace(Constants.LUCENE_VERSION, "-.*$",
"");
+                Ok(versionConstant.StartsWith(version) || version.StartsWith(versionConstant),
"LUCENE_VERSION should share the same prefix with lucene.version test property ('" + version
+ "')." + VersionDetails);
+            }
+        
+        }
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.Core.Tests/project.json
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/project.json b/test/Lucene.Net.Core.Tests/project.json
index ac20f75..88f672c 100644
--- a/test/Lucene.Net.Core.Tests/project.json
+++ b/test/Lucene.Net.Core.Tests/project.json
@@ -1,5 +1,6 @@
 {
     "licenses": ["apache 2.0"],
+    "version": "5.0.0.0",
     "compilationOptions": {
         "warningsAsErrors": false,
         "define": ["XUNIT"]
@@ -14,8 +15,8 @@
     "dependencies": {
         "Lucene.Net.Core":  "",
         "Lucene.Net.TestFramework": "",
-        "Xunit.KRunner": "1.0.0-*"
-
+        "Xunit.KRunner": "1.0.0-*",
+        "System.Console": "4.0.0.0"
     },
 
     "configurations" : {
@@ -28,6 +29,7 @@
             "dependencies": {
                 "System.Runtime": "4.0.20.0",
                 "System.Diagnostics.Debug": "4.0.10.0"
+              
             }
             
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
index f168d6c..32f35f1 100644
--- a/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
+++ b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
@@ -30,7 +30,7 @@
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Lucene.Net</RootNamespace>
-    <AssemblyName>Lucene.Net.TestFramework</AssemblyName>
+    <AssemblyName>Lucene.Net</AssemblyName>
     <DefaultLanguage>en-US</DefaultLanguage>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -62,7 +62,6 @@
     <Compile Include="Util\LuceneTestCase.cs" />
     <Compile Include="Util\RamUsageTester.cs" />
     <Compile Include="Util\TestAttribute.cs" />
-    <Compile Include="Util\TestUtil.cs" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="xunit.abstractions">

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
index 7947620..92fb464 100644
--- a/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
+++ b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
@@ -55,7 +55,6 @@
     <Compile Include="Util\LuceneTestCase.cs" />
     <Compile Include="Util\RamUsageTester.cs" />
     <Compile Include="Util\TestAttribute.cs" />
-    <Compile Include="Util\TestUtil.cs" />
   </ItemGroup>
   <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)'
!= ''" />
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index d46a3c0..1de4ad7 100644
--- a/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -20,7 +20,7 @@
  */
 
 
-namespace Lucene.Net.TestFramework
+namespace Lucene.Net.Util
 {
     using System;
     using System.Collections.Generic;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Util/TestAttribute.cs b/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
index f46af2b..161b075 100644
--- a/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
+++ b/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
@@ -19,7 +19,7 @@
  *
  */
 
-namespace Lucene.Net.TestFramework
+namespace Lucene.Net.Util
 {
     /// <summary>
     /// Summary description for TestAttribute

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.TestFramework/Util/TestUtil.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Util/TestUtil.cs b/test/Lucene.Net.TestFramework/Util/TestUtil.cs
deleted file mode 100644
index 14bdb47..0000000
--- a/test/Lucene.Net.TestFramework/Util/TestUtil.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace Lucene.Net.TestFramework
-{
-    /// <summary>
-    /// Summary description for TestUtil
-    /// </summary>
-    public class TestUtil
-    {
-	    public TestUtil()
-	    {
-		    //
-		    // TODO: Add constructor logic here
-		    //
-	    }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2c22a123/test/Lucene.Net.TestFramework/project.json
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/project.json b/test/Lucene.Net.TestFramework/project.json
index d432cb3..ba40649 100644
--- a/test/Lucene.Net.TestFramework/project.json
+++ b/test/Lucene.Net.TestFramework/project.json
@@ -1,5 +1,6 @@
 {
     "licenses": ["apache 2.0"],
+      "version": "5.0.0.0",
     "compilationOptions": {
         "warningsAsErrors": false,
         "define": ["XUNIT"]


Mime
View raw message