harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r414497 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java
Date Thu, 15 Jun 2006 07:35:56 GMT
Author: smishura
Date: Thu Jun 15 00:35:55 2006
New Revision: 414497

URL: http://svn.apache.org/viewvc?rev=414497&view=rev
Log:
Adding MockURLConnection class

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java?rev=414497&r1=414496&r2=414497&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URLConnectionTest.java
Thu Jun 15 00:35:55 2006
@@ -28,13 +28,10 @@
 	 * @tests java.net.URLConnection#setUseCaches(boolean)
 	 */
 	public void test_setUseCachesZ() throws MalformedURLException, IOException {
-		// Regression for HARMONY-71
-		URLConnection u = new URLConnection(new URL("http://www.apache.org")) {
-		    public void connect() {
-		        connected = true;
-		    }
-		};
 
+        // Regression for HARMONY-71
+        MockURLConnection u = new MockURLConnection(new URL(
+                "http://www.apache.org"));
 		u.connect();
 		try {
 			u.setUseCaches(true);
@@ -49,13 +46,10 @@
 	 */
 	public void test_setAllowUserInteractionZ() throws MalformedURLException,
 			IOException {
-		// Regression for HARMONY-72
-		URLConnection u = new URLConnection(new URL("http://www.apache.org")) {
-		    public void connect() {
-		        connected = true;
-		    }
-		};
-
+		
+        // Regression for HARMONY-72
+        MockURLConnection u = new MockURLConnection(new URL(
+                "http://www.apache.org"));
 		u.connect();
 		try {
 			u.setAllowUserInteraction(false);
@@ -65,3 +59,14 @@
 		}
 	}
 }
+
+class MockURLConnection extends URLConnection {
+    
+    public MockURLConnection(URL url){
+        super(url);
+    }
+    
+    public void connect() {
+        connected = true;
+    }
+}
\ No newline at end of file



Mime
View raw message