1 21 22 package org.opensubsystems.core.util; 23 24 import junit.framework.TestCase; 25 26 import org.opensubsystems.core.error.OSSException; 27 28 36 public class PasswordUtilsTest extends TestCase 37 { 38 43 public PasswordUtilsTest( 44 String arg0 45 ) 46 { 47 super(arg0); 48 } 49 50 55 protected void setUp( 56 ) throws Exception 57 { 58 super.setUp(); 59 } 60 61 66 protected void tearDown() throws Exception 67 { 68 super.tearDown(); 69 } 70 71 76 public void testGetMessageDigest( 77 ) throws OSSException 78 { 79 String strTest = "Text to calculate digest for"; 80 String strDigest; 81 82 strDigest = PasswordUtils.getMessageDigest(strTest); 83 84 assertNotNull("Digest cannot be null", strDigest); 85 assertTrue("Digest cannot be empty string", strDigest.length() > 0); 86 assertTrue("Digest cannot be the same as the original text", 87 !strDigest.equals(strTest)); 88 } 89 } 90 | Popular Tags |