lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject [Lucene.Net] svn commit: r1202091 [6/6] - in /incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk: src/core/ src/core/Index/ src/core/Search/ src/core/Store/ src/demo/Demo.Common/ test/core/ test/core/Analysis/ test/core/Index/ test/core/QueryParser/ test/core/Sea...
Date Tue, 15 Nov 2011 08:41:46 GMT
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestDirectory.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestDirectory.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestDirectory.cs
Tue Nov 15 08:41:44 2011
@@ -43,7 +43,7 @@ namespace Lucene.Net.Store
 			{
 			}
 			
-			dir = FSDirectory.Open(new System.IO.FileInfo(AppSettings.Get("tempDir", System.IO.Path.GetTempPath())));
+			dir = FSDirectory.Open(new System.IO.DirectoryInfo(AppSettings.Get("tempDir", System.IO.Path.GetTempPath())));
 			dir.Close();
 			try
 			{
@@ -61,7 +61,7 @@ namespace Lucene.Net.Store
 		[Test]
 		public virtual void  TestDirectInstantiation()
 		{
-			System.IO.FileInfo path = new System.IO.FileInfo(AppSettings.Get("tempDir", System.IO.Path.GetTempPath()));
+			System.IO.DirectoryInfo path = new System.IO.DirectoryInfo(AppSettings.Get("tempDir",
System.IO.Path.GetTempPath()));
 			
 			int sz = 2;
 			Directory[] dirs = new Directory[sz];
@@ -145,7 +145,7 @@ namespace Lucene.Net.Store
 		[Test]
 		public virtual void  TestDontCreate()
 		{
-			System.IO.FileInfo path = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "doesnotexist"));
+			System.IO.DirectoryInfo path = new System.IO.DirectoryInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "doesnotexist"));
 			try
 			{
 				bool tmpBool;
@@ -180,7 +180,7 @@ namespace Lucene.Net.Store
 		[Test]
 		public virtual void  TestFSDirectoryFilter()
 		{
-			CheckDirectoryFilter(FSDirectory.Open(new System.IO.FileInfo("test")));
+			CheckDirectoryFilter(FSDirectory.Open(new System.IO.DirectoryInfo("test")));
 		}
 		
 		// LUCENE-1468
@@ -203,11 +203,11 @@ namespace Lucene.Net.Store
 		[Test]
 		public virtual void  TestCopySubdir()
 		{
-			System.IO.FileInfo path = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "testsubdir"));
+			System.IO.DirectoryInfo path = new System.IO.DirectoryInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "testsubdir"));
 			try
 			{
 				System.IO.Directory.CreateDirectory(path.FullName);
-				System.IO.Directory.CreateDirectory(new System.IO.FileInfo(System.IO.Path.Combine(path.FullName,
"subdir")).FullName);
+				System.IO.Directory.CreateDirectory(new System.IO.DirectoryInfo(System.IO.Path.Combine(path.FullName,
"subdir")).FullName);
 				Directory fsDir = new SimpleFSDirectory(path, null);
 				Assert.AreEqual(0, new RAMDirectory(fsDir).ListAll().Length);
 			}
@@ -221,7 +221,7 @@ namespace Lucene.Net.Store
 		[Test]
 		public virtual void  TestNotDirectory()
 		{
-			System.IO.FileInfo path = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "testnotdir"));
+			System.IO.DirectoryInfo path = new System.IO.DirectoryInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "testnotdir"));
 			Directory fsDir = new SimpleFSDirectory(path, null);
 			try
 			{
@@ -230,7 +230,7 @@ namespace Lucene.Net.Store
 				Assert.IsTrue(fsDir.FileExists("afile"));
 				try
 				{
-					new SimpleFSDirectory(new System.IO.FileInfo(System.IO.Path.Combine(path.FullName, "afile")),
null);
+					new SimpleFSDirectory(new System.IO.DirectoryInfo(System.IO.Path.Combine(path.FullName,
"afile")), null);
 					Assert.Fail("did not hit expected exception");
 				}
 				catch (NoSuchDirectoryException nsde)

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestHugeRamFile.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestHugeRamFile.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestHugeRamFile.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestHugeRamFile.cs
Tue Nov 15 08:41:44 2011
@@ -42,15 +42,15 @@ namespace Lucene.Net.Store
 			public /*internal*/ override byte[] NewBuffer(int size)
 			{
 				capacity += size;
-				if (capacity <= Lucene.Net.Store.TestHugeRamFile.MAX_VALUE)
+				if (capacity <= MAX_VALUE)
 				{
 					// below maxint we reuse buffers
-					byte[] buf = (byte[]) singleBuffers[(System.Int32) size];
+					byte[] buf = (byte[]) singleBuffers[size];
 					if (buf == null)
 					{
 						buf = new byte[size];
 						//System.out.println("allocate: "+size);
-						singleBuffers[(System.Int32) size] = buf;
+						singleBuffers[size] = buf;
 					}
 					return buf;
 				}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestLockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestLockFactory.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestLockFactory.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestLockFactory.cs
Tue Nov 15 08:41:44 2011
@@ -134,217 +134,13 @@ namespace Lucene.Net.Store
 				writer2.Close();
 			}
 		}
