Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
35   241   34   1,03
0   201   0,97   34
34     1  
1    
 
  SimpleMathParserTest       Line # 9 35 34 100% 1.0
 
  (30)
 
1    package org.qedeq.kernel.bo.parser;
2   
3    import java.io.File;
4    import java.util.List;
5   
6    import org.qedeq.base.io.TextInput;
7    import org.qedeq.kernel.xml.handler.parser.LoadXmlOperatorListUtility;
8   
 
9    public class SimpleMathParserTest extends AbstractParserTest {
10   
11    private static String[][] test = new String[][] {
12    { // 00
13    "A & B | C",
14    "OR(AND(A, B), C)"
15    }, { // 01
16    "A | B & C",
17    "OR(A, AND(B, C))"
18    }, { // 02
19    "A & B & C & D",
20    "AND(A, B, C, D)"
21    }, { // 03
22    "(A & B) & (C & D)",
23    "AND(AND(A, B), AND(C, D))"
24    }, { // 04
25    "((A & B) & C) & D",
26    "AND(AND(AND(A, B), C), D)"
27    }, { // 05
28    "A & (B & (C & D))",
29    "AND(A, AND(B, AND(C, D)))"
30    }, { // 06
31    "(((((A)))))",
32    "A"
33    }, { // 07
34    "~A",
35    "NOT(A)"
36    }, { // 08
37    "~~A",
38    "NOT(NOT(A))"
39    }, { // 09
40    "A => B",
41    "IMPL(A, B)"
42    }, { // 10
43    "A => B | C",
44    "IMPL(A, OR(B, C))"
45    }, { // 11
46    "A | B => C",
47    "IMPL(OR(A, B), C)"
48    }, { // 12
49    "A | B => A & B",
50    "IMPL(OR(A, B), AND(A, B))"
51    }, { // 13
52    "(A => B) => C",
53    "IMPL(IMPL(A, B), C)"
54    }, { // 14
55    "A & B => B & D",
56    "IMPL(AND(A, B), AND(B, D))"
57    }, { // 15
58    "A & B | C => B | D & E",
59    "IMPL(OR(AND(A, B), C), OR(B, AND(D, E)))"
60    }, { // 16
61    "A <=> B",
62    "EQUI(A, B)"
63    }, { // 17
64    "A <=> B | C",
65    "EQUI(A, OR(B, C))"
66    }, { // 18
67    "A | B <=> C",
68    "EQUI(OR(A, B), C)"
69    }, { // 19
70    "A | B <=> A & B",
71    "EQUI(OR(A, B), AND(A, B))"
72    }, { // 20
73    "A <=> B <=> C",
74    "EQUI(A, B, C)"
75    }, { // 21
76    "all x A & B \n", // "\n" to separate this formula from the next one
77    "ALL(x, AND(A, B))"
78    }, { // 22
79    "all x x = y y",
80    "ALL(x, EQUAL(x, y), y)"
81    }, { // 23
82    "x & y | z | a & -(b | c | d & k) & v",
83    "OR(AND(x, y), z, AND(a, NOT(OR(b, c, AND(d, k))), v))"
84    }, { // 24
85    "x & y | z | a & -(b | c | d & k) & v => exists y z & a <=> GO <=> GI\n",
86    "IMPL(OR(AND(x, y), z, AND(a, NOT(OR(b, c, AND(d, k))), v)), EXISTS(y, EQUI(AND(z, a), GO, GI)))"
87    }, { // 25
88    "{x, y, z}",
89    "SET(x, y, z)"
90    }, { // 26
91    "{x}",
92    "SET(x)"
93    }, { // 27
94    "{}",
95    "SET()"
96    }, { // 28
97    "{x : y}",
98    "SETPROP(x, y)"
99    }
100   
101    };
102   
 
103  30 toggle public SimpleMathParserTest(String arg0) {
104  30 super(arg0);
105    }
106   
 
107  30 toggle protected void setUp() throws Exception {
108  30 super.setUp();
109    }
110   
 
111  30 toggle protected void tearDown() throws Exception {
112  30 super.tearDown();
113    }
114   
 
115  146 toggle protected String[][] getTest() {
116  146 return test;
117    }
118   
 
119  30 toggle protected MathParser createParser(final TextInput input) throws Exception {
120  30 final List operators = LoadXmlOperatorListUtility.getOperatorList(new File(getIndir(),
121    "parser/simpleMathOperators.xml"));
122  30 return new SimpleMathParser(input, operators);
123    }
124   
 
125  1 toggle public void testReadMaximalTerm00() throws Exception {
126  1 internalTest(0);
127    }
128   
 
129  1 toggle public void testReadMaximalTerm01() throws Exception {
130  1 internalTest(1);
131    }
132   
 
133  1 toggle public void testReadMaximalTerm02() throws Exception {
134  1 internalTest(2);
135    }
136   
 
137  1 toggle public void testReadMaximalTerm03() throws Exception {
138  1 internalTest(3);
139    }
140   
 
141  1 toggle public void testReadMaximalTerm04() throws Exception {
142  1 internalTest(4);
143    }
144   
 
145  1 toggle public void testReadMaximalTerm05() throws Exception {
146  1 internalTest(5);
147    }
148   
 
149  1 toggle public void testReadMaximalTerm06() throws Exception {
150  1 internalTest(6);
151    }
152   
 
153  1 toggle public void testReadMaximalTerm07() throws Exception {
154  1 internalTest(7);
155    }
156   
 
157  1 toggle public void testReadMaximalTerm08() throws Exception {
158  1 internalTest(8);
159    }
160   
 
161  1 toggle public void testReadMaximalTerm09() throws Exception {
162  1 internalTest(9);
163    }
164   
 
165  1 toggle public void testReadMaximalTerm10() throws Exception {
166  1 internalTest(10);
167    }
168   
 
169  1 toggle public void testReadMaximalTerm11() throws Exception {
170  1 internalTest(11);
171    }
172   
 
173  1 toggle public void testReadMaximalTerm12() throws Exception {
174  1 internalTest(12);
175    }
176   
 
177  1 toggle public void testReadMaximalTerm13() throws Exception {
178  1 internalTest(13);
179    }
180   
 
181  1 toggle public void testReadMaximalTerm14() throws Exception {
182  1 internalTest(14);
183    }
184   
 
185  1 toggle public void testReadMaximalTerm15() throws Exception {
186  1 internalTest(15);
187    }
188   
 
189  1 toggle public void testReadMaximalTerm16() throws Exception {
190  1 internalTest(16);
191    }
192   
 
193  1 toggle public void testReadMaximalTerm17() throws Exception {
194  1 internalTest(17);
195    }
196   
 
197  1 toggle public void testReadMaximalTerm18() throws Exception {
198  1 internalTest(18);
199    }
200   
 
201  1 toggle public void testReadMaximalTerm19() throws Exception {
202  1 internalTest(19);
203    }
204   
 
205  1 toggle public void testReadMaximalTerm20() throws Exception {
206  1 internalTest(20);
207    }
208   
 
209  1 toggle public void testReadMaximalTerm21() throws Exception {
210  1 internalTest(21);
211    }
212   
 
213  1 toggle public void testReadMaximalTerm22() throws Exception {
214  1 internalTest(22);
215    }
216   
 
217  1 toggle public void testReadMaximalTerm23() throws Exception {
218  1 internalTest(23);
219    }
220   
 
221  1 toggle public void testReadMaximalTerm24() throws Exception {
222  1 internalTest(24);
223    }
224   
 
225  1 toggle public void testReadMaximalTerm25() throws Exception {
226  1 internalTest(25);
227    }
228   
 
229  1 toggle public void testReadMaximalTerm26() throws Exception {
230  1 internalTest(26);
231    }
232   
 
233  1 toggle public void testReadMaximalTerm27() throws Exception {
234  1 internalTest(27);
235    }
236   
 
237  1 toggle public void testReadMaximalTerm28() throws Exception {
238  1 internalTest(28);
239    }
240   
241    }