KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > appfuse > util > StringUtilTest


1 package org.appfuse.util;
2
3 import junit.framework.TestCase;
4
5
6 public class StringUtilTest extends TestCase {
7     public StringUtilTest(String JavaDoc name) {
8         super(name);
9     }
10
11     protected void setUp() throws Exception JavaDoc {
12         super.setUp();
13     }
14
15     protected void tearDown() throws Exception JavaDoc {
16         super.tearDown();
17     }
18
19     public void testEncodePassword() throws Exception JavaDoc {
20         String JavaDoc password = "tomcat";
21         String JavaDoc encrypted = "536c0b339345616c1b33caf454454d8b8a190d6c";
22         assertEquals(StringUtil.encodePassword(password, "SHA"), encrypted);
23     }
24
25     public static void main(String JavaDoc[] args) {
26         junit.textui.TestRunner.run(StringUtilTest.class);
27     }
28 }
29
Popular Tags