-		
-		// Verify: SimpleFSLockFactory is the default for FSDirectory
-		// Verify: FSDirectory does basic locking correctly
-		[Test]
-		public virtual void  TestDefaultFSDirectory()
-		{
-			System.IO.FileInfo indexDirName = _TestUtil.GetTempDir("index.TestLockFactory1");
-			
-			IndexWriter writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-			
-			Assert.IsTrue(typeof(SimpleFSLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory())
|| typeof(NativeFSLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()), "FSDirectory
did not use correct LockFactory: got " + writer.GetDirectory().GetLockFactory());
-			
-			IndexWriter writer2 = null;
-			
-			// Create a 2nd IndexWriter.  This should fail:
-			try
-			{
-				writer2 = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
-				Assert.Fail("Should have hit an IOException with two IndexWriters on default SimpleFSLockFactory");
-			}
-			catch (System.IO.IOException e)
-			{
-			}
-			
-			writer.Close();
-			if (writer2 != null)
-			{
-				writer2.Close();
-			}
-			
-			// Cleanup
-			_TestUtil.RmDir(indexDirName);
-		}
-		
-		// Verify: FSDirectory's default lockFactory clears all locks correctly
-		[Test]
-		public virtual void  TestFSDirectoryTwoCreates()
-		{
-			System.IO.FileInfo indexDirName = _TestUtil.GetTempDir("index.TestLockFactory2");
-			
-			IndexWriter writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-			
-			Assert.IsTrue(typeof(SimpleFSLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory())
|| typeof(NativeFSLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()), "FSDirectory
did not use correct LockFactory: got " + writer.GetDirectory().GetLockFactory());
-			
-			// Intentionally do not close the first writer here.
-			// The goal is to "simulate" a crashed writer and
-			// ensure the second writer, with create=true, is
-			// able to remove the lock files.  This works OK
-			// with SimpleFSLockFactory as the locking
-			// implementation.  Note, however, that this test
-			// will not work on WIN32 when we switch to
-			// NativeFSLockFactory as the default locking for
-			// FSDirectory because the second IndexWriter cannot
-			// remove those lock files since they are held open
-			// by the first writer.  This is because leaving the
-			// first IndexWriter open is not really a good way
-			// to simulate a crashed writer.
-			
-			// Create a 2nd IndexWriter.  This should not fail:
-			IndexWriter writer2 = null;
-			try
-			{
-				writer2 = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-			}
-			catch (System.IO.IOException e)
-			{
-				System.Console.Out.WriteLine(e.StackTrace);
-				Assert.Fail("Should not have hit an IOException with two IndexWriters with create=true,
on default SimpleFSLockFactory");
-			}
-			
-			writer.Close();
-			if (writer2 != null)
-			{
-				try
-				{
-					writer2.Close();
-					// expected
-				}
-				catch (LockReleaseFailedException e)
-				{
-					Assert.Fail("writer2.close() should not have hit LockReleaseFailedException");
-				}
-			}
-			
-			// Cleanup
-			_TestUtil.RmDir(indexDirName);
-		}
-		
-		
-		// Verify: setting custom lock factory class (as system property) works:
-		// Verify: all 4 builtin LockFactory implementations are
-		//         settable this way 
-		// Verify: FSDirectory does basic locking correctly
-		[Test]
-		public virtual void  TestLockClassProperty()
-		{
-			System.IO.FileInfo indexDirName = _TestUtil.GetTempDir("index.TestLockFactory3");
-			System.String prpName = "Lucene.Net.Store.FSDirectoryLockFactoryClass";
-			
-			try
-			{
-				
-				// NoLockFactory:
-				AppSettings.Set(prpName, "Lucene.Net.Store.NoLockFactory");
-				IndexWriter writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-				Assert.IsTrue(typeof(NoLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()),
"FSDirectory did not use correct LockFactory: got " + writer.GetDirectory().GetLockFactory());
-				writer.Close();
-				
-				// SingleInstanceLockFactory:
-				AppSettings.Set(prpName, "Lucene.Net.Store.SingleInstanceLockFactory");
-				writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-				Assert.IsTrue(typeof(SingleInstanceLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()),
"FSDirectory did not use correct LockFactory: got " + writer.GetDirectory().GetLockFactory());
-				writer.Close();
-				
-				// NativeFSLockFactory:
-				AppSettings.Set(prpName, "Lucene.Net.Store.NativeFSLockFactory");
-				writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-				Assert.IsTrue(typeof(NativeFSLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()),
"FSDirectory did not use correct LockFactory: got " + writer.GetDirectory().GetLockFactory());
-				writer.Close();
-				
-				// SimpleFSLockFactory:
-				AppSettings.Set(prpName, "Lucene.Net.Store.SimpleFSLockFactory");
-				writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-				Assert.IsTrue(typeof(SimpleFSLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()),
"FSDirectory did not use correct LockFactory: got " + writer.GetDirectory().GetLockFactory());
-				writer.Close();
-			}
-			finally
-			{
-				// Put back to the correct default for subsequent tests:
-				AppSettings.Set("Lucene.Net.Store.FSDirectoryLockFactoryClass", "");
-			}
-			
-			// Cleanup
-			_TestUtil.RmDir(indexDirName);
-		}
-		
-		// Verify: setDisableLocks works
-		[Test]
-		public virtual void  TestDisableLocks()
-		{
-			System.IO.FileInfo indexDirName = _TestUtil.GetTempDir("index.TestLockFactory4");
-			
-			Assert.IsTrue(!FSDirectory.GetDisableLocks(), "Locks are already disabled");
-			FSDirectory.SetDisableLocks(true);
-			
-			IndexWriter writer = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-			
-			Assert.IsTrue(typeof(NoLockFactory).IsInstanceOfType(writer.GetDirectory().GetLockFactory()),
"FSDirectory did not use correct default LockFactory: got " + writer.GetDirectory().GetLockFactory());
-			
-			// Should be no error since locking is disabled:
-			IndexWriter writer2 = null;
-			try
-			{
-				writer2 = new IndexWriter(indexDirName, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
-			}
-			catch (System.IO.IOException e)
-			{
-				System.Console.Out.WriteLine(e.StackTrace);
-				Assert.Fail("Should not have hit an IOException with locking disabled");
-			}
-			
-			FSDirectory.SetDisableLocks(false);
-			writer.Close();
-			if (writer2 != null)
-			{
-				writer2.Close();
-			}
-			// Cleanup
-			_TestUtil.RmDir(indexDirName);
-		}
-		
-		// Verify: if I try to getDirectory() with two different locking implementations, I get
an IOException
-		[Test]
-		public virtual void  TestFSDirectoryDifferentLockFactory()
-		{
-			System.IO.FileInfo indexDirName = _TestUtil.GetTempDir("index.TestLockFactory5");
-			
-			LockFactory lf = new SingleInstanceLockFactory();
-			FSDirectory fs1 = FSDirectory.GetDirectory(indexDirName, lf);
-			
-			// Different lock factory instance should hit IOException:
-			try
-			{
-				FSDirectory.GetDirectory(indexDirName, new SingleInstanceLockFactory());
-				Assert.Fail("Should have hit an IOException because LockFactory instances differ");
-			}
-			catch (System.IO.IOException e)
-			{
-			}
-			
-			FSDirectory fs2 = null;
-			
-			// Same lock factory instance should not:
-			try
-			{
-				fs2 = FSDirectory.GetDirectory(indexDirName, lf);
-			}
-			catch (System.IO.IOException e)
-			{
-				System.Console.Out.WriteLine(e.StackTrace);
-				Assert.Fail("Should not have hit an IOException because LockFactory instances are the
same");
-			}
-			
-			fs1.Close();
-			if (fs2 != null)
-			{
-				fs2.Close();
-			}
-			// Cleanup
-			_TestUtil.RmDir(indexDirName);
-		}
+
+        [Test]
+        public void TestSimpleFSLockFactory()
+        {
+            // test string file instantiation
+            new SimpleFSLockFactory("test");
+        }
 		
 		// Verify: do stress test, by opening IndexReaders and
 		// IndexWriters over & over in 2 threads and making sure
@@ -362,11 +158,11 @@ namespace Lucene.Net.Store
 		[Test]
 		public virtual void  TestStressLocksNativeFSLockFactory()
 		{
-			System.IO.FileInfo dir = _TestUtil.GetTempDir("index.TestLockFactory7");
+			System.IO.DirectoryInfo dir = _TestUtil.GetTempDir("index.TestLockFactory7");
 			_testStressLocks(new NativeFSLockFactory(dir), dir);
 		}
 		
-		public virtual void  _testStressLocks(LockFactory lockFactory, System.IO.FileInfo indexDir)
+		public virtual void  _testStressLocks(LockFactory lockFactory, System.IO.DirectoryInfo
indexDir)
 		{
 			FSDirectory fs1 = FSDirectory.Open(new System.IO.DirectoryInfo(indexDir.FullName), lockFactory);
 			
@@ -424,8 +220,8 @@ namespace Lucene.Net.Store
 		public virtual void  TestNativeFSLockFactoryPrefix()
 		{
 			
-			System.IO.FileInfo fdir1 = _TestUtil.GetTempDir("TestLockFactory.8");
-			System.IO.FileInfo fdir2 = _TestUtil.GetTempDir("TestLockFactory.8.Lockdir");
+			System.IO.DirectoryInfo fdir1 = _TestUtil.GetTempDir("TestLockFactory.8");
+			System.IO.DirectoryInfo fdir2 = _TestUtil.GetTempDir("TestLockFactory.8.Lockdir");
 			Directory dir1 = FSDirectory.Open(new System.IO.DirectoryInfo(fdir1.FullName), new NativeFSLockFactory(fdir1));
 			// same directory, but locks are stored somewhere else. The prefix of the lock factory
should != null
 			Directory dir2 = FSDirectory.Open(new System.IO.DirectoryInfo(fdir1.FullName), new NativeFSLockFactory(fdir2));
@@ -447,7 +243,7 @@ namespace Lucene.Net.Store
 		{
 			
 			// Make sure we get null prefix:
-			System.IO.FileInfo dirName = _TestUtil.GetTempDir("TestLockFactory.10");
+			System.IO.DirectoryInfo dirName = _TestUtil.GetTempDir("TestLockFactory.10");
 			Directory dir = FSDirectory.Open(dirName);
 			
 			System.String prefix = dir.GetLockFactory().GetLockPrefix();
@@ -578,7 +374,7 @@ namespace Lucene.Net.Store
 				{
 					try
 					{
-						searcher = new IndexSearcher(dir);
+						searcher = new IndexSearcher(dir, false);
 					}
 					catch (System.Exception e)
 					{

Added: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestMultiMMap.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestMultiMMap.cs?rev=1202091&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestMultiMMap.cs
(added)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestMultiMMap.cs
Tue Nov 15 08:41:44 2011
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+
+namespace Lucene.Net.Test.Store
+{
+    [TestFixture]
+    class TestMultiMMap
+    {
+        [Test]
+        public void TestDoesntExist()
+        {
+            Assert.Fail("Need to port tests");
+        }
+    }
+}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestRAMDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestRAMDirectory.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestRAMDirectory.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestRAMDirectory.cs
Tue Nov 15 08:41:44 2011
@@ -34,11 +34,7 @@ namespace Lucene.Net.Store
 	
 	/// <summary> JUnit testcase to test RAMDirectory. RAMDirectory itself is used in
many testcases,
 	/// but not one of them uses an different constructor other than the default constructor.
-	/// 
-	/// 
 	/// </summary>
-	/// <version>  $Id: RAMDirectory.java 150537 2004-09-28 22:45:26 +0200 (Di, 28 Sep
2004) cutting $
-	/// </version>
     [TestFixture]
 	public class TestRAMDirectory:LuceneTestCase
 	{
@@ -85,7 +81,7 @@ namespace Lucene.Net.Store
 			}
 		}
 		
-		private System.IO.FileInfo indexDir = null;
+		private System.IO.DirectoryInfo indexDir = null;
 		
 		// add enough document so that the index will be larger than RAMDirectory.READ_BUFFER_SIZE
 		private int docsToAdd = 500;
@@ -98,9 +94,10 @@ namespace Lucene.Net.Store
 			System.String tempDir = System.IO.Path.GetTempPath();
 			if (tempDir == null)
 				throw new System.IO.IOException("java.io.tmpdir undefined, cannot run test");
-			indexDir = new System.IO.FileInfo(Path.Combine(tempDir, "RAMDirIndex"));
-			
-			IndexWriter writer = new IndexWriter(indexDir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+			indexDir = new System.IO.DirectoryInfo(Path.Combine(tempDir, "RAMDirIndex"));
+
+		    Directory dir = FSDirectory.Open(indexDir);
+			IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
 			// add some documents
 			Document doc = null;
 			for (int i = 0; i < docsToAdd; i++)
@@ -109,8 +106,9 @@ namespace Lucene.Net.Store
 				doc.Add(new Field("content", English.IntToEnglish(i).Trim(), Field.Store.YES, Field.Index.NOT_ANALYZED));
 				writer.AddDocument(doc);
 			}
-			Assert.AreEqual(docsToAdd, writer.DocCount());
+			Assert.AreEqual(docsToAdd, writer.MaxDoc());
 			writer.Close();
+		    dir.Close();
 		}
 		
         [Test]
@@ -127,63 +125,7 @@ namespace Lucene.Net.Store
 			Assert.AreEqual(ramDir.SizeInBytes(), ramDir.GetRecomputedSizeInBytes());
 			
 			// open reader to test document count
-			IndexReader reader = IndexReader.Open(ramDir);
-			Assert.AreEqual(docsToAdd, reader.NumDocs());
-			
-			// open search zo check if all doc's are there
-			IndexSearcher searcher = new IndexSearcher(reader);
-			
-			// search for all documents
-			for (int i = 0; i < docsToAdd; i++)
-			{
-				Document doc = searcher.Doc(i);
-				Assert.IsTrue(doc.GetField("content") != null);
-			}
-			
-			// cleanup
-			reader.Close();
-			searcher.Close();
-		}
-		
-        [Test]
-		public virtual void  TestRAMDirectoryFile()
-		{
-			
-			MockRAMDirectory ramDir = new MockRAMDirectory(indexDir);
-			
-			// Check size
-			Assert.AreEqual(ramDir.SizeInBytes(), ramDir.GetRecomputedSizeInBytes());
-			
-			// open reader to test document count
-			IndexReader reader = IndexReader.Open(ramDir);
-			Assert.AreEqual(docsToAdd, reader.NumDocs());
-			
-			// open search zo check if all doc's are there
-			IndexSearcher searcher = new IndexSearcher(reader);
-			
-			// search for all documents
-			for (int i = 0; i < docsToAdd; i++)
-			{
-				Document doc = searcher.Doc(i);
-				Assert.IsTrue(doc.GetField("content") != null);
-			}
-			
-			// cleanup
-			reader.Close();
-			searcher.Close();
-		}
-		
-        [Test]
-		public virtual void  TestRAMDirectoryString()
-		{
-			
-			MockRAMDirectory ramDir = new MockRAMDirectory(indexDir.FullName);
-			
-			// Check size
-			Assert.AreEqual(ramDir.SizeInBytes(), ramDir.GetRecomputedSizeInBytes());
-			
-			// open reader to test document count
-			IndexReader reader = IndexReader.Open(ramDir);
+			IndexReader reader = IndexReader.Open(ramDir, true);
 			Assert.AreEqual(docsToAdd, reader.NumDocs());
 			
 			// open search zo check if all doc's are there
@@ -206,9 +148,10 @@ namespace Lucene.Net.Store
 		
         [Test]
 		public virtual void  TestRAMDirectorySize()
-		{
-			
-			MockRAMDirectory ramDir = new MockRAMDirectory(indexDir.FullName);
+        {
+            Directory dir = FSDirectory.Open(indexDir);
+			MockRAMDirectory ramDir = new MockRAMDirectory(dir);
+            dir.Close();
 			IndexWriter writer = new IndexWriter(ramDir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
 			writer.Optimize();
 			

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestWindowsMMap.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestWindowsMMap.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestWindowsMMap.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestWindowsMMap.cs
Tue Nov 15 08:41:44 2011
@@ -25,6 +25,7 @@ using Field = Lucene.Net.Documents.Field
 using IndexWriter = Lucene.Net.Index.IndexWriter;
 using IndexSearcher = Lucene.Net.Search.IndexSearcher;
 using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
+using System.Collections.Generic;
 
 namespace Lucene.Net.Store
 {
@@ -67,20 +68,20 @@ namespace Lucene.Net.Store
 			return fb.ToString();
 		}
 		
-		private static readonly System.String storePathname = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "testLuceneMmap")).FullName;
+		private static readonly System.String storePathname = new System.IO.DirectoryInfo(System.IO.Path.Combine(AppSettings.Get("tempDir",
""), "testLuceneMmap")).FullName;
 		
 		[Test]
 		public virtual void  TestMmapIndex()
 		{
 			FSDirectory storeDirectory;
-			storeDirectory = new MMapDirectory(new System.IO.FileInfo(storePathname), null);
+			storeDirectory = new MMapDirectory(new System.IO.DirectoryInfo(storePathname), null);
 			
 			// plan to add a set of useful stopwords, consider changing some of the
 			// interior filters.
-			StandardAnalyzer analyzer = new StandardAnalyzer(new System.Collections.Hashtable());
+			StandardAnalyzer analyzer = new StandardAnalyzer(Util.Version.LUCENE_CURRENT, new HashSet<string>());
 			// TODO: something about lock timeouts and leftover locks.
 			IndexWriter writer = new IndexWriter(storeDirectory, analyzer, true, IndexWriter.MaxFieldLength.LIMITED);
-			IndexSearcher searcher = new IndexSearcher(storePathname);
+            IndexSearcher searcher = new IndexSearcher(storeDirectory, true);
 			
 			for (int dx = 0; dx < 1000; dx++)
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestDemo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestDemo.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestDemo.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestDemo.cs Tue Nov 15
08:41:44 2011
@@ -67,7 +67,7 @@ namespace Lucene.Net
 			// Now search the index:
 			IndexSearcher isearcher = new IndexSearcher(directory, true); // read-only=true
 			// Parse a simple query that searches for "text":
-			QueryParser parser = new QueryParser("fieldname", analyzer);
+			QueryParser parser = new QueryParser(Util.Version.LUCENE_CURRENT, "fieldname", analyzer);
 			Query query = parser.Parse("text");
 			ScoreDoc[] hits = isearcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length);

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestMergeSchedulerExternal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestMergeSchedulerExternal.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestMergeSchedulerExternal.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestMergeSchedulerExternal.cs
Tue Nov 15 08:41:44 2011
@@ -110,7 +110,7 @@ namespace Lucene.Net
 				}
 			}
 			
-			protected /*internal*/ override MergeThread GetMergeThread(IndexWriter writer, MergePolicy.OneMerge
merge)
+			protected internal override MergeThread GetMergeThread(IndexWriter writer, MergePolicy.OneMerge
merge)
 			{
 				MergeThread thread = new MyMergeThread(this, writer, merge);
 				thread.SetThreadPriority(GetMergeThreadPriority());
@@ -119,12 +119,12 @@ namespace Lucene.Net
 				return thread;
 			}
 			
-			protected /*internal*/ override void  HandleMergeException(System.Exception t)
+			protected internal override void  HandleMergeException(System.Exception t)
 			{
 				Enclosing_Instance.excCalled = true;
 			}
 			
-			protected /*internal*/ override void  DoMerge(MergePolicy.OneMerge merge)
+			protected internal override void  DoMerge(MergePolicy.OneMerge merge)
 			{
 				Enclosing_Instance.mergeCalled = true;
 				base.DoMerge(merge);

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestSupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestSupportClass.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestSupportClass.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/TestSupportClass.cs Tue
Nov 15 08:41:44 2011
@@ -1190,11 +1190,10 @@ namespace Lucene.Net._SupportClass
                 Assert.AreEqual("Second Line", Reader.ReadToEnd(), "\"ReadToEnd\" method
is not implemented");
             }
 
-            public override Token Next()
+            public override bool IncrementToken()
             {
-                return null;
+                return false;
             }
-
         }
 
         [Test]

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt Tue Nov
15 08:41:44 2011
@@ -47,7 +47,7 @@ index\index.30.nocfs.zip - Left only: C:
 index\MockIndexInput.java - DONE
 index\TestAddIndexesNoOptimize.java - DONE
 index\TestAtomicUpdate.java - DONE
-index\TestBackwardsCompatibility.java - Text files are different
+index\TestBackwardsCompatibility.java - DONE
 index\TestByteSlices.java - DONE
 index\TestCheckIndex.java - DONE
 index\TestCompoundFile.java - DONE
@@ -67,7 +67,7 @@ index\TestIndexReader.java - DONE
 index\TestIndexReaderClone.java - DONE
 index\TestIndexReaderCloneNorms.java - DONE
 index\TestIndexReaderReopen.java - DONE
-index\TestIndexWriter.java - Text files are different
+index\TestIndexWriter.java - DONE
 index\TestIndexWriterDelete.java - Text files are different
 index\TestIndexWriterExceptions.java - Text files are different
 index\TestIndexWriterLockRelease.java - Text files are different
@@ -82,7 +82,7 @@ index\TestMultiReader.java - Text files 
 index\TestNewestSegment.java - IDENTICAL
 index\TestNorms.java - Text files are different
 index\TestNRTReaderWithThreads.java - Text files are different
-index\TestOmitTf.java - Text files are different
+index\TestOmitTf.java - DONE
 index\TestParallelReader.java - Text files are different
 index\TestParallelReaderEmptyIndex.java - IDENTICAL
 index\TestParallelTermEnum.java - Text files are different
@@ -100,7 +100,7 @@ index\TestTerm.java - IDENTICAL
 index\TestTermdocPerf.java - Text files are different
 index\TestTermVectorsReader.java - Text files are different
 index\TestThreadedOptimize.java - Text files are different
-index\TestTransactionRollback.java - Text files are different
+index\TestTransactionRollback.java - DONE
 index\TestTransactions.java - Text files are different
 index\TestWordlistLoader.java - IDENTICAL
 
@@ -143,33 +143,33 @@ search\CachingWrapperFilterHelper.java -
 search\CheckHits.java - DONE
 search\JustCompileSearch.java - DONE
 search\MockFilter.java - DONE
-search\QueryUtils.java - Text files are different
-search\SampleComparable.java - Left only: C:\SVN\apache\Lucene\lucene-2.9.4\src\test\org\apache\lucene\search
-search\SingleDocTestFilter.java - Text files are different
-search\TestBoolean2.java - Text files are different
-search\TestBooleanMinShouldMatch.java - Text files are different
-search\TestBooleanOr.java - Text files are different
-search\TestBooleanPrefixQuery.java - Text files are different
-search\TestBooleanQuery.java - Text files are different
-search\TestBooleanScorer.java - Text files are different
+search\QueryUtils.java - DONE
+search\SampleComparable.java - REMOVED
+search\SingleDocTestFilter.java - DONE
+search\TestBoolean2.java - DONE
+search\TestBooleanMinShouldMatch.java - DONE
+search\TestBooleanOr.java - DONE
+search\TestBooleanPrefixQuery.java - DONE
+search\TestBooleanQuery.java - DONE
+search\TestBooleanScorer.java - DONE
 search\TestCachingSpanFilter.java - IDENTICAL
-search\TestCachingWrapperFilter.java - Text files are different
-search\TestComplexExplanations.java - Text files are different
-search\TestComplexExplanationsOfNonMatches.java - Text files are different
-search\TestCustomSearcherSort.java - Text files are different
+search\TestCachingWrapperFilter.java - DONE
+search\TestComplexExplanations.java - DONE
+search\TestComplexExplanationsOfNonMatches.java - DONE
+search\TestCustomSearcherSort.java - DONE
 search\TestDateFilter.java - Text files are different
-search\TestDateSort.java - Text files are different
+search\TestDateSort.java - DONE
 search\TestDisjunctionMaxQuery.java - Text files are different
 search\TestDocBoost.java - Text files are different
-search\TestDocIdSet.java - Text files are different
+search\TestDocIdSet.java - DONE
 search\TestElevationComparator.java - Text files are different
-search\TestExplanations.java - Text files are different
+search\TestExplanations.java - DONE
 search\TestFieldCache.java - Text files are different
 search\TestFieldCacheRangeFilter.java - Text files are different
 search\TestFieldCacheTermsFilter.java - Text files are different
 search\TestFilteredQuery.java - Text files are different
-search\TestFilteredSearch.java - Text files are different
-search\TestFuzzyQuery.java - Text files are different
+search\TestFilteredSearch.java - DONE
+search\TestFuzzyQuery.java - DONE
 search\TestMatchAllDocsQuery.java - Text files are different
 search\TestMultiPhraseQuery.java - Text files are different
 search\TestMultiSearcher.java - Text files are different
@@ -184,21 +184,21 @@ search\TestParallelMultiSearcher.java - 
 search\TestPhrasePrefixQuery.java - Text files are different
 search\TestPhraseQuery.java - Text files are different
 search\TestPositionIncrement.java - Text files are different
-search\TestPositiveScoresOnlyCollector.java - Text files are different
+search\TestPositiveScoresOnlyCollector.java - DONe
 search\TestPrefixFilter.java - Text files are different
 search\TestPrefixInBooleanQuery.java - Text files are different
 search\TestPrefixQuery.java - Text files are different
 search\TestQueryTermVector.java - IDENTICAL
 search\TestQueryWrapperFilter.java - Text files are different
-search\TestScoreCachingWrappingScorer.java - Text files are different
+search\TestScoreCachingWrappingScorer.java - DONE
 search\TestScorerPerf.java - Text files are different
 search\TestSearchHitsWithDeletions.java - Left only: C:\SVN\apache\Lucene\lucene-2.9.4\src\test\org\apache\lucene\search
 search\TestSetNorm.java - Text files are different
-search\TestSimilarity.java - Text files are different
+search\TestSimilarity.java - DONE
 search\TestSimpleExplanations.java - Text files are different
 search\TestSimpleExplanationsOfNonMatches.java - Text files are different
 search\TestSloppyPhraseQuery.java - Text files are different
-search\TestSort.java - Text files are different
+search\TestSort.java - DONE
 search\TestSpanQueryFilter.java - Text files are different
 search\TestStressSort.java - Left only: C:\SVN\apache\Lucene\lucene-2.9.4\src\test\org\apache\lucene\search
 search\TestTermRangeFilter.java - Text files are different
@@ -214,7 +214,19 @@ search\TestWildcard.java - Text files ar
 
 
 Store\
-
+store\_TestHelper.java - IDENTICAL
+store\MockRAMDirectory.java - DONE
+store\MockRAMInputStream.java - DONE
+store\MockRAMOutputStream.java - DONE
+store\TestBufferedIndexInput.java - DONE
+store\TestDirectory.java - IDENTICAL
+store\TestFileSwitchDirectory.java - IDENTICAL
+store\TestHugeRamFile.java - DONE
+store\TestLock.java - DONE
+store\TestLockFactory.java - DONE
+store\TestMultiMMap.java - ******* NEEDS TO BE PORTED *******
+store\TestRAMDirectory.java - DONE
+store\TestWindowsMMap.java - DONE
 
 util\
 util\_TestUtil.java - DONE
@@ -224,7 +236,7 @@ util\util\util\LocalizedTestCase.java - 
 util\LuceneTestCase.java - DONE
 util\TestAttributeSource.java - DONE
 util\util\TestBitVector.java - DONE
-util\TestCloseableThreadLocal.java - DONE? * Had to add type parameters to CloseableThreadLocal
that java didn't require?
+util\TestCloseableThreadLocal.java - DONE
 util\TestFieldCacheSanityChecker.java - DONE
 util\TestIndexableBinaryStringTools.java - DONE
 util\TestNumericUtils.java - DONE
@@ -236,4 +248,11 @@ util\TestSortedVIntList.java - IDENTICAL
 util\TestStringHelper.java - IDENTICAL
 util\TestStringIntern.java - DONE
 util\TestVersion.java - DONE
-util\cache\TestSimpleLRUCache.cs - DONE
\ No newline at end of file
+util\cache\TestSimpleLRUCache.cs - DONE
+
+lucene\
+TestDemo.java - DONE
+TestHitIterator.java - REMOVED
+TestMergeSchedulerExternal.java - DONE
+TestSearch.java - Text files are different
+TestSearchForDuplicates.java - Text files are different
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Util/TestCloseableThreadLocal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Util/TestCloseableThreadLocal.cs?rev=1202091&r1=1202090&r2=1202091&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Util/TestCloseableThreadLocal.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Util/TestCloseableThreadLocal.cs
Tue Nov 15 08:41:44 2011
@@ -40,8 +40,8 @@ namespace Lucene.Net.Util
 		{
 			// Tests that null can be set as a valid value (LUCENE-1805). This
 			// previously failed in get().
-			CloseableThreadLocal ctl = new CloseableThreadLocal();
-			ctl.Set((System.Object) null);
+            CloseableThreadLocal<object> ctl = new CloseableThreadLocal<object>();
+			ctl.Set(null);
 			Assert.IsNull(ctl.Get());
 		}
 		



Mime
View raw message