harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r619493 [5/7] - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/
Date Thu, 07 Feb 2008 16:40:30 GMT
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLDecoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLDecoderTest.java?rev=619493&r1=619492&r2=619493&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLDecoderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLDecoderTest.java
Thu Feb  7 08:40:26 2008
@@ -21,11 +21,12 @@
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 
+import junit.framework.TestCase;
 import tests.support.Support_Configuration;
 
-public class URLDecoderTest extends junit.framework.TestCase {
+public class URLDecoderTest extends TestCase {
 
-	/**
+    /**
      * @tests java.net.URLDecoder#URLDecoder()
      */
     public void test_Constructor() throws Exception {
@@ -33,14 +34,12 @@
         assertNotNull("Constructor failed.", ud);
     }
 
-	/**
-	 * @tests java.net.URLDecoder#decode(java.lang.String)
-	 */
-	public void test_decodeLjava_lang_String() throws Exception {
-		// Test for method java.lang.String
-		// java.net.URLDecoder.decode(java.lang.String)
-		final String URL = "http://" + Support_Configuration.HomeAddress;
-		final String URL2 = "telnet://justWantToHaveFun.com:400";
+    /**
+     * @tests java.net.URLDecoder#decode(java.lang.String)
+     */
+    public void test_decodeLjava_lang_String() throws Exception {
+        final String URL = "http://" + Support_Configuration.HomeAddress;
+        final String URL2 = "telnet://justWantToHaveFun.com:400";
         final String URL3 = "file://myServer.org/a file with spaces.jpg";
         assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode(
                 URLEncoder.encode(URL)).equals(URL));
@@ -48,7 +47,7 @@
                 URLEncoder.encode(URL2)).equals(URL2));
         assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode(
                 URLEncoder.encode(URL3)).equals(URL3));
-	}
+    }
 
     /**
      * @tests java.net.URLDecoder#decode(java.lang.String, java.lang.String)
@@ -59,6 +58,7 @@
             URLDecoder.decode("", "");
             fail("UnsupportedEncodingException expected");
         } catch (UnsupportedEncodingException e) {
+            // Expected
         }
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java?rev=619493&r1=619492&r2=619493&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java
Thu Feb  7 08:40:26 2008
@@ -1,68 +1,67 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.luni.tests.java.net;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-
-import junit.framework.TestCase;
-import tests.support.Support_Configuration;
-
-public class URLEncoderTest extends TestCase {
-
-    /**
-     * @tests java.net.URLEncoder#encode(java.lang.String)
-     */
-    @SuppressWarnings("deprecation")
-    public void test_encodeLjava_lang_String() {
-        // Test for method java.lang.String
-        // java.net.URLEncoder.encode(java.lang.String)
-        final String URL = "http://" + Support_Configuration.HomeAddress;
-        final String URL2 = "telnet://justWantToHaveFun.com:400";
-        final String URL3 = "file://myServer.org/a file with spaces.jpg";
-
-        assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode(
-                URLEncoder.encode(URL)).equals(URL));
-        assertTrue("2. Incorrect encoding/decoding", URLDecoder.decode(
-                URLEncoder.encode(URL2)).equals(URL2));
-        assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode(
-                URLEncoder.encode(URL3)).equals(URL3));
-    }
-
-    /**
-     * @tests URLEncoder#encode(String, String)
-     */
-    public void test_encodeLjava_lang_StringLjava_lang_String()
-            throws Exception {
-        // Regression for HARMONY-24
-        try {
-            URLEncoder.encode("str", "unknown_enc");
-            fail("Assert 0: Should throw UEE for invalid encoding");
-        } catch (UnsupportedEncodingException e) {
-            // expected
-        }
-        // Regression for HARMONY-1233
-        try {
-            URLEncoder.encode(null, "harmony");
-            fail("NullPointerException expected");
-        } catch (NullPointerException e) {
-            // expected
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.luni.tests.java.net;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+
+import junit.framework.TestCase;
+import tests.support.Support_Configuration;
+
+public class URLEncoderTest extends TestCase {
+
+    /**
+     * @tests java.net.URLEncoder#encode(java.lang.String)
+     */
+    @SuppressWarnings("deprecation")
+    public void test_encodeLjava_lang_String() {
+        final String URL = "http://" + Support_Configuration.HomeAddress;
+        final String URL2 = "telnet://justWantToHaveFun.com:400";
+        final String URL3 = "file://myServer.org/a file with spaces.jpg";
+
+        assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode(
+                URLEncoder.encode(URL)).equals(URL));
+        assertTrue("2. Incorrect encoding/decoding", URLDecoder.decode(
+                URLEncoder.encode(URL2)).equals(URL2));
+        assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode(
+                URLEncoder.encode(URL3)).equals(URL3));
+    }
+
+    /**
+     * @tests URLEncoder#encode(String, String)
+     */
+    public void test_encodeLjava_lang_StringLjava_lang_String()
+            throws Exception {
+        // Regression for HARMONY-24
+        try {
+            URLEncoder.encode("str", "unknown_enc");
+            fail("Assert 0: Should throw UEE for invalid encoding");
+        } catch (UnsupportedEncodingException e) {
+            // expected
+        }
+
+        // Regression for HARMONY-1233
+        try {
+            URLEncoder.encode(null, "harmony");
+            fail("NullPointerException expected");
+        } catch (NullPointerException e) {
+            // expected
+        }
+    }
+}



Mime
View raw message