Clover Coverage Report - Liquibase Core 2.0.3-SNAPSHOT
Coverage timestamp: Sat Aug 6 2011 11:33:15 EDT
17   41   4   4.25
0   35   0.24   4
4     1  
1    
 
  CheckSumTest       Line # 8 17 0% 4 0 100% 1.0
 
  (4)
 
1    package liquibase.change;
2   
3    import static org.junit.Assert.*;
4    import org.junit.Test;
5   
6    import java.io.ByteArrayInputStream;
7   
 
8    public class CheckSumTest {
 
9  1 toggle @Test
10    public void testCompute_String() {
11  1 String valueToHash = "asdf";
12  1 CheckSum checkSum = CheckSum.compute(valueToHash);
13  1 assertEquals(CheckSum.getCurrentVersion(), checkSum.getVersion());
14  1 assertFalse(checkSum.toString().equals(valueToHash));
15    }
16   
 
17  1 toggle @Test
18    public void testCompute_Stream() {
19  1 String valueToHash = "asdf";
20  1 CheckSum checkSum = CheckSum.compute(new ByteArrayInputStream(valueToHash.getBytes()));
21  1 assertEquals(CheckSum.getCurrentVersion(), checkSum.getVersion());
22  1 assertFalse(checkSum.toString().equals(valueToHash));
23  1 assertEquals(CheckSum.compute(valueToHash).toString(), checkSum.toString());
24    }
25   
 
26  1 toggle @Test
27    public void parse_v2() {
28  1 String checksumString = "2:asdf";
29  1 CheckSum checkSum = CheckSum.parse(checksumString);
30  1 assertEquals(2, checkSum.getVersion());
31  1 assertEquals(checksumString, checksumString);
32    }
33   
 
34  1 toggle @Test
35    public void parse_v1() {
36  1 String checksumString = "asdf";
37  1 CheckSum checkSum = CheckSum.parse(checksumString);
38  1 assertEquals(1, checkSum.getVersion());
39  1 assertEquals("1:asdf", checkSum.toString());
40    }
41    }