Skip to content

Commit dcc90dc

Browse files
committed
add testcase
1 parent ca885f8 commit dcc90dc

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

core/src/test/java/cn/leancloud/codec/SHA1Test.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@
22

33
import junit.framework.TestCase;
44

5+
import java.util.UUID;
6+
57
public class SHA1Test extends TestCase {
68
public SHA1Test(String name) {
79
super(name);
810
}
911

1012
public void testCommons() throws Exception {
13+
AES aesAlgo = new AES();
1114
String input = "searchQuery.orderByAscending";
1215
String encodedString = SHA1.compute(input.getBytes());
13-
System.out.println(encodedString);
16+
String md5 = MDFive.computeMD5(input);
17+
String aes = aesAlgo.encrypt(input.getBytes());
18+
System.out.println(input + "-(MD5)->" + md5);
19+
System.out.println(input + "-(AES)->" + aes);
20+
System.out.println(input + "-(SHA1)->" + encodedString);
1421
assertTrue(encodedString.equals("2256f4f30dfe6198e1d6a2b94fe2c69bc5ed559e"));
22+
23+
input = UUID.randomUUID().toString();
24+
encodedString = SHA1.compute(input.getBytes());
25+
aes = aesAlgo.encrypt(input.getBytes());
26+
md5 = MDFive.computeMD5(input);
27+
System.out.println(input + "-(MD5)->" + md5);
28+
System.out.println(input + "-(AES)->" + aes);
29+
System.out.println(input + "-(SHA1)->" + encodedString);
1530
}
1631
}

0 commit comments

Comments
 (0)