Author: costin Date: Mon Nov 7 00:05:25 2005 New Revision: 331238 URL: http://svn.apache.org/viewcvs?rev=331238&view=rev Log: A simple test case - extremely incomplete, but usefull to track the nio conversion.
Added: tomcat/sandbox/test/ tomcat/sandbox/test/org/ tomcat/sandbox/test/org/apache/ tomcat/sandbox/test/org/apache/tomcat/ tomcat/sandbox/test/org/apache/tomcat/util/ tomcat/sandbox/test/org/apache/tomcat/util/buf/ tomcat/sandbox/test/org/apache/tomcat/util/buf/UEncoderTest.java tomcat/sandbox/test/org/apache/tomcat/util/nio/ Added: tomcat/sandbox/test/org/apache/tomcat/util/buf/UEncoderTest.java URL: http://svn.apache.org/viewcvs/tomcat/sandbox/test/org/apache/tomcat/util/buf/UEncoderTest.java?rev=331238&view=auto ============================================================================== --- tomcat/sandbox/test/org/apache/tomcat/util/buf/UEncoderTest.java (added) +++ tomcat/sandbox/test/org/apache/tomcat/util/buf/UEncoderTest.java Mon Nov 7 00:05:25 2005 @@ -0,0 +1,40 @@ +/* + */ +package org.apache.tomcat.util.buf; + +import junit.framework.TestCase; + +public class UEncoderTest extends TestCase { + UEncoder enc=new UEncoder(); + + public static void main(String[] args) { + } + + + /* + * + * Test method for 'org.apache.tomcat.util.buf.UEncoder.encodeURL(String)' + * TODO: find the relevant rfc and apache tests and add more + */ + public void testEncodeURL() { + + String eurl1=enc.encodeURL("test"); + assertEquals("test", eurl1); + + eurl1=enc.encodeURL("/test"); + assertEquals("%2ftest", eurl1); + + // safe ranges + eurl1=enc.encodeURL("test$-_."); + assertEquals("test$-_.", eurl1); + + eurl1=enc.encodeURL("test$-_.!*'(),"); + assertEquals("test$-_.!*'(),", eurl1); + + eurl1=enc.encodeURL("//test"); + assertEquals("%2f%2ftest", eurl1); + + + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]