1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.qedeq.kernel.bo.service.heuristic; |
16 |
|
|
17 |
|
import java.io.File; |
18 |
|
import java.io.IOException; |
19 |
|
|
20 |
|
import org.qedeq.base.io.UrlUtility; |
21 |
|
import org.qedeq.kernel.bo.common.QedeqBo; |
22 |
|
import org.qedeq.kernel.bo.logic.model.Model; |
23 |
|
import org.qedeq.kernel.bo.logic.model.SixDynamicModel; |
24 |
|
import org.qedeq.kernel.bo.module.KernelQedeqBo; |
25 |
|
import org.qedeq.kernel.bo.test.QedeqBoTestCase; |
26 |
|
import org.qedeq.kernel.se.common.ModuleAddress; |
27 |
|
import org.qedeq.kernel.se.common.SourceFileExceptionList; |
28 |
|
import org.qedeq.kernel.se.visitor.InterruptException; |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
@author |
34 |
|
|
|
|
| 56.1% |
Uncovered Elements: 18 (41) |
Complexity: 10 |
Complexity Density: 0.37 |
|
35 |
|
public class DynamicHeuristicCheckerPluginTest extends QedeqBoTestCase { |
36 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
0
|
public DynamicHeuristicCheckerPluginTest() {... |
38 |
0
|
super(); |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
1
|
public DynamicHeuristicCheckerPluginTest(final String name) {... |
42 |
1
|
super(name); |
43 |
|
} |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
|
|
| 66.7% |
Uncovered Elements: 8 (24) |
Complexity: 5 |
Complexity Density: 0.31 |
|
48 |
1
|
public QedeqBo check(final Model model, final File dir, final String xml) throws IOException,... |
49 |
|
SourceFileExceptionList, InterruptException { |
50 |
1
|
final File xmlFile = new File(dir, xml); |
51 |
1
|
final ModuleAddress address = getServices().getModuleAddress( |
52 |
|
UrlUtility.toUrl(xmlFile)); |
53 |
1
|
final KernelQedeqBo prop = (KernelQedeqBo) getServices().loadModule( |
54 |
|
address); |
55 |
1
|
if (prop.hasErrors()) { |
56 |
0
|
throw prop.getErrors(); |
57 |
|
} |
58 |
1
|
getServices().loadRequiredModules(prop.getModuleAddress()); |
59 |
1
|
if (prop.hasErrors()) { |
60 |
0
|
throw prop.getErrors(); |
61 |
|
} |
62 |
1
|
getServices().checkWellFormedness(prop.getModuleAddress()); |
63 |
1
|
if (prop.hasErrors()) { |
64 |
0
|
throw prop.getErrors(); |
65 |
|
} |
66 |
1
|
getInternalServices().getConfig().setServiceKeyValue(new HeuristicCheckerPlugin(), "model", |
67 |
|
model.getClass().getName()); |
68 |
1
|
getServices().executePlugin( |
69 |
|
"org.qedeq.kernel.bo.service.heuristic.DynamicHeuristicCheckerPlugin", |
70 |
|
prop.getModuleAddress(), null); |
71 |
1
|
if (prop.hasErrors()) { |
72 |
0
|
throw prop.getErrors(); |
73 |
|
} |
74 |
1
|
return prop; |
75 |
|
} |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
@throws |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
82 |
1
|
public void testQedeqSampleScript1() throws Exception {... |
83 |
1
|
final QedeqBo bo = check(new SixDynamicModel(), getDocDir(), "sample/qedeq_sample1.xml"); |
84 |
1
|
assertEquals(0, bo.getErrors().size()); |
85 |
1
|
assertEquals(0, bo.getWarnings().size()); |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
@throws |
92 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
93 |
0
|
public void kestQedeqLogicScript2() throws Exception {... |
94 |
0
|
final QedeqBo bo = check(new SixDynamicModel(), getDocDir(), "math/qedeq_logic_v1.xml"); |
95 |
0
|
assertEquals(0, bo.getErrors().size()); |
96 |
0
|
assertEquals(0, bo.getWarnings().size()); |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
@throws |
103 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
104 |
0
|
public void kestQedeqSetTheoryScript1() throws Exception {... |
105 |
0
|
final QedeqBo bo = check(new SixDynamicModel(), getDocDir(), "math/qedeq_set_theory_v1.xml"); |
106 |
0
|
assertEquals(0, bo.getErrors().size()); |
107 |
0
|
assertEquals(52, bo.getWarnings().size()); |
108 |
|
} |
109 |
|
|
110 |
|
} |