Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1827 | jmachado | 1 | package jomm.utils.test; |
2 | |||
3 | import jomm.utils.DesUtils; |
||
4 | import junit.framework.TestCase; |
||
5 | |||
6 | import java.io.FileNotFoundException; |
||
7 | import java.io.UnsupportedEncodingException; |
||
8 | |||
9 | /** |
||
10 | * Created by jorgemachado on 18/10/17. |
||
11 | */ |
||
12 | public class TestDesUtils extends TestCase |
||
13 | { |
||
14 | public void testEncrypts() throws 1.5.0/docs/api/java/io/FileNotFoundException.html">FileNotFoundException, 1.5.0/docs/api/java/io/UnsupportedEncodingException.html">UnsupportedEncodingException { |
||
15 | 1.5.0/docs/api/java/lang/String.html">String testEncrtytStr = "12 _abc#$%*()<>"; |
||
16 | |||
17 | 1.5.0/docs/api/java/lang/String.html">String encrypted = DesUtils.getInstance().encrypt(testEncrtytStr); |
||
18 | 1.5.0/docs/api/java/lang/String.html">String decripted = DesUtils.getInstance().decrypt(encrypted); |
||
19 | |||
20 | assertEquals( |
||
21 | decripted, |
||
22 | testEncrtytStr); |
||
23 | //System.out.println(encrypted); |
||
24 | //String encrypted2 = DesUtils.getInstance().encryptJava8(testEncrtytStr); |
||
25 | //System.out.println(encrypted2); |
||
26 | //assertEquals(encrypted,encrypted2); |
||
27 | //String decripted2 = DesUtils.getInstance().decryptJava8(encrypted2); |
||
28 | //assertEquals(testEncrtytStr, decripted2); |
||
29 | |||
30 | } |
||
31 | } |