commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r789417 - in /commons/sandbox/runtime/trunk/src: main/java/org/apache/commons/runtime/io/File.java test/org/apache/commons/runtime/TestStrings.java
Date Mon, 29 Jun 2009 19:34:14 GMT
Author: mturk
Date: Mon Jun 29 19:34:14 2009
New Revision: 789417

URL: http://svn.apache.org/viewvc?rev=789417&view=rev
Log:
Add full Base64 decode/encode

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java
    commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStrings.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java?rev=789417&r1=789416&r2=789417&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java Mon
Jun 29 19:34:14 2009
@@ -452,3 +452,4 @@
         return 0L;
     }
 }
+

Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStrings.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStrings.java?rev=789417&r1=789416&r2=789417&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStrings.java (original)
+++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStrings.java Mon
Jun 29 19:34:14 2009
@@ -18,6 +18,7 @@
 
 import org.apache.commons.runtime.exception.*;
 import org.apache.commons.runtime.util.Ascii;
+import org.apache.commons.runtime.util.Base64;
 import java.lang.System;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
@@ -259,5 +260,23 @@
         assertEquals("MinOverflow",  Long.MIN_VALUE, l);
     }
 
+    public void testBase64EncodeString()
+        throws Exception
+    {
+        assertEquals("Base64 A", "QQ==",
+                                  Base64.encode("A"));
+        assertEquals("Base64 S", "QmFzZSA2NCBlbmNvZGluZw==",
+                                  Base64.encode("Base 64 encoding"));
+    }
+
+    public void testBase64DecodeString()
+        throws Exception
+    {
+        assertEquals("Base64 A", "A",
+                                  Base64.decode("QQ=="));
+        assertEquals("Base64 S", "Base 64 encoding",
+                                  Base64.decode("QmFzZSA2NCBlbmNvZGluZw=="));
+    }
+
 }
 



Mime
View raw message