ggregory    2004/01/09 11:02:32

  Modified:    codec/src/test/org/apache/commons/codec/net
                        URLCodecTest.java
  Log:
  PR: 25995
  Obtained from: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25995
  Submitted by: [EMAIL PROTECTED] (Oleg Kalnichevski)
  Reviewed by:  Gary D. Gregory
  
  Revision  Changes    Path
  1.8       +12 -3     
jakarta-commons/codec/src/test/org/apache/commons/codec/net/URLCodecTest.java
  
  Index: URLCodecTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/codec/src/test/org/apache/commons/codec/net/URLCodecTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- URLCodecTest.java 2 Jan 2004 07:05:37 -0000       1.7
  +++ URLCodecTest.java 9 Jan 2004 19:02:32 -0000       1.8
  @@ -67,7 +67,6 @@
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Oleg Kalnichevski</a>
    */
  -
   public class URLCodecTest extends TestCase {
       
       static final int SWISS_GERMAN_STUFF_UNICODE [] = {
  @@ -241,12 +240,12 @@
           URLCodec urlcodec = new URLCodec("NONSENSE");
              String plain = "Hello there!";
               try {
  -               String encoded = urlcodec.encode(plain);
  +               urlcodec.encode(plain);
                   fail( "We set the encoding to a bogus NONSENSE vlaue, this 
shouldn't have worked.");
               } catch( EncoderException ee ) {
               }
               try {
  -               String decoded = urlcodec.decode(plain);
  +               urlcodec.decode(plain);
                   fail( "We set the encoding to a bogus NONSENSE vlaue, this 
shouldn't have worked.");
               } catch( DecoderException ee ) {
               }
  @@ -275,4 +274,14 @@
           } catch( DecoderException ee ) {
           }
       }
  +
  +    public void testDefaultEncoding() throws Exception {
  +        String plain = "Hello there!";
  +        URLCodec urlcodec = new URLCodec("UnicodeBig");
  +        urlcodec.encode(plain); // To work around a weird quirk in Java 1.2.2
  +        String encoded1 = urlcodec.encode(plain, "UnicodeBig");
  +        String encoded2 = urlcodec.encode(plain);
  +        assertEquals(encoded1, encoded2);
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to