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 (20) |
Complexity: 5 |
Complexity Density: 0.33 |
|
31 |
|
public class FormulaCheckerNegationTest 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 |
3
|
protected void setUp() throws Exception {... |
38 |
3
|
context = new ModuleContext(new DefaultModuleAddress("http://memory.org/sample.xml"), "getElement()"); |
39 |
3
|
checker = new FormulaCheckerImpl(); |
40 |
|
} |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
3
|
protected void tearDown() throws Exception {... |
43 |
3
|
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 testNegationPositive01() throws Exception {... |
54 |
1
|
final Element ele = BasicParser.createElement( |
55 |
|
"<NOT><PREDVAR id=\"A\"/></NOT>"); |
56 |
|
|
57 |
1
|
assertFalse(checker.checkFormula(ele, context).hasErrors()); |
58 |
1
|
assertFalse(checker.checkFormula(ele, context, getChecker()).hasErrors()); |
59 |
1
|
assertFalse(checker.checkFormula(ele, context, getCheckerWithoutClass()) |
60 |
|
.hasErrors()); |
61 |
|
} |
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@throws |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
70 |
1
|
public void testNegationNegative01() throws Exception {... |
71 |
1
|
final Element ele = BasicParser.createElement("<NOT />"); |
72 |
|
|
73 |
1
|
LogicalCheckExceptionList list = |
74 |
|
checker.checkFormula(ele, context, getChecker()); |
75 |
1
|
assertEquals(1, list.size()); |
76 |
1
|
assertEquals(30710, list.get(0).getErrorCode()); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
@throws |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
86 |
1
|
public void testNegationNegative02() throws Exception {... |
87 |
1
|
final Element ele = BasicParser.createElement( |
88 |
|
"<NOT><PREDVAR id=\"A\"/><PREDVAR id=\"B\"/></NOT>"); |
89 |
|
|
90 |
1
|
LogicalCheckExceptionList list = |
91 |
|
checker.checkFormula(ele, context, getChecker()); |
92 |
1
|
assertEquals(1, list.size()); |
93 |
1
|
assertEquals(30710, list.get(0).getErrorCode()); |
94 |
|
} |
95 |
|
|
96 |
|
} |