Index: modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java =================================================================== --- modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java (revision 381057) +++ modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java (working copy) @@ -29,9 +29,13 @@ */ public void test_setUseCachesZ() throws MalformedURLException, IOException { // Regression for HARMONY-71 - URLConnection u = new URL("http://www.apache.org").openConnection(); - u.connect(); // TODO change to use local server + URLConnection u = new URLConnection(new URL("http://www.apache.org")) { + public void connect() { + connected = true; + } + }; + u.connect(); try { u.setUseCaches(true); fail("Assert 0: expected an IllegalStateException"); @@ -46,8 +50,13 @@ public void test_setAllowUserInteractionZ() throws MalformedURLException, IOException { // Regression for HARMONY-72 - URLConnection u = new URL("http://www.apache.org").openConnection(); - u.connect(); // TODO change to use local server + URLConnection u = new URLConnection(new URL("http://www.apache.org")) { + public void connect() { + connected = true; + } + }; + + u.connect(); try { u.setAllowUserInteraction(false); fail("Assert 0: expected an IllegalStateException");