harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r958549 - in /harmony/enhanced/java/trunk/classlib/modules/luni/src: main/java/java/net/URI.java test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
Date Mon, 28 Jun 2010 11:56:15 GMT
Author: tellison
Date: Mon Jun 28 11:56:15 2010
New Revision: 958549

URL: http://svn.apache.org/viewvc?rev=958549&view=rev
Log:
Apply patch for HARMONY-6559 ([classlib][luni]Quotation marks causes IllegalArgumentException)

Modified:
    harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URI.java
    harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URI.java?rev=958549&r1=958548&r2=958549&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URI.java (original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URI.java Mon
Jun 28 11:56:15 2010
@@ -41,7 +41,7 @@ public final class URI implements Compar
 
     static final String someLegal = unreserved + punct;
 
-    static final String queryLegal =  unreserved + reserved + "\\";
+    static final String queryLegal = unreserved + reserved + "\\\""; //$NON-NLS-1$
     
     static final String allLegal = unreserved + reserved;
 

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java?rev=958549&r1=958548&r2=958549&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
Mon Jun 28 11:56:15 2010
@@ -72,33 +72,53 @@ public class URLTest extends TestCase {
     
     
     /**
-     * Check when the argument in url consists of windows path character back-slach
+     * Check when the argument in url consists of windows path character back-slash
      * @tests java.net.URL#openConnection(Proxy)
      * @throws Exception
      */
     public void test_openConnection_windows_path_character() throws Exception {
-        int port = 0;
+        int port = Support_Jetty.startDefaultHttpServer();
         HttpURLConnection con = null;
         try {
-            port = Support_Jetty.startDefaultHttpServer();
-        } catch (Exception e) {
-            fail("Exception during setup jetty : " + e.getMessage());
-        }
-        try {
             URL url = new URL("http://0.0.0.0:" + port + "/servlet?ResourceName=C:\\temp\\test.txt");
-            con = (HttpURLConnection)url.openConnection();
+            con = (HttpURLConnection) url.openConnection();
             con.setDoInput(true);
             con.setDoOutput(true);
             con.setUseCaches(false);
             con.setRequestMethod("GET");
             InputStream is = con.getInputStream();
-         } catch (Exception e) {
-             fail("Unexpected exception : " + e.getMessage());
-         } finally {
-            con.disconnect();
-         }
+        } finally {
+            if (con != null) {
+                con.disconnect();
+            }
+        }
     }
 
+   /**
+     * Check when the argument in url consists of quotation marks character
+     * @tests java.net.URL#openConnection(Proxy)
+     * @throws Exception
+     */
+    public void test_openConnection_quotation_marks_character()
+            throws Exception {
+        int port = Support_Jetty.startDefaultHttpServer();
+        HttpURLConnection con = null;
+        try {
+            URL url = new URL("http://0.0.0.0:" + port
+                    + "/servlet?ResourceName=[\"11111\",\"22222\"]");
+            con = (HttpURLConnection) url.openConnection();
+            con.setDoInput(true);
+            con.setDoOutput(true);
+            con.setUseCaches(false);
+            con.setRequestMethod("GET");
+            InputStream is = con.getInputStream();
+        } finally {
+            if (con != null) {
+                con.disconnect();
+            }
+        }
+    }
+    
     /**
      * @tests java.net.URL#URL(java.lang.String)
      */



Mime
View raw message