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