You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2008/06/19 22:15:11 UTC
svn commit: r669672 -
/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java
Author: sebb
Date: Thu Jun 19 13:15:11 2008
New Revision: 669672
URL: http://svn.apache.org/viewvc?rev=669672&view=rev
Log:
A few more tests
Modified:
commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java
Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java?rev=669672&r1=669671&r2=669672&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java (original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java Thu Jun 19 13:15:11 2008
@@ -523,6 +523,9 @@
assertFalse(Base64.isArrayByteBase64(new byte[] {Byte.MAX_VALUE}));
assertTrue(Base64.isArrayByteBase64(new byte[] {'A'}));
assertFalse(Base64.isArrayByteBase64(new byte[] {'A', Byte.MIN_VALUE}));
+ assertTrue(Base64.isArrayByteBase64(new byte[] {'A', 'Z', 'a'}));
+ assertTrue(Base64.isArrayByteBase64(new byte[] {'/','=','+'}));
+ assertFalse(Base64.isArrayByteBase64(new byte[] {'$'}));
}
public void testObjectDecodeWithInvalidParameter() throws Exception {
@@ -531,7 +534,7 @@
Base64 b64 = new Base64();
try {
- Object o = new String( "Yadayadayada" );
+ Object o = "Yadayadayada";
b64.decode( o );
} catch( Exception e ) {
exceptionThrown = true;
@@ -545,7 +548,7 @@
String original = "Hello World!";
byte[] bArray =
- Base64.encodeBase64( (new String(original)).getBytes() );
+ Base64.encodeBase64(original.getBytes() );
Object o = bArray;
Base64 b64 = new Base64();
@@ -563,7 +566,7 @@
Base64 b64 = new Base64();
try {
- Object o = new String( "Yadayadayada" );
+ Object o = "Yadayadayada";
b64.encode( o );
} catch( Exception e ) {
exceptionThrown = true;
@@ -607,7 +610,7 @@
String dest = new String( decodedWithWS );
- assertTrue( "Dest string doesn't equals the original",
+ assertTrue( "Dest string doesn't equal the original",
dest.equals( orig ) );
}
@@ -632,9 +635,9 @@
String destFromWS = new String( decodedWithWS );
String destFromNoWS = new String( decodedNoWS );
- assertTrue( "Dest string doesn't eausl original",
+ assertTrue( "Dest string doesn't equal original",
destFromWS.equals( orig ) );
- assertTrue( "Dest string doesn't eausl original",
+ assertTrue( "Dest string doesn't equal original",
destFromNoWS.equals( orig ) );
}