lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject git commit: putting in a stop gap measure to allow AtLeast to use the Random property from RandomContext. Adding a NuGet.config so that the nested solution files will all use the same packages folder in the root of the project rather than a path relative
Date Tue, 05 Aug 2014 19:48:22 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/branch_4x dad8de083 -> 8f02e8808


putting in a stop gap measure to allow AtLeast to use the Random property from RandomContext.
Adding a NuGet.config so that the nested solution files will all use the same packages folder
in the root of the project rather than a path relative to the solution file.


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

Branch: refs/heads/branch_4x
Commit: 8f02e8808ade8a5dc9ffeb9dd7327345de7a1a46
Parents: dad8de0
Author: Michael Herndon <mherndon@michaelherndon.com>
Authored: Tue Aug 5 15:46:53 2014 -0400
Committer: Michael Herndon <mherndon@michaelherndon.com>
Committed: Tue Aug 5 15:46:53 2014 -0400

----------------------------------------------------------------------
 .nuget/NuGet.targets                            |  2 +-
 NuGet.config                                    |  6 ++++
 test/core/Lucene.Net.Test.csproj                |  5 ++--
 .../Lucene.Net.TestFramework.csproj             |  2 +-
 test/test-framework/LuceneTestCase.cs           |  3 +-
 .../Randomized/RandomizedContext.cs             | 31 ++++++++++++++++++--
 6 files changed, 40 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8f02e880/.nuget/NuGet.targets
----------------------------------------------------------------------
diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets
index f943812..6ae189c 100644
--- a/.nuget/NuGet.targets
+++ b/.nuget/NuGet.targets
@@ -53,7 +53,7 @@
         <NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
         <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319
$(NuGetExePath)</NuGetCommand>
 
-        <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
+        <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))\\..</PackageOutputDir>
 
         <RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
         <NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' ==
'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8f02e880/NuGet.config
----------------------------------------------------------------------
diff --git a/NuGet.config b/NuGet.config
new file mode 100644
index 0000000..4f609dd
--- /dev/null
+++ b/NuGet.config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <config>
+  	<add key="repositoryPath" value="packages" />	
+  </config>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8f02e880/test/core/Lucene.Net.Test.csproj
----------------------------------------------------------------------
diff --git a/test/core/Lucene.Net.Test.csproj b/test/core/Lucene.Net.Test.csproj
index 864cfc3..0fd3292 100644
--- a/test/core/Lucene.Net.Test.csproj
+++ b/test/core/Lucene.Net.Test.csproj
@@ -177,8 +177,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\lib\ICSharpCode\SharpZipLib\0.85\ICSharpCode.SharpZipLib.dll</HintPath>
     </Reference>
-    <Reference Include="nunit.framework">
-      <HintPath>..\..\build\vs2013\test\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
+    <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77,
processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="System">
       <Name>System</Name>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8f02e880/test/test-framework/Lucene.Net.TestFramework.csproj
----------------------------------------------------------------------
diff --git a/test/test-framework/Lucene.Net.TestFramework.csproj b/test/test-framework/Lucene.Net.TestFramework.csproj
index acf8430..4aa8f69 100644
--- a/test/test-framework/Lucene.Net.TestFramework.csproj
+++ b/test/test-framework/Lucene.Net.TestFramework.csproj
@@ -44,7 +44,7 @@
   <ItemGroup>
     <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77,
processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\build\vs2013\test\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
+      <HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.configuration" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8f02e880/test/test-framework/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/test/test-framework/LuceneTestCase.cs b/test/test-framework/LuceneTestCase.cs
index 0460700..8586c9c 100644
--- a/test/test-framework/LuceneTestCase.cs
+++ b/test/test-framework/LuceneTestCase.cs
@@ -557,8 +557,7 @@ namespace Lucene.Net
 
         public static int AtLeast(int minimum)
         {
-            return AtLeast(new Random(), minimum);
-            //return AtLeast(RandomizedContext.Current.Random, minimum);
+            return AtLeast(RandomizedContext.Current.Random, minimum);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8f02e880/test/test-framework/Randomized/RandomizedContext.cs
----------------------------------------------------------------------
diff --git a/test/test-framework/Randomized/RandomizedContext.cs b/test/test-framework/Randomized/RandomizedContext.cs
index 9a8cad2..511fd3e 100644
--- a/test/test-framework/Randomized/RandomizedContext.cs
+++ b/test/test-framework/Randomized/RandomizedContext.cs
@@ -73,6 +73,7 @@ namespace Lucene.Net.Randomized
         public Randomness Randomness
         {
             get {
+                
                 var randomness = this.PerThreadResources.Queue.Peek();
                 return randomness;
             }
@@ -85,9 +86,23 @@ namespace Lucene.Net.Randomized
                 this.GuardDiposed();
                 lock (contextLock)
                 {
-                    var resource = threadResources[Thread.CurrentThread];
+                    var resources = threadResources[Thread.CurrentThread];
 
-                    return resource;
+                    // TODO: remove after completion
+
+                    if(resources == null)
+                    {
+                        resources = new ThreadResources();
+                        threadResources.Add(Thread.CurrentThread, resources);
+                    }
+
+                    if(resources.Queue.Count == 0)
+                    {
+                        resources.Queue.Enqueue(new Randomness(Thread.CurrentThread, (int)DateTime.Now.Ticks));
+                       
+                    }
+
+                    return resources;
                 }
             }
         }
@@ -142,7 +157,17 @@ namespace Lucene.Net.Randomized
                 if (!context.threadResources.ContainsKey(thread))
                 {
                     var resources = new ThreadResources();
-                    resources.Queue.Enqueue(context.runner.Randomness.Clone(thread));
+                    if(context.runner != null )
+                    {
+                        resources.Queue.Enqueue(context.runner.Randomness.Clone(thread));
+                    }
+                         
+                    
+                    if(context.Randomness == null)
+                    {
+                        resources.Queue.Enqueue(new Randomness(thread, (int)DateTime.Now.Ticks));
+                    }
+
 
                     context.threadResources.Add(thread, resources);
                 }


Mime
View raw message