Author: sback
Date: 2007-08-17 18:13:41 +0000 (Fri, 17 Aug 2007)
New Revision: 14757

Modified:
   trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
Log:
Old commented tests uncommented because they work after toad URLDecoder 
bugfixing

Modified: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
===================================================================
--- trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java       
2007-08-17 17:41:56 UTC (rev 14756)
+++ trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java       
2007-08-17 18:13:41 UTC (rev 14757)
@@ -44,9 +44,7 @@
                                //triple % char, if badly encoded it will 
generate an exception
                                "%%%",
                                //no chars
-                               ""
-               };
-               
+                               ""};
                try {
                        assertTrue(areCorrectlyEncodedDecoded(toEncode));
                } catch (URLEncodedFormatException anException) {
@@ -60,11 +58,11 @@
         * characters and not safe "advanced" (i.e. not ASCII) chars .
         */
        public void testEncodeDecodeString_notSafeAdvChars() {
-               //String[] toEncode = {stressedUTF_8Chars};
-               //try {
-               //      assertTrue(areCorrectlyEncodedDecoded(toEncode));
-               //} catch (URLEncodedFormatException anException) {
-               //      fail("Not expected exception thrown : " + 
anException.getMessage()); }
+               String[] toEncode = {stressedUTF_8Chars};
+               try {
+                       assertTrue(areCorrectlyEncodedDecoded(toEncode));
+               } catch (URLEncodedFormatException anException) {
+                       fail("Not expected exception thrown : " + 
anException.getMessage()); }
        }

        /**
@@ -79,7 +77,7 @@
                boolean retValue = true;
                String[] encoded = new String[toEncode.length];
                //encoding
-               for (int i = 0; i < encoded.length; i++)        
+               for (int i = 0; i < encoded.length; i++)
                        encoded[i] = URLEncoder.encode(toEncode[i]);
                //decoding
                for (int i = 0; i < encoded.length; i++)
@@ -135,10 +133,8 @@
         * verifies if it raises an exception
         */
        public void testDecodeWrongString() {
-               //String toDecode = stressedUTF_8Chars+prtblAscii;
-               
-               //for (int i = 0; i<toDecode.length(); i++)
-               //      
assertTrue(isDecodeRaisingEncodedException(toDecode.substring(i,i+1),false));
+               String toDecode = "%00";
+               assertTrue(isDecodeRaisingEncodedException(toDecode,false));
        }

        /**


Reply via email to