1 5 package org.jresearch.gossip.util.test; 6 7 import java.io.IOException ; 8 import java.io.UnsupportedEncodingException ; 9 10 import org.jresearch.gossip.IConst; 11 import org.jresearch.gossip.util.DesEncrypter; 12 13 import junit.framework.TestCase; 14 15 16 20 public class DesEncrypterTest extends TestCase { 21 private DesEncrypter des; 22 private static final String TEST_VAL="test"; 23 26 protected void setUp() throws Exception { 27 super.setUp(); 28 des=new DesEncrypter(IConst.VALUES.ENCRYPTER_KEY); 29 } 30 31 public void testEncrypt() throws UnsupportedEncodingException { 32 String str=des.encrypt(TEST_VAL); 33 System.out.println(str); 34 } 35 36 public void testDecrypt() throws IOException { 37 String str=des.encrypt(TEST_VAL); 38 System.out.println(des.decrypt(str)); 39 } 40 41 } 42 | Popular Tags |