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