lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush" <geo...@aroush.net>
Subject RE: Lucene.Net 1.9 RC1 Build 4 beta is ready
Date Thu, 15 Jun 2006 22:39:10 GMT
Hi Ben,

Yes they are needed otherwise the test will fail.  Few night ago, I fixed
those and I should check them in tonight.  The fix is to use MemoryStream
like so:

    System.IO.MemoryStream sw = new System.IO.MemoryStream();
    System.IO.StreamWriter pw = new System.IO.StreamWriter(sw);

Again, thanks for taking your time and looking at code.  There are other
code outside the Test code -- in the Lucene.Net core code -- just search for
"Aroush".  Let me know if you have anything to say about them.

Regards,

-- George

-----Original Message-----
From: Ben Tregenna [mailto:lucene@rekenys.com] 
Sent: Thursday, June 15, 2006 6:06 PM
To: lucene-net-dev@incubator.apache.org
Cc: George Aroush
Subject: Re: Lucene.Net 1.9 RC1 Build 4 beta is ready

As far as I can tell the StreamWriter in the TestSearch.cs file is not
really needed - it looks from the '(aroush)' comments that the intention was
just to wrap the StringWriter in a StreamWriter, but I don't think this
needs doing. The only methods called on pw in DoTestSearch are TextWriter
methods that they both implement so using the StreamWriter directly appears
fine - or at least consistent which is all the test actually tests Patch
follows...

Ben

Index: TestSearch.cs
===================================================================
--- TestSearch.cs    (revision 414637)
+++ TestSearch.cs    (working copy)
@@ -56,17 +56,12 @@
         public virtual void  TestSearch_Renamed_Method()
         {
             System.IO.StringWriter sw = new System.IO.StringWriter();
-            System.IO.StreamWriter pw = null; // new 
System.IO.StreamWriter(sw);    // {{Aroush}} how do you pass 'sw' to 
StreamWriter()?
-            DoTestSearch(pw, false);
-            pw.Close();
+            DoTestSearch(sw, false);
             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 you pass 'sw' to StreamWriter()?
-            DoTestSearch(pw, true);
-            pw.Close();
+            DoTestSearch(sw, true);
             sw.Close();
             System.String singleFileOutput =
sw.GetStringBuilder().ToString();
            
@@ -74,7 +69,7 @@
         }
        
        
-        private void  DoTestSearch(System.IO.StreamWriter out_Renamed, 
bool useCompoundFile)
+        private void  DoTestSearch(System.IO.StringWriter out_Renamed,
bool useCompoundFile)
         {
             Directory directory = new RAMDirectory();
             Analyzer analyzer = new SimpleAnalyzer();


Mime
View raw message