1 30 package org.apache.commons.httpclient; 31 32 import org.apache.commons.httpclient.util.URIUtil; 33 import junit.framework.*; 34 35 36 43 public class TestURIUtil2 extends TestCase { 44 45 public TestURIUtil2(String s) { 46 super(s); 47 } 48 49 public static Test suite() { 50 return new TestSuite(TestURIUtil.class); 51 } 52 53 public void testEncodeWithinQuery() { 54 String unescaped1= "abc123+ %_?=&#.ä"; 55 try { 56 String stringRet = URIUtil.encodeWithinQuery(unescaped1); 57 assertEquals("abc123%2B%20%25_%3F%3D%26%23.%C3%A4", stringRet); 58 stringRet = URIUtil.decode(stringRet); 59 assertEquals(unescaped1, stringRet); 60 } catch(Exception e) { 61 System.err.println("Exception thrown: "+e); 62 } 63 } 64 } 65 | Popular Tags |