SOLR-2002: add timeouts for this test in case the site is having problems

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@965230 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-07-18 14:09:06 +00:00
parent bd1a237061
commit 898430be9b
1 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.replay;
import java.net.URL; import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
@ -111,7 +112,11 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {
String url = "http://www.apache.org/dist/lucene/solr/"; String url = "http://www.apache.org/dist/lucene/solr/";
String txt = null; String txt = null;
try { try {
txt = IOUtils.toString( new URL(url).openStream() ); URLConnection connection = new URL(url).openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);
connection.connect();
txt = IOUtils.toString( connection.getInputStream());
} }
catch( Exception ex ) { catch( Exception ex ) {
// TODO - should it fail/skip? // TODO - should it fail/skip?