1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.logic.wf; |
17 |
|
|
18 |
|
import org.qedeq.kernel.bo.logic.common.FormulaChecker; |
19 |
|
import org.qedeq.kernel.bo.logic.common.LogicalCheckExceptionList; |
20 |
|
import org.qedeq.kernel.se.base.list.Element; |
21 |
|
import org.qedeq.kernel.se.common.DefaultModuleAddress; |
22 |
|
import org.qedeq.kernel.se.common.ModuleContext; |
23 |
|
import org.qedeq.kernel.xml.parser.BasicParser; |
24 |
|
|
25 |
|
|
26 |
|
@link |
27 |
|
|
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (70) |
Complexity: 15 |
Complexity Density: 0.27 |
|
31 |
|
public class FormulaCheckerPredicateFormulaTest extends AbstractFormulaChecker { |
32 |
|
|
33 |
|
private ModuleContext context; |
34 |
|
|
35 |
|
private FormulaChecker checker; |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
37 |
13
|
protected void setUp() throws Exception {... |
38 |
13
|
context = new ModuleContext(new DefaultModuleAddress("http://memory.org/sample.xml"), "getElement()"); |
39 |
13
|
checker = new FormulaCheckerImpl(); |
40 |
|
} |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
13
|
protected void tearDown() throws Exception {... |
43 |
13
|
context = null; |
44 |
|
} |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@throws |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
53 |
1
|
public void testPredicateFormulaPositive01() throws Exception {... |
54 |
1
|
final Element ele = BasicParser.createElement("<PREDVAR id=\"A\"/>"); |
55 |
|
|
56 |
1
|
assertFalse(checker.checkFormula(ele, context).hasErrors()); |
57 |
1
|
assertFalse(checker.checkFormula(ele, context, getChecker()).hasErrors()); |
58 |
1
|
assertFalse(checker.checkFormula(ele, context, getCheckerWithoutClass()) |
59 |
|
.hasErrors()); |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
@throws |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
69 |
1
|
public void testPredicateFormulaPositive02() throws Exception {... |
70 |
1
|
final Element ele = BasicParser.createElement("<PREDCON ref=\"true\"/>"); |
71 |
|
|
72 |
1
|
assertFalse(checker.checkFormula(ele, context).hasErrors()); |
73 |
1
|
assertFalse(checker.checkFormula(ele, context, getChecker()).hasErrors()); |
74 |
1
|
assertFalse(checker.checkFormula(ele, context, getCheckerWithoutClass()) |
75 |
|
.hasErrors()); |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
@throws |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
85 |
1
|
public void testPredicateFormulaNegative01() throws Exception {... |
86 |
1
|
final Element ele = BasicParser.createElement("<PREDVAR />"); |
87 |
|
|
88 |
1
|
LogicalCheckExceptionList list = |
89 |
|
checker.checkFormula(ele, context, getChecker()); |
90 |
1
|
assertEquals(1, list.size()); |
91 |
1
|
assertEquals(30720, list.get(0).getErrorCode()); |
92 |
|
} |
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
@throws |
100 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
101 |
1
|
public void testPredicateFormulaNegative02() throws Exception {... |
102 |
1
|
final Element ele = BasicParser.createElement("<PREDCON />"); |
103 |
|
|
104 |
1
|
LogicalCheckExceptionList list = |
105 |
|
checker.checkFormula(ele, context, getChecker()); |
106 |
1
|
assertEquals(1, list.size()); |
107 |
1
|
assertEquals(30720, list.get(0).getErrorCode()); |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
@throws |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
117 |
1
|
public void testPredicateFormulaNegative09() throws Exception {... |
118 |
1
|
final Element ele = BasicParser.createElement("<PREDVAR > <VAR id=\"x\" /> </PREDVAR>"); |
119 |
|
|
120 |
1
|
LogicalCheckExceptionList list = |
121 |
|
checker.checkFormula(ele, context, getChecker()); |
122 |
1
|
assertEquals(1, list.size()); |
123 |
1
|
assertEquals(30730, list.get(0).getErrorCode()); |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
@throws |
133 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
134 |
1
|
public void testPredicateFormulaNegative10() throws Exception {... |
135 |
1
|
final Element ele = BasicParser.createElement("<PREDCON > <VAR id=\"x\" /> </PREDCON>"); |
136 |
|
|
137 |
1
|
LogicalCheckExceptionList list = |
138 |
|
checker.checkFormula(ele, context, getChecker()); |
139 |
1
|
assertEquals(1, list.size()); |
140 |
1
|
assertEquals(30730, list.get(0).getErrorCode()); |
141 |
|
} |
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
@throws |
150 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
151 |
1
|
public void testPredicateFormulaNegative13() throws Exception {... |
152 |
1
|
final Element ele = BasicParser.createElement("<PREDVAR> <A/> </PREDVAR>"); |
153 |
|
|
154 |
1
|
LogicalCheckExceptionList list = |
155 |
|
checker.checkFormula(ele, context, getChecker()); |
156 |
1
|
assertEquals(1, list.size()); |
157 |
1
|
assertEquals(30730, list.get(0).getErrorCode()); |
158 |
|
} |
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
@throws |
166 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
167 |
1
|
public void testPredicateFormulaNegative14() throws Exception {... |
168 |
1
|
final Element ele = BasicParser.createElement("<PREDCON> <A/> </PREDCON>"); |
169 |
|
|
170 |
1
|
LogicalCheckExceptionList list = |
171 |
|
checker.checkFormula(ele, context, getChecker()); |
172 |
1
|
assertEquals(1, list.size()); |
173 |
1
|
assertEquals(30730, list.get(0).getErrorCode()); |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
@throws |
182 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
183 |
1
|
public void testPredicateFormulaNegative15() throws Exception {... |
184 |
1
|
final Element ele = BasicParser.createElement( |
185 |
|
"<PREDVAR id=\"f\">" |
186 |
|
+ "<VAR id=\"x\"/>" |
187 |
|
+ "<CLASS> <VAR id=\"x\"/> <PREDVAR id=\"\\phi\" /> </CLASS>" |
188 |
|
+ "</PREDVAR>"); |
189 |
|
|
190 |
1
|
LogicalCheckExceptionList list = |
191 |
|
checker.checkFormula(ele, context, getChecker()); |
192 |
1
|
assertEquals(1, list.size()); |
193 |
1
|
assertEquals(30770, list.get(0).getErrorCode()); |
194 |
|
} |
195 |
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
@throws |
202 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
203 |
1
|
public void testPredicateFormulaNegative16() throws Exception {... |
204 |
1
|
final Element ele = BasicParser.createElement( |
205 |
|
"<PREDCON ref=\"in\">" |
206 |
|
+ "<VAR id=\"x\"/>" |
207 |
|
+ "<CLASS> <VAR id=\"x\"/> <PREDVAR id=\"\\phi\" /> </CLASS>" |
208 |
|
+ "</PREDCON>"); |
209 |
|
|
210 |
1
|
LogicalCheckExceptionList list = |
211 |
|
checker.checkFormula(ele, context, getChecker()); |
212 |
1
|
assertEquals(1, list.size()); |
213 |
1
|
assertEquals(30770, list.get(0).getErrorCode()); |
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
|
221 |
|
@throws |
222 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
223 |
1
|
public void testPredicateFormulaNegative19() throws Exception {... |
224 |
1
|
final Element ele = BasicParser.createElement( |
225 |
|
"<PREDVAR id=\"f\">" |
226 |
|
+ "<CLASS> <VAR id=\"x\"/> <PREDVAR id=\"\\phi\" /> </CLASS>" |
227 |
|
+ "<VAR id=\"x\"/>" |
228 |
|
+ "</PREDVAR>"); |
229 |
|
|
230 |
1
|
LogicalCheckExceptionList list = |
231 |
|
checker.checkFormula(ele, context, getChecker()); |
232 |
1
|
assertEquals(1, list.size()); |
233 |
1
|
assertEquals(30780, list.get(0).getErrorCode()); |
234 |
|
} |
235 |
|
|
236 |
|
|
237 |
|
|
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
@throws |
242 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
243 |
1
|
public void testPredicateFormulaNegative20() throws Exception {... |
244 |
1
|
final Element ele = BasicParser.createElement( |
245 |
|
"<PREDCON id=\"in\">" |
246 |
|
+ "<CLASS> <VAR id=\"x\"/> <PREDVAR id=\"\\phi\" /> </CLASS>" |
247 |
|
+ "<VAR id=\"x\"/>" |
248 |
|
+ "</PREDCON>"); |
249 |
|
|
250 |
1
|
LogicalCheckExceptionList list = |
251 |
|
checker.checkFormula(ele, context, getChecker()); |
252 |
1
|
assertEquals(1, list.size()); |
253 |
1
|
assertEquals(30780, list.get(0).getErrorCode()); |
254 |
|
} |
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
@throws |
262 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
263 |
1
|
public void testPredicateFormulaNegative22() throws Exception {... |
264 |
1
|
final Element ele = BasicParser.createElement( |
265 |
|
"<PREDCON id=\"F\" />"); |
266 |
|
|
267 |
1
|
LogicalCheckExceptionList list = |
268 |
|
checker.checkFormula(ele, context, getChecker()); |
269 |
1
|
assertEquals(1, list.size()); |
270 |
1
|
assertEquals(30590, list.get(0).getErrorCode()); |
271 |
|
} |
272 |
|
|
273 |
|
} |