1 package org.apache.maven.plugin.install;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import junit.framework.Assert;
23 import junit.framework.TestCase;
24
25 import java.io.ByteArrayInputStream;
26
27 public class DualDigesterTest
28 extends TestCase
29 {
30 public void testGetMd5()
31 throws Exception
32 {
33 DualDigester dualDigester = new DualDigester();
34 dualDigester.calculate( new ByteArrayInputStream( "A Dog And A Cat".getBytes() ) );
35 Assert.assertEquals( "39bc6b34be719cab3a3dc922445aae7c", dualDigester.getMd5() );
36 Assert.assertEquals( "d07b1e7ecc7986b3f1126ddf1b67e3601ec362a9", dualDigester.getSha1() );
37 dualDigester.calculate( new ByteArrayInputStream( "Yep, we do it again".getBytes() ) );
38 Assert.assertEquals( "8cd83a9cbbd7076f668c2bcc0379ed49", dualDigester.getMd5() );
39 Assert.assertEquals( "194ebcb8d168cffdc25c3b854d6187b568cf6273", dualDigester.getSha1() );
40 }
41
42 }