lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r567915 - /incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
Date Tue, 21 Aug 2007 02:37:02 GMT
Author: aroush
Date: Mon Aug 20 19:37:02 2007
New Revision: 567915

URL: http://svn.apache.org/viewvc?rev=567915&view=rev
Log:
Fix: LUCENENET-72 "TestIndexReader bugs"

Modified:
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexReader.cs?rev=567915&r1=567914&r2=567915&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs Mon Aug 20 19:37:02 2007
@@ -453,7 +453,8 @@
             _TestUtil.RmDir(dirFile);
         }
 		
-		public virtual void  testLastModified()
+        [Test]
+		public virtual void  TestLastModified()
 		{
 			Assert.IsFalse(IndexReader.IndexExists("there_is_no_such_index"));
 			Directory dir = new RAMDirectory();
@@ -482,31 +483,6 @@
             return FSDirectory.GetDirectory(new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir",
""), "testIndex")));
 		}
 		
-		[Test]
-        public virtual void  TestLastModified()
-		{
-			Assert.IsFalse(IndexReader.IndexExists("there_is_no_such_index"));
-			Directory dir = new RAMDirectory();
-			Assert.IsFalse(IndexReader.IndexExists(dir));
-			IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true);
-			AddDocumentWithFields(writer);
-			Assert.IsTrue(IndexReader.IsLocked(dir)); // writer open, so dir is locked
-			writer.Close();
-			Assert.IsTrue(IndexReader.IndexExists(dir));
-			IndexReader reader = IndexReader.Open(dir);
-			Assert.IsFalse(IndexReader.IsLocked(dir)); // reader only, no lock
-			long version = IndexReader.LastModified(dir);
-			reader.Close();
-			// modify index and check version has been incremented:
-            // incremented:
-            writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true);
-			AddDocumentWithFields(writer);
-			writer.Close();
-			reader = IndexReader.Open(dir);
-            Assert.IsTrue(version <= IndexReader.LastModified(dir), "old lastModified
is " + version + "; new lastModified is " + IndexReader.LastModified(dir));
-            reader.Close();
-		}
-		
         [Test]
         public virtual void  TestVersion()
         {
@@ -764,7 +740,7 @@
                     //  System.out.println("  startFiles: " + i + ": " + startFiles[i]);
                     //}
 					
-                    if (!startFiles.Equals(endFiles))
+                    if (Test.SupportClass.Compare.CompareStringArrays(startFiles, endFiles)
== false)
                     {
                         System.String successStr;
                         if (success)



Mime
View raw message