Author: sback
Date: 2007-07-21 15:19:21 +0000 (Sat, 21 Jul 2007)
New Revision: 14233
Modified:
trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
Log:
Directly stressed chars replaced with the ones provided by
test.freenet.support.UTFUtils methods
Modified: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
===================================================================
--- trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
2007-07-21 15:18:59 UTC (rev 14232)
+++ trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
2007-07-21 15:19:21 UTC (rev 14233)
@@ -16,7 +16,7 @@
package freenet.support;
import java.io.UnsupportedEncodingException;
-
+import freenet.utils.*;
import junit.framework.TestCase;
/**
@@ -27,11 +27,9 @@
*/
public class URLEncoderDecoderTest extends TestCase {
- private String prtblAscii = " !@#$%^&()+={}[]:;\"'<>,?~`";
//printable ascii symbols
- private String stressedUTF_8Chars =
"???????????????????????????????????????????????????????????????"+
-
"???????????????????????????????????????????????????????????????"+
-
"?????????????????????????????????????????????????"; //UTF-8 chars with
stress
-
+ private String prtblAscii = new String(UTFUtil.PRINTABLE_ASCII);
+ private String stressedUTF_8Chars = new String(UTFUtil.STRESSED_UTF);
+
/**
* Tests if URLEncode.encode(String) and
* URLDecode.decode(String,boolean) methods
@@ -98,7 +96,8 @@
toEncode = String.valueOf(eachChar);
try {
expectedResult = "%"+ HexUtil.bytesToHex(
- toEncode.getBytes("US-ASCII"));
//since safe chars are only US-ASCII
+ //since safe chars are only
US-ASCII
+ toEncode.getBytes("US-ASCII"));
assertEquals(URLEncoder.encode(toEncode,toEncode,false),expectedResult);
assertEquals(URLEncoder.encode(toEncode,toEncode,true),expectedResult);
} catch (UnsupportedEncodingException anException) {