You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ar...@apache.org on 2007/08/11 18:56:44 UTC

svn commit: r564939 [8/8] - in /incubator/lucene.net/trunk/C#/src: ./ Demo/ Demo/DeleteFiles/ Demo/DemoLib/ Demo/IndexFiles/ Demo/IndexHtml/ Demo/SearchFiles/ Lucene.Net/ Lucene.Net/Analysis/Standard/ Lucene.Net/Document/ Lucene.Net/Index/ Lucene.Net/Q...

Modified: incubator/lucene.net/trunk/C#/src/Test/Test.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Test.csproj?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Test.csproj (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Test.csproj Sat Aug 11 09:56:37 2007
@@ -231,11 +231,29 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\index.prelockless.cfs.zip"
+                    BuildAction = "None"
+                />
+                <File
+                    RelPath = "Index\index.prelockless.nocfs.zip"
+                    BuildAction = "None"
+                />
+                <File
                     RelPath = "Index\MockIndexInput.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\TestAddIndexesNoOptimize.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Index\TestBackwardsCompatibility.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Index\TestCompoundFile.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -266,6 +284,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\TestIndexFileDeleter.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Index\TestIndexInput.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -286,21 +309,56 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\TestIndexWriterDelete.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Index\TestIndexWriterLockRelease.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Index\TestIndexWriterMergePolicy.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Index\TestIndexWriterMerging.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\TestLazyBug.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Index\TestLazyProxSkipping.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Index\TestMultiReader.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\TestNorms.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Index\TestParallelReader.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Index\TestParallelTermEnum.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Index\TestSegmentMerger.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -321,22 +379,27 @@
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "Index\TestTermVectorsReader.cs"
+                    RelPath = "Index\TestStressIndexing.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "Index\TestTermVectorsWriter.cs"
+                    RelPath = "Index\TestTermdocPerf.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "Index\TestWordlistLoader.cs"
+                    RelPath = "Index\TestTermVectorsReader.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "Index\Store\_delete_TestFSDirectory.cs"
+                    RelPath = "Index\TestTermVectorsWriter.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Index\TestWordlistLoader.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
@@ -426,6 +489,16 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestComplexExplanations.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Search\TestComplexExplanationsOfNonMatches.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestConstantScoreRangeQuery.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -451,6 +524,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestExplanations.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestFilteredQuery.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -511,6 +589,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestPrefixFilter.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestPrefixQuery.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -536,6 +619,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestScorerPerf.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestSetNorm.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -546,16 +634,36 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestSimpleExplanations.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Search\TestSimpleExplanationsOfNonMatches.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestSort.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestTermScorer.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestTermVectors.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\TestThreadSafe.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\TestWildcard.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -566,6 +674,21 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Search\Spans\TestNearSpansOrdered.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Search\Spans\TestSpanExplanations.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Search\Spans\TestSpanExplanationsOfNonMatches.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Search\Spans\TestSpans.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -586,7 +709,37 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Store\MockRAMDirectory.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Store\MockRAMOutputStream.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Store\TestBufferedIndexInput.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Store\TestLock.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Store\TestLockFactory.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Store\TestWindowsMMap.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Util\_TestUtil.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
                 />

Modified: incubator/lucene.net/trunk/C#/src/Test/TestDemo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/TestDemo.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestDemo.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestDemo.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,9 @@
  */
 
 using System;
+
+using NUnit.Framework;
+
 using Analyzer = Lucene.Net.Analysis.Analyzer;
 using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 using Document = Lucene.Net.Documents.Document;
