Delete test that depends on an external server.
This is correctly tested in libcore.java.net.URLConnectionTest
so there's no need for a badly written duplicate test.
bug: 12864018
Change-Id: I66079e04980b1fd33b0121de88d75f9843fb1f04
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
index 07e3de5..d1674f3 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
@@ -851,40 +851,13 @@
((HttpURLConnection) uc).disconnect();
}
- public void test_getOutputStream() throws IOException {
- String posted = "this is a test";
- URLConnection uc3 = new URL("http://www.google.com/ie").openConnection();
- uc3.setDoOutput(true);
- uc3.connect();
-
- BufferedWriter w = new BufferedWriter(new OutputStreamWriter(uc3
- .getOutputStream()), posted.getBytes().length);
-
- w.write(posted);
- w.flush();
- w.close();
-
- int code = ((HttpURLConnection) uc3).getResponseCode();
-
- // writing to url not allowed
- assertEquals("Got different responseCode ", 405, code);
-
- // try exception testing
- try {
- fileURLCon.setDoOutput(true);
- fileURLCon.connect();
- fileURLCon.getInputStream().close();
- fileURLCon.getOutputStream();
- } catch (UnknownServiceException expected) {
- }
-
+ public void test_getOutputStream_failAfterDisconnect() throws IOException {
((HttpURLConnection) uc2).disconnect();
try {
uc2.getOutputStream();
- fail("Exception expected");
- } catch (IOException e) {
- // ok
+ fail();
+ } catch (IOException expected) {
}
}