You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/11/20 20:04:53 UTC

svn commit: r882675 - in /incubator/lucene.net/trunk/C#/src/Test/Search/Spans: TestPayloadSpans.cs TestSpansAdvanced2.cs

Author: digy
Date: Fri Nov 20 19:04:46 2009
New Revision: 882675

URL: http://svn.apache.org/viewvc?rev=882675&view=rev
Log:
LUCENENET-291 Search.Spans Tests

Modified:
    incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestPayloadSpans.cs?rev=882675&r1=882674&r2=882675&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs Fri Nov 20 19:04:46 2009
@@ -54,11 +54,7 @@
 		private IndexSearcher searcher;
 		private Similarity similarity = new DefaultSimilarity();
 		protected internal IndexReader indexReader;
-		
-		/*public TestPayloadSpans(System.String s):base(s)
-		{
-		}*/
-		
+						
 		[SetUp]
 		public override void  SetUp()
 		{
@@ -268,7 +264,7 @@
 			RAMDirectory directory = new RAMDirectory();
 			IndexWriter writer = new IndexWriter(directory, new TestPayloadAnalyzer(this), IndexWriter.MaxFieldLength.LIMITED);
 			Document doc = new Document();
-			doc.Add(new Field("content", new System.IO.StreamReader("a b c d e f g h i j a k")));
+			doc.Add(new Field("content", new System.IO.StreamReader( new System.IO.MemoryStream( System.Text.Encoding.ASCII.GetBytes( "a b c d e f g h i j a k")))));
 			writer.AddDocument(doc);
 			writer.Close();
 			
@@ -305,7 +301,7 @@
 			RAMDirectory directory = new RAMDirectory();
 			IndexWriter writer = new IndexWriter(directory, new TestPayloadAnalyzer(this), IndexWriter.MaxFieldLength.LIMITED);
 			Document doc = new Document();
-			doc.Add(new Field("content", new System.IO.StreamReader("a b a d k f a h i k a k")));
+            doc.Add(new Field("content", new System.IO.StreamReader(new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes("a b a d k f a h i k a k")))));
 			writer.AddDocument(doc);
 			writer.Close();
 			
@@ -342,7 +338,7 @@
 			RAMDirectory directory = new RAMDirectory();
 			IndexWriter writer = new IndexWriter(directory, new TestPayloadAnalyzer(this), IndexWriter.MaxFieldLength.LIMITED);
 			Document doc = new Document();
-			doc.Add(new Field("content", new System.IO.StreamReader("j k a l f k k p a t a k l k t a")));
+            doc.Add(new Field("content", new System.IO.StreamReader(new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes("j k a l f k k p a t a k l k t a")))));
 			writer.AddDocument(doc);
 			writer.Close();
 			

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestSpansAdvanced2.cs?rev=882675&r1=882674&r2=882675&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs Fri Nov 20 19:04:46 2009
@@ -46,8 +46,8 @@
 			// create test index
 			IndexWriter writer = new IndexWriter(mDirectory, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
 			addDocument(writer, "A", "Should we, could we, would we?");
-			addDocument(writer, "B", "It should.  Should it?");
-			addDocument(writer, "C", "It shouldn't.");
+			addDocument(writer, "B", "it should.  Should it?");
+			addDocument(writer, "C", "it shouldn't.");
 			addDocument(writer, "D", "Should we, should we, should we.");
 			writer.Close();