lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1082446 [1/3] - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/Index/ Lucene.Net/Store/ Test/Index/ Test/Store/
Date Thu, 17 Mar 2011 10:57:59 GMT
Author: digy
Date: Thu Mar 17 10:57:58 2011
New Revision: 1082446

URL: http://svn.apache.org/viewvc?rev=1082446&view=rev
Log:
LUCENENET-399 Remaining test cases. Only 5 new test files(added in v2.9.3 or v2.9.4) are left.

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterExceptions.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterMergePolicy.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterReader.cs
    incubator/lucene.net/trunk/C#/src/Test/Store/MockRAMDirectory.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexReader.cs?rev=1082446&r1=1082445&r2=1082446&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs Thu Mar 17 10:57:58
2011
@@ -1503,7 +1503,7 @@ namespace Lucene.Net.Index
 		/// (transactional semantics).
 		/// </summary>
 		/// <throws>  IOException if there is a low-level IO error </throws>
-        protected internal void Commit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
+        public void Commit(System.Collections.Generic.IDictionary<string, string> commitUserData)
 		{
 			lock (this)
 			{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/RAMDirectory.cs?rev=1082446&r1=1082445&r2=1082446&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs Thu Mar 17 10:57:58
2011
@@ -33,8 +33,8 @@ namespace Lucene.Net.Store
 		
 		private const long serialVersionUID = 1L;
 		
-		internal System.Collections.Hashtable fileMap = new System.Collections.Hashtable();
-		internal long sizeInBytes = 0;
+		internal protected System.Collections.Hashtable fileMap = new System.Collections.Hashtable();
+		internal protected long sizeInBytes = 0;
 		
 		// *****
 		// Lock acquisition sequence:  RAMDirectory, then RAMFile

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=1082446&r1=1082445&r2=1082446&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs Thu Mar 17 10:57:58 2011
@@ -2097,5 +2097,27 @@ namespace Lucene.Net.Index
 			r2.Close();
 			dir.Close();
 		}
+
+        // LUCENE-2046
+        [Test]
+        public void TestPrepareCommitIsCurrent()
+        {
+            Directory dir = new MockRAMDirectory();
+            IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+            Document doc = new Document();
+            writer.AddDocument(doc);
+            IndexReader r = IndexReader.Open(dir, true);
+            Assert.IsTrue(r.IsCurrent());
+            writer.AddDocument(doc);
+            writer.PrepareCommit();
+            Assert.IsTrue(r.IsCurrent());
+            IndexReader r2 = r.Reopen();
+            Assert.IsTrue(r == r2);
+            writer.Commit();
+            Assert.IsFalse(r.IsCurrent());
+            writer.Close();
+            r.Close();
+            dir.Close();
+        }
 	}
 }
\ No newline at end of file



Mime
View raw message