Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-2854: fix failing test by getting stream before size

Erik Hatcher29a17b885fa0
diff --git a/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java b/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java
index bb348aceb34..578479b73e2 100755
--- a/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java
+++ b/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java
@@ -88,10 +88,9 @@ public class ContentStreamTest extends LuceneTestCase
ContentStreamBase stream = new ContentStreamBase.URLStream( url );
+ in = stream.getStream(); // getStream is needed before getSize is valid
assertEquals( content.length, stream.getSize().intValue() );
- // Test the stream
- in = stream.getStream();
try {
assertTrue( IOUtils.contentEquals(
new ByteArrayInputStream(content), in ) );