mirror of https://github.com/apache/lucene.git
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:
parent
bd1a237061
commit
898430be9b
|
@ -22,6 +22,7 @@ import static org.easymock.EasyMock.expect;
|
|||
import static org.easymock.EasyMock.replay;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -111,7 +112,11 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {
|
|||
String url = "http://www.apache.org/dist/lucene/solr/";
|
||||
String txt = null;
|
||||
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 ) {
|
||||
// TODO - should it fail/skip?
|
||||
|
|
Loading…
Reference in New Issue