lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r414532 - /incubator/lucene.net/trunk/C#/src/Test/TestSearchForDuplicates.cs
Date Thu, 15 Jun 2006 10:08:38 GMT
Author: aroush
Date: Thu Jun 15 03:08:38 2006
New Revision: 414532

URL: http://svn.apache.org/viewvc?rev=414532&view=rev
Log: (empty)

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

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?rev=414532&r1=414531&r2=414532&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestSearchForDuplicates.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestSearchForDuplicates.cs Thu Jun 15 03:08:38
2006
@@ -64,23 +64,23 @@
 		[Test]
         public virtual void  TestRun()
 		{
-			System.IO.StringWriter sw = new System.IO.StringWriter();
-			System.IO.StreamWriter pw = null; // new System.IO.StreamWriter(sw);    // {{Aroush}}
how do we pass 'sw' to StreamWriter?
-			DoTest(pw, false);
-			pw.Close();
-			sw.Close();
-			System.String multiFileOutput = sw.GetStringBuilder().ToString();
-			//System.out.println(multiFileOutput);
-			
-			sw = new System.IO.StringWriter();
-			pw = null; // new System.IO.StreamWriter(sw);   // {{Aroush}} how do we pass 'sw' to StreamWriter?
-			DoTest(pw, true);
-			pw.Close();
-			sw.Close();
-			System.String singleFileOutput = sw.GetStringBuilder().ToString();
+            System.IO.MemoryStream sw = new System.IO.MemoryStream();
+            System.IO.StreamWriter pw = new System.IO.StreamWriter(sw);
+            DoTest(pw, false);
+            pw.Close();
+            sw.Close();
+            System.String multiFileOutput = System.Text.ASCIIEncoding.ASCII.GetString(sw.ToArray());
+            //System.out.println(multiFileOutput);
+			
+            sw = new System.IO.MemoryStream();
+            pw = new System.IO.StreamWriter(sw);
+            DoTest(pw, true);
+            pw.Close();
+            sw.Close();
+            System.String singleFileOutput = System.Text.ASCIIEncoding.ASCII.GetString(sw.ToArray());
 			
-			Assert.AreEqual(multiFileOutput, singleFileOutput);
-		}
+            Assert.AreEqual(multiFileOutput, singleFileOutput);
+        }
 		
 		
 		private void  DoTest(System.IO.StreamWriter out_Renamed, bool useCompoundFiles)
@@ -160,7 +160,7 @@
 				if (i < 10 || (i > 94 && i < 105))
 				{
 					Lucene.Net.Documents.Document d = hits.Doc(i);
-					Assert.AreEqual("check " + i, System.Convert.ToString(i), d.Get(ID_FIELD));
+					Assert.AreEqual(System.Convert.ToString(i), d.Get(ID_FIELD), "check " + i);
 				}
 			}
 		}



Mime
View raw message