• R/O
  • SSH
  • HTTPS

manjyudigest: Commit


Commit MetaInfo

Revision4 (tree)
Time2012-11-30 08:04:16
Authoriga

Log Message

New projejct.

Change Summary

Incremental Difference

--- manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestUtilTest.java (nonexistent)
+++ manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestUtilTest.java (revision 4)
@@ -0,0 +1,86 @@
1+package org.manjyu.digest;
2+
3+import java.io.FileInputStream;
4+import java.io.InputStream;
5+
6+import org.junit.Test;
7+
8+public class ManjyuDigestUtilTest {
9+ @Test
10+ public void testGetDigestedMessageFromFile() throws Exception {
11+ final InputStream inStream = new FileInputStream("./tmp/manjyu-0.0.9.war");
12+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("MD5", inStream);
13+ inStream.close();
14+ System.out.println(ManjyuDigestUtil.toHexString(result));
15+ }
16+
17+ @Test
18+ public void testGetDigestedMessageStringByteArrayMD2() throws Exception {
19+ // RFC 1319
20+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("MD2", "ABC".getBytes("UTF-8"));
21+ System.out.println(ManjyuDigestUtil.toHexString(result));
22+ }
23+
24+ @Test
25+ public void testGetDigestedMessageStringByteArrayMD5() throws Exception {
26+ // RFC 1321
27+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("MD5", "ABC".getBytes("UTF-8"));
28+ System.out.println(ManjyuDigestUtil.toHexString(result));
29+ }
30+
31+ @Test
32+ public void testGetDigestedMessageStringByteArraySHA1() throws Exception {
33+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("SHA-1", "ABC".getBytes("UTF-8"));
34+ System.out.println(ManjyuDigestUtil.toHexString(result));
35+ }
36+
37+ @Test
38+ public void testGetDigestedMessageStringByteArraySHA256() throws Exception {
39+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("SHA-256", "ABC".getBytes("UTF-8"));
40+ System.out.println(ManjyuDigestUtil.toHexString(result));
41+ }
42+
43+ @Test
44+ public void testGetDigestedMessageStringByteArraySHA384() throws Exception {
45+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("SHA-384", "ABC".getBytes("UTF-8"));
46+ System.out.println(ManjyuDigestUtil.toHexString(result));
47+ }
48+
49+ @Test
50+ public void testGetDigestedMessageStringByteArraySHA512() throws Exception {
51+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("SHA-512", "ABC".getBytes("UTF-8"));
52+ System.out.println(ManjyuDigestUtil.toHexString(result));
53+ }
54+
55+ @Test
56+ public void testGetDigestedMessageStringByteArrayByteArray() throws Exception {
57+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("SHA-512", "ABC".getBytes("UTF-8"),
58+ "DEF".getBytes("UTF-8"));
59+ System.out.println(ManjyuDigestUtil.toHexString(result));
60+ }
61+
62+ @Test
63+ public void testGetDigestedMessageStringByteArrayByteArrayByteArray() throws Exception {
64+ final byte[] result = ManjyuDigestUtil.getDigestedMessage("SHA-512", "ABC".getBytes("UTF-8"),
65+ "DEF".getBytes("UTF-8"), "GHI".getBytes("UTF-8"));
66+ System.out.println(ManjyuDigestUtil.toHexString(result));
67+ }
68+
69+ @Test
70+ public void testGetDigestedStringStringString() throws Exception {
71+ final String result = ManjyuDigestUtil.getDigestedString("SHA-512", "ABC");
72+ System.out.println(result);
73+ }
74+
75+ @Test
76+ public void testGetDigestedStringStringStringString() throws Exception {
77+ final String result = ManjyuDigestUtil.getDigestedString("SHA-512", "ABC", "DEF");
78+ System.out.println(result);
79+ }
80+
81+ @Test
82+ public void testGetDigestedStringStringStringStringString() throws Exception {
83+ final String result = ManjyuDigestUtil.getDigestedString("SHA-512", "ABC", "DEF", "GHI");
84+ System.out.println(result);
85+ }
86+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestMd5UtilTest.java (nonexistent)
+++ manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestMd5UtilTest.java (revision 4)
@@ -0,0 +1,42 @@
1+package org.manjyu.digest;
2+
3+import org.junit.Test;
4+
5+public class ManjyuDigestMd5UtilTest {
6+ @Test
7+ public void testGetDigestedMessageByteArray() throws Exception {
8+ final byte[] result = ManjyuDigestMd5Util.getDigestedMessage("ABC".getBytes("UTF-8"));
9+ System.out.println(ManjyuDigestUtil.toHexString(result));
10+ }
11+
12+ @Test
13+ public void testGetDigestedMessageStringByteArrayByteArray() throws Exception {
14+ final byte[] result = ManjyuDigestMd5Util.getDigestedMessage("ABC".getBytes("UTF-8"), "DEF".getBytes("UTF-8"));
15+ System.out.println(ManjyuDigestUtil.toHexString(result));
16+ }
17+
18+ @Test
19+ public void testGetDigestedMessageStringByteArrayByteArrayByteArray() throws Exception {
20+ final byte[] result = ManjyuDigestMd5Util.getDigestedMessage("ABC".getBytes("UTF-8"), "DEF".getBytes("UTF-8"),
21+ "GHI".getBytes("UTF-8"));
22+ System.out.println(ManjyuDigestUtil.toHexString(result));
23+ }
24+
25+ @Test
26+ public void testGetDigestedStringStringString() {
27+ final String result = ManjyuDigestMd5Util.getDigestedString("ABC");
28+ System.out.println(result);
29+ }
30+
31+ @Test
32+ public void testGetDigestedStringStringStringString() {
33+ final String result = ManjyuDigestMd5Util.getDigestedString("ABC", "DEF");
34+ System.out.println(result);
35+ }
36+
37+ @Test
38+ public void testGetDigestedStringStringStringStringString() {
39+ final String result = ManjyuDigestMd5Util.getDigestedString("ABC", "DEF", "GHI");
40+ System.out.println(result);
41+ }
42+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestSha256UtilTest.java (nonexistent)
+++ manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestSha256UtilTest.java (revision 4)
@@ -0,0 +1,42 @@
1+package org.manjyu.digest;
2+
3+import org.junit.Test;
4+
5+public class ManjyuDigestSha256UtilTest {
6+ @Test
7+ public void testGetDigestedMessageByteArray() throws Exception {
8+ final byte[] result = ManjyuDigestSha256Util.getDigestedMessage("ABC".getBytes("UTF-8"));
9+ System.out.println(ManjyuDigestUtil.toHexString(result));
10+ }
11+
12+ @Test
13+ public void testGetDigestedMessageStringByteArrayByteArray() throws Exception {
14+ final byte[] result = ManjyuDigestSha256Util.getDigestedMessage("ABC".getBytes("UTF-8"), "DEF".getBytes("UTF-8"));
15+ System.out.println(ManjyuDigestUtil.toHexString(result));
16+ }
17+
18+ @Test
19+ public void testGetDigestedMessageStringByteArrayByteArrayByteArray() throws Exception {
20+ final byte[] result = ManjyuDigestSha256Util.getDigestedMessage("ABC".getBytes("UTF-8"), "DEF".getBytes("UTF-8"),
21+ "GHI".getBytes("UTF-8"));
22+ System.out.println(ManjyuDigestUtil.toHexString(result));
23+ }
24+
25+ @Test
26+ public void testGetDigestedStringStringString() {
27+ final String result = ManjyuDigestSha256Util.getDigestedString("ABC");
28+ System.out.println(result);
29+ }
30+
31+ @Test
32+ public void testGetDigestedStringStringStringString() {
33+ final String result = ManjyuDigestSha256Util.getDigestedString("ABC", "DEF");
34+ System.out.println(result);
35+ }
36+
37+ @Test
38+ public void testGetDigestedStringStringStringStringString() {
39+ final String result = ManjyuDigestSha256Util.getDigestedString("ABC", "DEF", "GHI");
40+ System.out.println(result);
41+ }
42+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestSha1UtilTest.java (nonexistent)
+++ manjyu-digest/trunk/test/src/org/manjyu/digest/ManjyuDigestSha1UtilTest.java (revision 4)
@@ -0,0 +1,42 @@
1+package org.manjyu.digest;
2+
3+import org.junit.Test;
4+
5+public class ManjyuDigestSha1UtilTest {
6+ @Test
7+ public void testGetDigestedMessageByteArray() throws Exception {
8+ final byte[] result = ManjyuDigestSha1Util.getDigestedMessage("ABC".getBytes("UTF-8"));
9+ System.out.println(ManjyuDigestUtil.toHexString(result));
10+ }
11+
12+ @Test
13+ public void testGetDigestedMessageStringByteArrayByteArray() throws Exception {
14+ final byte[] result = ManjyuDigestSha1Util.getDigestedMessage("ABC".getBytes("UTF-8"), "DEF".getBytes("UTF-8"));
15+ System.out.println(ManjyuDigestUtil.toHexString(result));
16+ }
17+
18+ @Test
19+ public void testGetDigestedMessageStringByteArrayByteArrayByteArray() throws Exception {
20+ final byte[] result = ManjyuDigestSha1Util.getDigestedMessage("ABC".getBytes("UTF-8"), "DEF".getBytes("UTF-8"),
21+ "GHI".getBytes("UTF-8"));
22+ System.out.println(ManjyuDigestUtil.toHexString(result));
23+ }
24+
25+ @Test
26+ public void testGetDigestedStringStringString() {
27+ final String result = ManjyuDigestSha1Util.getDigestedString("ABC");
28+ System.out.println(result);
29+ }
30+
31+ @Test
32+ public void testGetDigestedStringStringStringString() {
33+ final String result = ManjyuDigestSha1Util.getDigestedString("ABC", "DEF");
34+ System.out.println(result);
35+ }
36+
37+ @Test
38+ public void testGetDigestedStringStringStringStringString() {
39+ final String result = ManjyuDigestSha1Util.getDigestedString("ABC", "DEF", "GHI");
40+ System.out.println(result);
41+ }
42+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Show on old repository browser