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 |
|
@author |
29 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (25) |
Complexity: 6 |
Complexity Density: 0.32 |
|
30 |
|
public class FormulaCheckerSubjectVariableTest extends AbstractFormulaChecker { |
31 |
|
|
32 |
|
private ModuleContext context; |
33 |
|
|
34 |
|
private FormulaChecker checker; |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
36 |
4
|
protected void setUp() throws Exception {... |
37 |
4
|
context = new ModuleContext(new DefaultModuleAddress("http://memory.org/sample.xml"), "getElement()"); |
38 |
4
|
checker = new FormulaCheckerImpl(); |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
4
|
protected void tearDown() throws Exception {... |
42 |
4
|
context = null; |
43 |
|
} |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
@throws |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
52 |
1
|
public void testSubjectVariablePositive() throws Exception {... |
53 |
1
|
final Element ele = BasicParser.createElement("<VAR id=\"x\"/>"); |
54 |
|
|
55 |
1
|
assertFalse(checker.checkTerm(ele, context).hasErrors()); |
56 |
1
|
assertFalse(checker.checkTerm(ele, context, getChecker()).hasErrors()); |
57 |
1
|
assertFalse(checker.checkTerm(ele, context, getCheckerWithoutClass()).hasErrors()); |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
@throws |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
67 |
1
|
public void testSubjectVariableNegative1() throws Exception {... |
68 |
1
|
final Element ele = BasicParser.createElement("<VAR />"); |
69 |
|
|
70 |
1
|
LogicalCheckExceptionList list = |
71 |
|
checker.checkTerm(ele, context); |
72 |
1
|
assertEquals(1, list.size()); |
73 |
1
|
assertEquals(30710, list.get(0).getErrorCode()); |
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
@throws |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
83 |
1
|
public void testSubjectVariableNegative2() throws Exception {... |
84 |
1
|
final Element ele = BasicParser.createElement("<VAR id=\"x\" ref=\"12\" />"); |
85 |
|
|
86 |
1
|
LogicalCheckExceptionList list = |
87 |
|
checker.checkTerm(ele, context); |
88 |
1
|
assertEquals(1, list.size()); |
89 |
1
|
assertEquals(30710, list.get(0).getErrorCode()); |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
@throws |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
100 |
1
|
public void testSubjectVariableNegative3() throws Exception {... |
101 |
1
|
final Element ele = BasicParser.createElement("<VAR> <A/> </VAR>"); |
102 |
|
|
103 |
1
|
LogicalCheckExceptionList list = |
104 |
|
checker.checkTerm(ele, context); |
105 |
1
|
assertEquals(1, list.size()); |
106 |
1
|
assertEquals(30730, list.get(0).getErrorCode()); |
107 |
|
} |
108 |
|
|
109 |
|
|
110 |
|
} |