You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2011/09/02 02:31:29 UTC

svn commit: r1164311 - /lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java

Author: hossman
Date: Fri Sep  2 00:31:29 2011
New Revision: 1164311

URL: http://svn.apache.org/viewvc?rev=1164311&view=rev
Log:
improve test assumptions: assume content instead of assert; catch IOException so we also assume no UnknownHostException

Modified:
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java

Modified: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java?rev=1164311&r1=1164310&r2=1164311&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java (original)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java Fri Sep  2 00:31:29 2011
@@ -74,7 +74,11 @@ public class ContentStreamTest extends L
       in = conn.getInputStream();
       contentType = conn.getContentType();
       content = IOUtils.toByteArray(in);
-    } catch (ConnectException ex) {
+
+      assumeTrue("not enough content for test to be useful",
+                 content.length > 10 ); 
+
+    } catch (IOException ex) {
       assumeNoException("Unable to connect to " + url + " to run the test.", ex);
     }finally {
       if (in != null) {
@@ -82,7 +86,6 @@ public class ContentStreamTest extends L
       }
     }
     
-    assertTrue( content.length > 10 ); // found something...
     
     ContentStreamBase stream = new ContentStreamBase.URLStream( url );
     assertEquals( content.length, stream.getSize().intValue() );