1 23 24 package com.rift.coad.lib.thirdparty.base64; 25 26 import java.io.ByteArrayOutputStream ; 28 import java.io.BufferedInputStream ; 29 30 import junit.framework.*; 32 33 34 38 public class Base64Test extends TestCase { 39 40 public Base64Test(String testName) { 41 super(testName); 42 } 43 44 protected void setUp() throws Exception { 45 } 46 47 protected void tearDown() throws Exception { 48 } 49 50 public static Test suite() { 51 TestSuite suite = new TestSuite(Base64Test.class); 52 53 return suite; 54 } 55 56 59 public void testEncodeString() { 60 System.out.println("encodeString"); 61 62 java.io.Serializable serializableObject = null; 63 64 String startBuff = "This is me testing the starting point"; 65 String encodedString = Base64.encodeBytes(startBuff.getBytes()); 66 System.out.println(encodedString); 67 String endBuff = new String (Base64.decode(encodedString)); 68 if (!startBuff.equals(endBuff)) { 69 fail("Did not decode properly"); 70 } 71 } 72 73 74 } 75 | Popular Tags |