Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
36   91   7   5.14
0   59   0.19   7
7     1  
1    
 
  FormallyProvedStateTest       Line # 30 36 7 100% 1.0
 
  (6)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.se.state;
17   
18    import java.util.HashSet;
19    import java.util.Set;
20   
21    import org.qedeq.base.test.QedeqTestCase;
22    import org.qedeq.kernel.se.state.FormallyProvedState;
23   
24   
25    /**
26    * Test class.
27    *
28    * @author Michael Meyling
29    */
 
30    public class FormallyProvedStateTest extends QedeqTestCase {
31   
 
32  6 toggle public FormallyProvedStateTest(){
33  6 super();
34    }
35   
 
36  1 toggle public void testGetCode() {
37  1 assertEquals(0, FormallyProvedState.STATE_UNCHECKED.getCode());
38  1 assertEquals(21, FormallyProvedState.STATE_EXTERNAL_CHECKING.getCode());
39  1 assertEquals(22, FormallyProvedState.STATE_EXTERNAL_CHECKING_FAILED.getCode());
40  1 assertEquals(23, FormallyProvedState.STATE_INTERNAL_CHECKING.getCode());
41  1 assertEquals(24, FormallyProvedState.STATE_INTERNAL_CHECKING_FAILED.getCode());
42  1 assertEquals(25, FormallyProvedState.STATE_CHECKED.getCode());
43    }
44   
 
45  1 toggle public void testGetText() {
46  1 assertEquals("unchecked", FormallyProvedState.STATE_UNCHECKED.getText());
47  1 assertEquals("checking imports", FormallyProvedState.STATE_EXTERNAL_CHECKING.getText());
48  1 assertEquals("checking imports failed", FormallyProvedState.STATE_EXTERNAL_CHECKING_FAILED.getText());
49  1 assertEquals("checking formal proofs", FormallyProvedState.STATE_INTERNAL_CHECKING.getText());
50  1 assertEquals("checking formal proofs failed", FormallyProvedState.STATE_INTERNAL_CHECKING_FAILED.getText());
51  1 assertEquals("correct formal proofs for every proposition", FormallyProvedState.STATE_CHECKED.getText());
52    }
53   
 
54  1 toggle public void testToString() {
55  1 assertEquals("unchecked", FormallyProvedState.STATE_UNCHECKED.getText());
56  1 assertEquals("checking imports", FormallyProvedState.STATE_EXTERNAL_CHECKING.getText());
57  1 assertEquals("checking imports failed", FormallyProvedState.STATE_EXTERNAL_CHECKING_FAILED.getText());
58  1 assertEquals("checking formal proofs", FormallyProvedState.STATE_INTERNAL_CHECKING.getText());
59  1 assertEquals("checking formal proofs failed", FormallyProvedState.STATE_INTERNAL_CHECKING_FAILED.getText());
60  1 assertEquals("correct formal proofs for every proposition", FormallyProvedState.STATE_CHECKED.getText());
61    }
62   
 
63  1 toggle public void testIsFailure() {
64  1 assertFalse(FormallyProvedState.STATE_UNCHECKED.isFailure());
65  1 assertFalse(FormallyProvedState.STATE_EXTERNAL_CHECKING.isFailure());
66  1 assertTrue(FormallyProvedState.STATE_EXTERNAL_CHECKING_FAILED.isFailure());
67  1 assertFalse(FormallyProvedState.STATE_INTERNAL_CHECKING.isFailure());
68  1 assertTrue(FormallyProvedState.STATE_INTERNAL_CHECKING_FAILED.isFailure());
69  1 assertFalse(FormallyProvedState.STATE_CHECKED.isFailure());
70    }
71   
 
72  1 toggle public void testEquals() {
73  1 assertEquals(FormallyProvedState.STATE_CHECKED, FormallyProvedState.STATE_CHECKED);
74  1 assertFalse(FormallyProvedState.STATE_CHECKED.equals(
75    FormallyProvedState.STATE_INTERNAL_CHECKING_FAILED));
76  1 assertFalse(FormallyProvedState.STATE_CHECKED.equals(
77    FormallyProvedState.STATE_CHECKED.toString()));
78    }
79   
 
80  1 toggle public void testHashCode() {
81  1 final Set codes = new HashSet();
82  1 codes.add(new Integer(FormallyProvedState.STATE_UNCHECKED.hashCode()));
83  1 codes.add(new Integer(FormallyProvedState.STATE_EXTERNAL_CHECKING.hashCode()));
84  1 codes.add(new Integer(FormallyProvedState.STATE_EXTERNAL_CHECKING_FAILED.hashCode()));
85  1 codes.add(new Integer(FormallyProvedState.STATE_INTERNAL_CHECKING.hashCode()));
86  1 codes.add(new Integer(FormallyProvedState.STATE_INTERNAL_CHECKING_FAILED.hashCode()));
87  1 codes.add(new Integer(FormallyProvedState.STATE_CHECKED.hashCode()));
88  1 assertEquals(6, codes.size());
89    }
90   
91    }