Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
38   253   35   1.09
0   209   0.92   35
35     1  
1    
 
  SimpleMathParserTest       Line # 10 38 35 97.3% 0.9726027
 
  (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.DummyInternalKernelServices;
8    import org.qedeq.kernel.xml.handler.parser.LoadXmlOperatorListUtility;
9   
 
10    public class SimpleMathParserTest extends AbstractParserTestCase {
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    /**
105    * Constructor.
106    */
 
107  30 toggle public SimpleMathParserTest(String arg0) {
108  30 super(arg0);
109    }
110   
 
111  30 toggle protected void setUp() throws Exception {
112  30 super.setUp();
113    }
114   
 
115  30 toggle protected void tearDown() throws Exception {
116  30 super.tearDown();
117    }
118   
 
119  146 toggle protected String[][] getTest() {
120  146 return test;
121    }
122   
 
123  30 toggle protected MathParser createParser(final TextInput input) throws Exception {
124  30 final List operators = LoadXmlOperatorListUtility.getOperatorList(
125    new DummyInternalKernelServices(),
126    new File(getIndir(),
127    "parser/simpleMathOperators.xml"));
128  30 final MathParser parser = new SimpleMathParser();
129  30 parser.setParameters(input, operators);
130  30 return parser;
131    }
132   
 
133  1 toggle public void testReadMaximalTerm00() throws Exception {
134  1 internalTest(0);
135    }
136   
 
137  1 toggle public void testReadMaximalTerm01() throws Exception {
138  1 internalTest(1);
139    }
140   
 
141  1 toggle public void testReadMaximalTerm02() throws Exception {
142  1 internalTest(2);
143    }
144   
 
145  1 toggle public void testReadMaximalTerm03() throws Exception {
146  1 internalTest(3);
147    }
148   
 
149  1 toggle public void testReadMaximalTerm04() throws Exception {
150  1 internalTest(4);
151    }
152   
 
153  1 toggle public void testReadMaximalTerm05() throws Exception {
154  1 internalTest(5);
155    }
156   
 
157  1 toggle public void testReadMaximalTerm06() throws Exception {
158  1 internalTest(6);
159    }
160   
 
161  1 toggle public void testReadMaximalTerm07() throws Exception {
162  1 internalTest(7);
163    }
164   
 
165  1 toggle public void testReadMaximalTerm08() throws Exception {
166  1 internalTest(8);
167    }
168   
 
169  1 toggle public void testReadMaximalTerm09() throws Exception {
170  1 internalTest(9);
171    }
172   
 
173  1 toggle public void testReadMaximalTerm10() throws Exception {
174  1 internalTest(10);
175    }
176   
 
177  1 toggle public void testReadMaximalTerm11() throws Exception {
178  1 internalTest(11);
179    }
180   
 
181  1 toggle public void testReadMaximalTerm12() throws Exception {
182  1 internalTest(12);
183    }
184   
 
185  1 toggle public void testReadMaximalTerm13() throws Exception {
186  1 internalTest(13);
187    }
188   
 
189  1 toggle public void testReadMaximalTerm14() throws Exception {
190  1 internalTest(14);
191    }
192   
 
193  1 toggle public void testReadMaximalTerm15() throws Exception {
194  1 internalTest(15);
195    }
196   
 
197  1 toggle public void testReadMaximalTerm16() throws Exception {
198  1 internalTest(16);
199    }
200   
 
201  1 toggle public void testReadMaximalTerm17() throws Exception {
202  1 internalTest(17);
203    }
204   
 
205  1 toggle public void testReadMaximalTerm18() throws Exception {
206  1 internalTest(18);
207    }
208   
 
209  1 toggle public void testReadMaximalTerm19() throws Exception {
210  1 internalTest(19);
211    }
212   
 
213  1 toggle public void testReadMaximalTerm20() throws Exception {
214  1 internalTest(20);
215    }
216   
 
217  1 toggle public void testReadMaximalTerm21() throws Exception {
218  1 internalTest(21);
219    }
220   
 
221  1 toggle public void testReadMaximalTerm22() throws Exception {
222  1 internalTest(22);
223    }
224   
 
225  1 toggle public void testReadMaximalTerm23() throws Exception {
226  1 internalTest(23);
227    }
228   
 
229  1 toggle public void testReadMaximalTerm24() throws Exception {
230  1 internalTest(24);
231    }
232   
 
233  1 toggle public void testReadMaximalTerm25() throws Exception {
234  1 internalTest(25);
235    }
236   
 
237  1 toggle public void testReadMaximalTerm26() throws Exception {
238  1 internalTest(26);
239    }
240   
 
241  1 toggle public void testReadMaximalTerm27() throws Exception {
242  1 internalTest(27);
243    }
244   
 
245  1 toggle public void testReadMaximalTerm28() throws Exception {
246  1 internalTest(28);
247    }
248   
 
249  0 toggle protected String[][] getExceptionTest() {
250  0 return null;
251    }
252   
253    }