01: package com.xoetrope.service.test;
02:
03: import junit.framework.TestCase;
04:
05: /**
06: * <p>Copyright (c) Xoetrope Ltd. 2001-2004</p>
07: * $Revision: 1.1 $
08: */
09: public class Base64Test extends TestCase {
10: public Base64Test() {
11: }
12:
13: public static void main(String args[]) {
14: Base64Test test = new Base64Test();
15: test.testBase64();
16: }
17:
18: public void testBase64() {
19: String testString = "This is a test";
20: org.apache.catalina.util.Base64 b64Encode = new org.apache.catalina.util.Base64();
21: byte res[] = b64Encode.encode(testString.getBytes());
22: byte decodeRes[] = b64Encode.decode(res);
23: String resStr = new String(decodeRes).trim();
24: assertTrue(testString.compareTo(resStr) == 0);
25: }
26:
27: }
|