Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Base64Test.java

00001 package edu.virtualschool.jco.test;
00002 
00003 import junit.framework.TestCase;
00004 import edu.virtualschool.jco.JCOBase64;
00005 import edu.virtualschool.jwaa.IntervalTimer;
00006 
00007 public class Base64Test extends TestCase
00008 {
00009   public static void main(String[] args)
00010   {
00011     junit.textui.TestRunner.run(Base64Test.class);
00012   }
00013   public Base64Test(String arg0)
00014   {
00015     super(arg0);
00016   }
00017   public void testValid()
00018   {
00019     String s = "test string";
00020     byte[] bytes = s.getBytes();
00021     IntervalTimer t = new IntervalTimer();
00022     String d = JCOBase64.encode(bytes);
00023     System.out.println(t + " Base64 encode");
00024     byte[] b = JCOBase64.decode(d);
00025     System.out.println(t + " Base64 decode");
00026     assertEquals(new String(b), s);
00027   }
00028 }