Index: tests/reliability/run/exclude.linux_x86_64 =================================================================== --- tests/reliability/run/exclude.linux_x86_64 (revision 601425) +++ tests/reliability/run/exclude.linux_x86_64 (working copy) @@ -2,7 +2,6 @@ ## 20071030 test run failures api.kernel.thread.VolatileVariableTest.DekkerTest api.net.DatagramTest -api.net.HttpConnectionTest api.net.SingleConnectTest api.nio.buffers.ByteBufferallocateTest api.nio.channels.filechannel.MappedByteBufferForceTest Index: tests/reliability/run/run.normal.mode.settings.xml =================================================================== --- tests/reliability/run/run.normal.mode.settings.xml (revision 601425) +++ tests/reliability/run/run.normal.mode.settings.xml (working copy) @@ -517,7 +517,7 @@ - + Index: tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/HttpConnectionTest.java =================================================================== --- tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/HttpConnectionTest.java (revision 601425) +++ tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/HttpConnectionTest.java (working copy) @@ -24,12 +24,16 @@ import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.net.MalformedURLException; import java.net.Proxy; import java.net.URL; +import java.net.Socket; +import java.net.ServerSocket; import java.util.regex.Pattern; import org.apache.harmony.test.reliability.share.Test; @@ -37,7 +41,7 @@ /* * Goal: Test HttpURLConnection functionality * - * passed parameters: + * passed optional parameters: * parameter[0] - urls for web pages you want to get, all urls are to be listed consequently * via ";" with no blanks or tabs * E.g http://harmony.apache.org/;http://issues.apache.org/jira/browse/HARMONY @@ -49,13 +53,14 @@ * * No crash, hang or fail is excpected. * - * Note: All input parameters are to be set properly as test could fail due to wrong - * set proxy or Url address. + * If no parameters are set then internal stab http server is started for testing. * */ public class HttpConnectionTest extends Test{ + static volatile boolean failed = false; String[] testedUrlStrings = null; Proxy prx = null; + HttpServerStub sPort = null; public static void main(String[] params){ System.exit(new HttpConnectionTest().test(params)); @@ -63,8 +68,16 @@ public int test(String[] params){ parseParams(params); + + if (testedUrlStrings == null){ - return fail("Urls to test are not set"); + sPort = new HttpServerStub(); + if (!sPort.isAlive()) + { + return fail("Failed to start server"); + } + testedUrlStrings = new String[1]; + testedUrlStrings[0] = "http://localhost:" + sPort.port + "/"; } for (int i=0; i