@@ -28,7 +31,6 @@
 using Query = Lucene.Net.Search.Query;
 using Directory = Lucene.Net.Store.Directory;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-using NUnit.Framework;
 
 namespace Lucene.Net
 {

Modified: incubator/lucene.net/trunk/C#/src/Test/TestHitIterator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/TestHitIterator.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestHitIterator.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestHitIterator.cs Sat Aug 11 09:56:37 2007
@@ -16,18 +16,20 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using Term = Lucene.Net.Index.Term;
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
-using IndexWriter = Lucene.Net.Index.IndexWriter;
-using Term = Lucene.Net.Index.Term;
-using Hit = Lucene.Net.Search.Hit;
-using HitIterator = Lucene.Net.Search.HitIterator;
-using Hits = Lucene.Net.Search.Hits;
 using IndexSearcher = Lucene.Net.Search.IndexSearcher;
 using TermQuery = Lucene.Net.Search.TermQuery;
-using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using Hits = Lucene.Net.Search.Hits;
+using Hit = Lucene.Net.Search.Hit;
+using HitIterator = Lucene.Net.Search.HitIterator;
 
 namespace Lucene.Net
 {

Modified: incubator/lucene.net/trunk/C#/src/Test/TestSearch.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/TestSearch.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestSearch.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestSearch.cs Sat Aug 11 09:56:37 2007
@@ -16,14 +16,16 @@
  */
 
 using System;
+
 using NUnit.Framework;
-using Lucene.Net.Analysis;
+
+using Lucene.Net.Store;
 using Lucene.Net.Documents;
+using Lucene.Net.Analysis;
 using Lucene.Net.Index;
-using Lucene.Net.QueryParsers;
 using Lucene.Net.Search;
 using Searchable = Lucene.Net.Search.Searchable;
-using Lucene.Net.Store;
+using Lucene.Net.QueryParsers;
 
 namespace Lucene.Net
 {

Modified: incubator/lucene.net/trunk/C#/src/Test/TestSearchForDuplicates.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/TestSearchForDuplicates.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestSearchForDuplicates.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestSearchForDuplicates.cs Sat Aug 11 09:56:37 2007
@@ -16,14 +16,16 @@
  */
 
 using System;
-using Lucene.Net.Analysis;
+
+using NUnit.Framework;
+
+using Lucene.Net.Store;
 using Lucene.Net.Documents;
+using Lucene.Net.Analysis;
 using Lucene.Net.Index;
-using Lucene.Net.QueryParsers;
 using Lucene.Net.Search;
 using Searchable = Lucene.Net.Search.Searchable;
-using Lucene.Net.Store;
-using NUnit.Framework;
+using Lucene.Net.QueryParsers;
 
 namespace Lucene.Net
 {
@@ -92,7 +94,6 @@
 			
 			writer.SetUseCompoundFile(useCompoundFiles);
 			
-			//UPGRADE_NOTE: Final was removed from the declaration of 'MAX_DOCS '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
 			int MAX_DOCS = 225;
 			
 			for (int j = 0; j < MAX_DOCS; j++)
@@ -111,7 +112,6 @@
 			Lucene.Net.QueryParsers.QueryParser parser = new Lucene.Net.QueryParsers.QueryParser(PRIORITY_FIELD, analyzer);
 			
 			Query query = parser.Parse(HIGH_PRIORITY);
-			//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
 			out_Renamed.WriteLine("Query: " + query.ToString(PRIORITY_FIELD));
 			
 			hits = searcher.Search(query);
@@ -127,7 +127,6 @@
 			parser = new Lucene.Net.QueryParsers.QueryParser(PRIORITY_FIELD, analyzer);
 			
 			query = parser.Parse(HIGH_PRIORITY + " OR " + MED_PRIORITY);
-			//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
 			out_Renamed.WriteLine("Query: " + query.ToString(PRIORITY_FIELD));
 			
 			hits = searcher.Search(query);
@@ -140,14 +139,12 @@
 		
 		private void  PrintHits(System.IO.StreamWriter out_Renamed, Hits hits)
 		{
-			//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
 			out_Renamed.WriteLine(hits.Length() + " total results\n");
 			for (int i = 0; i < hits.Length(); i++)
 			{
 				if (i < 10 || (i > 94 && i < 105))
 				{
 					Lucene.Net.Documents.Document d = hits.Doc(i);
-					//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
 					out_Renamed.WriteLine(i + " " + d.Get(ID_FIELD));
 				}
 			}

Modified: incubator/lucene.net/trunk/C#/src/Test/ThreadSafetyTest.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/ThreadSafetyTest.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/ThreadSafetyTest.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/ThreadSafetyTest.cs Sat Aug 11 09:56:37 2007
@@ -16,14 +16,15 @@
  */
 
 using System;
-using Lucene.Net.Analysis;
+
+using Lucene.Net.Util;
+using Lucene.Net.Store;
 using Lucene.Net.Documents;
+using Lucene.Net.Analysis;
 using Lucene.Net.Index;
-using Lucene.Net.QueryParsers;
 using Lucene.Net.Search;
 using Searchable = Lucene.Net.Search.Searchable;
-using Lucene.Net.Store;
-using Lucene.Net.Util;
+using Lucene.Net.QueryParsers;
 
 namespace Lucene.Net
 {
@@ -180,7 +181,7 @@
 				System.IO.Directory.CreateDirectory(indexDir.FullName);
 			}
 			
-			IndexReader.Unlock(FSDirectory.GetDirectory(indexDir, false));
+			IndexReader.Unlock(FSDirectory.GetDirectory(indexDir));
 			
 			if (!readOnly)
 			{

Modified: incubator/lucene.net/trunk/C#/src/Test/Util/TestBitVector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Util/TestBitVector.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Util/TestBitVector.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Util/TestBitVector.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using Directory = Lucene.Net.Store.Directory;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
 
@@ -28,8 +30,8 @@
 	/// </summary>
 	/// <author>  "Peter Mularien" <pm...@deploy.com>
 	/// </author>
-	/// <version>  $Id: TestBitVector.java 150259 2004-03-29 22:48:07Z cutting $
-	/// </version>
+    /// <version>  $Id: TestBitVector.java 485463 2006-12-11 02:03:38Z yonik $
+    /// </version>
 	[TestFixture]
     public class TestBitVector
 	{
@@ -169,7 +171,53 @@
 			}
 		}
 		
-		/// <summary> Compare two BitVectors.
+        /// <summary> Test r/w when size/count cause switching between bit-set and d-gaps file formats.  </summary>
+        /// <throws>  Exception </throws>
+        [Test]
+        public virtual void  TestDgaps()
+        {
+            DoTestDgaps(1, 0, 1);
+            DoTestDgaps(10, 0, 1);
+            DoTestDgaps(100, 0, 1);
+            DoTestDgaps(1000, 4, 7);
+            DoTestDgaps(10000, 40, 43);
+            DoTestDgaps(100000, 415, 418);
+            DoTestDgaps(1000000, 3123, 3126);
+        }
+		
+        private void  DoTestDgaps(int size, int count1, int count2)
+        {
+            Directory d = new RAMDirectory();
+            BitVector bv = new BitVector(size);
+            for (int i = 0; i < count1; i++)
+            {
+                bv.Set(i);
+                Assert.AreEqual(i + 1, bv.Count());
+            }
+            bv.Write(d, "TESTBV");
+            // gradually increase number of set bits
+            for (int i = count1; i < count2; i++)
+            {
+                BitVector bv2 = new BitVector(d, "TESTBV");
+                Assert.IsTrue(DoCompare(bv, bv2));
+                bv = bv2;
+                bv.Set(i);
+                Assert.AreEqual(i + 1, bv.Count());
+                bv.Write(d, "TESTBV");
+            }
+            // now start decreasing number of set bits
+            for (int i = count2 - 1; i >= count1; i--)
+            {
+                BitVector bv2 = new BitVector(d, "TESTBV");
+                Assert.IsTrue(DoCompare(bv, bv2));
+                bv = bv2;
+                bv.Clear(i);
+                Assert.AreEqual(i, bv.Count());
+                bv.Write(d, "TESTBV");
+            }
+        }
+
+        /// <summary> Compare two BitVectors.
 		/// This should really be an equals method on the BitVector itself.
 		/// </summary>
 		/// <param name="bv">One bit vector

Modified: incubator/lucene.net/trunk/C#/src/Test/Util/TestPriorityQueue.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Util/TestPriorityQueue.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Util/TestPriorityQueue.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Util/TestPriorityQueue.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using NUnit.Framework;
 
 namespace Lucene.Net.Util

Modified: incubator/lucene.net/trunk/C#/src/Test/Util/TestSmallFloat.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Util/TestSmallFloat.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Util/TestSmallFloat.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Util/TestSmallFloat.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using NUnit.Framework;
 
 namespace Lucene.Net.Util

Modified: incubator/lucene.net/trunk/C#/src/Test/Util/TestStringHelper.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Util/TestStringHelper.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Util/TestStringHelper.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Util/TestStringHelper.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using NUnit.Framework;
 
 namespace Lucene.Net.Util

Added: incubator/lucene.net/trunk/C#/src/Test/Util/_TestUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Util/_TestUtil.cs?view=auto&rev=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Util/_TestUtil.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/Util/_TestUtil.cs Sat Aug 11 09:56:37 2007
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+using System;
+
+namespace Lucene.Net.Util
+{
+	
+	public class _TestUtil
+	{
+		
+		public static void  RmDir(System.IO.FileInfo dir)
+		{
+			bool tmpBool;
+			if (System.IO.File.Exists(dir.FullName))
+				tmpBool = true;
+			else
+				tmpBool = System.IO.Directory.Exists(dir.FullName);
+			if (tmpBool)
+			{
+				System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(dir);
+				for (int i = 0; i < files.Length; i++)
+				{
+					bool tmpBool2;
+					if (System.IO.File.Exists(files[i].FullName))
+					{
+						System.IO.File.Delete(files[i].FullName);
+						tmpBool2 = true;
+					}
+					else if (System.IO.Directory.Exists(files[i].FullName))
+					{
+						System.IO.Directory.Delete(files[i].FullName);
+						tmpBool2 = true;
+					}
+					else
+						tmpBool2 = false;
+					if (!tmpBool2)
+					{
+						throw new System.IO.IOException("could not delete " + files[i]);
+					}
+				}
+				bool tmpBool3;
+				if (System.IO.File.Exists(dir.FullName))
+				{
+					System.IO.File.Delete(dir.FullName);
+					tmpBool3 = true;
+				}
+				else if (System.IO.Directory.Exists(dir.FullName))
+				{
+					System.IO.Directory.Delete(dir.FullName);
+					tmpBool3 = true;
+				}
+				else
+					tmpBool3 = false;
+				bool generatedAux = tmpBool3;
+			}
+		}
+		
+		public static void  RmDir(System.String dir)
+		{
+			RmDir(new System.IO.FileInfo(dir));
+		}
+	}
+}
\ No newline at end of file