You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/08/16 21:24:53 UTC

svn commit: r1373996 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/solrj/ solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java

Author: rmuir
Date: Thu Aug 16 19:24:53 2012
New Revision: 1373996

URL: http://svn.apache.org/viewvc?rev=1373996&view=rev
Log:
use assertEquals so we will see whats going on when this fails

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java?rev=1373996&r1=1373995&r2=1373996&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java (original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java Thu Aug 16 19:24:53 2012
@@ -24,6 +24,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.Reader;
 import java.io.StringReader;
 import java.net.ConnectException;
 import java.net.HttpURLConnection;
@@ -110,6 +111,12 @@ public class ContentStreamTest extends L
       charset = ContentStreamBase.DEFAULT_CHARSET;
     // Re-open the stream and this time use a reader
     stream = new ContentStreamBase.URLStream( url );
-    assertTrue( IOUtils.contentEquals( new StringReader(new String(content, charset)), stream.getReader() ) );
+    StringBuilder sb = new StringBuilder();
+    Reader reader = stream.getReader();
+    int ch;
+    while ((ch = reader.read()) > 0) {
+      sb.append((char)ch);
+    }
+    assertEquals(new String(content, charset), sb.toString());
   }
 }