1
2
3
4 package org.melati.util.test;
5
6 import org.apache.commons.codec.binary.Base64;
7 import org.melati.util.MD5Util;
8
9 import junit.framework.TestCase;
10
11
12
13
14
15
16 public class MD5UtilTest extends TestCase {
17
18
19
20
21 public MD5UtilTest(String name) {
22 super(name);
23 }
24
25
26
27
28
29 protected void setUp() throws Exception {
30 super.setUp();
31 }
32
33
34
35
36
37 protected void tearDown() throws Exception {
38 super.tearDown();
39 }
40
41
42
43
44 public void testEncode() throws Exception {
45 String in = "FIXME";
46 assertEquals("Vu+/vWlc77+9cEQI77+9MduH77+9bu+/ve+/vQ==",
47 new String(Base64.encodeBase64(MD5Util.encode(in).getBytes("UTF-8"))));
48 }
49
50 }