1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.qedeq.kernel.bo.service.control; |
16 |
|
|
17 |
|
import org.qedeq.kernel.bo.logic.common.ExistenceChecker; |
18 |
|
import org.qedeq.kernel.bo.logic.common.FunctionConstant; |
19 |
|
import org.qedeq.kernel.bo.logic.common.FunctionKey; |
20 |
|
import org.qedeq.kernel.bo.logic.common.PredicateConstant; |
21 |
|
import org.qedeq.kernel.bo.logic.common.PredicateKey; |
22 |
|
import org.qedeq.kernel.bo.module.KernelQedeqBo; |
23 |
|
import org.qedeq.kernel.bo.module.ModuleConstantsExistenceChecker; |
24 |
|
import org.qedeq.kernel.bo.service.control.DefaultKernelQedeqBo; |
25 |
|
import org.qedeq.kernel.bo.service.logic.ModuleConstantsExistenceCheckerImpl; |
26 |
|
import org.qedeq.kernel.bo.test.QedeqBoTestCase; |
27 |
|
import org.qedeq.kernel.se.base.module.Axiom; |
28 |
|
import org.qedeq.kernel.se.base.module.ChangedRuleList; |
29 |
|
import org.qedeq.kernel.se.base.module.FunctionDefinition; |
30 |
|
import org.qedeq.kernel.se.base.module.InitialFunctionDefinition; |
31 |
|
import org.qedeq.kernel.se.base.module.InitialPredicateDefinition; |
32 |
|
import org.qedeq.kernel.se.base.module.LatexList; |
33 |
|
import org.qedeq.kernel.se.base.module.LinkList; |
34 |
|
import org.qedeq.kernel.se.base.module.PredicateDefinition; |
35 |
|
import org.qedeq.kernel.se.base.module.ProofList; |
36 |
|
import org.qedeq.kernel.se.base.module.Proposition; |
37 |
|
import org.qedeq.kernel.se.base.module.Rule; |
38 |
|
import org.qedeq.kernel.se.common.DefaultModuleAddress; |
39 |
|
import org.qedeq.kernel.se.common.ModuleAddress; |
40 |
|
import org.qedeq.kernel.se.common.RuleKey; |
41 |
|
import org.qedeq.kernel.se.common.SourceFileExceptionList; |
42 |
|
import org.qedeq.kernel.se.dto.module.LatexListVo; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
@author |
49 |
|
|
|
|
| 79.3% |
Uncovered Elements: 57 (276) |
Complexity: 40 |
Complexity Density: 0.18 |
|
50 |
|
public class ModuleConstantsExistenceCheckerTest extends QedeqBoTestCase { |
51 |
|
|
52 |
|
final Rule classDefinitionRule = new Rule() { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
53 |
0
|
public Axiom getAxiom() {... |
54 |
0
|
return null; |
55 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
0
|
public PredicateDefinition getPredicateDefinition() {... |
57 |
0
|
return null; |
58 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
0
|
public InitialPredicateDefinition getInitialPredicateDefinition() {... |
60 |
0
|
return null; |
61 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0
|
public InitialFunctionDefinition getInitialFunctionDefinition() {... |
63 |
0
|
return null; |
64 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
0
|
public FunctionDefinition getFunctionDefinition() {... |
66 |
0
|
return null; |
67 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
0
|
public Proposition getProposition() {... |
69 |
0
|
return null; |
70 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
0
|
public Rule getRule() {... |
72 |
0
|
return this; |
73 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
0
|
public String getName() {... |
75 |
0
|
return "CLASS_DEFINITION_BY_FORMULA"; |
76 |
|
} |
77 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
0
|
public String getVersion() {... |
79 |
0
|
return "1.00.00"; |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
0
|
public LatexList getDescription() {... |
83 |
0
|
return new LatexListVo(); |
84 |
|
} |
85 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
0
|
public ChangedRuleList getChangedRuleList() {... |
87 |
0
|
return null; |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0
|
public LinkList getLinkList() {... |
91 |
0
|
return null; |
92 |
|
} |
93 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
94 |
0
|
public ProofList getProofList() {... |
95 |
0
|
return null; |
96 |
|
} |
97 |
|
}; |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
@throws |
108 |
|
|
|
|
| 76.9% |
Uncovered Elements: 3 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
109 |
1
|
public void testModuleConstantsExistenceChecker_01() throws Exception {... |
110 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC011.xml")); |
111 |
1
|
if (!getServices().checkWellFormedness(address)) { |
112 |
0
|
getServices().getQedeqBo(address).getErrors().printStackTrace(System.out); |
113 |
0
|
throw getServices().getQedeqBo(address).getErrors(); |
114 |
|
} |
115 |
1
|
final DefaultKernelQedeqBo qedeq = (DefaultKernelQedeqBo) getServices().getQedeqBo(address); |
116 |
1
|
SourceFileExceptionList errors = qedeq.getErrors(); |
117 |
1
|
SourceFileExceptionList warnings = qedeq.getWarnings(); |
118 |
1
|
assertNotNull(warnings); |
119 |
1
|
assertEquals(0, warnings.size()); |
120 |
1
|
assertNotNull(errors); |
121 |
1
|
assertEquals(0, errors.size()); |
122 |
|
} |
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
@throws |
133 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
134 |
1
|
public void testModuleConstantsExistenceChecker_02() throws Exception {... |
135 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC021.xml")); |
136 |
1
|
if (!getServices().checkWellFormedness(address)) { |
137 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
138 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
139 |
1
|
assertNotNull(warnings); |
140 |
1
|
assertEquals(0, warnings.size()); |
141 |
1
|
assertEquals(1, errors.size()); |
142 |
1
|
assertEquals(123476, errors.get(0).getErrorCode()); |
143 |
1
|
assertEquals(38, errors.get(0).getSourceArea().getStartPosition().getRow()); |
144 |
1
|
assertEquals(15, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
145 |
|
} else { |
146 |
0
|
fail("failure for double definition of identity operator expected"); |
147 |
|
} |
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
158 |
|
@throws |
159 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
160 |
1
|
public void testModuleConstantsExistenceChecker_03() throws Exception {... |
161 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC031.xml")); |
162 |
1
|
if (!getServices().checkWellFormedness(address)) { |
163 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
164 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
165 |
1
|
assertNotNull(warnings); |
166 |
1
|
assertEquals(0, warnings.size()); |
167 |
1
|
assertEquals(1, errors.size()); |
168 |
1
|
assertEquals(123476, errors.get(0).getErrorCode()); |
169 |
1
|
assertEquals(38, errors.get(0).getSourceArea().getStartPosition().getRow()); |
170 |
1
|
assertEquals(15, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
171 |
|
} else { |
172 |
0
|
fail("failure for double definition of identity operator expected"); |
173 |
|
} |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
@throws |
185 |
|
|
|
|
| 76.9% |
Uncovered Elements: 3 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
186 |
1
|
public void testModuleConstantsExistenceChecker_04() throws Exception {... |
187 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC041.xml")); |
188 |
1
|
SourceFileExceptionList errors; |
189 |
1
|
if (!getServices().checkWellFormedness(address)) { |
190 |
0
|
errors = getServices().getQedeqBo(address).getErrors(); |
191 |
0
|
throw errors; |
192 |
|
} |
193 |
1
|
errors = getServices().getQedeqBo(address).getErrors(); |
194 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
195 |
1
|
assertNotNull(warnings); |
196 |
1
|
assertEquals(0, warnings.size()); |
197 |
1
|
assertNotNull(errors); |
198 |
1
|
assertEquals(0, errors.size()); |
199 |
|
} |
200 |
|
|
201 |
|
|
202 |
|
|
203 |
|
|
204 |
|
|
205 |
|
|
206 |
|
|
207 |
|
|
208 |
|
@throws |
209 |
|
|
|
|
| 95.2% |
Uncovered Elements: 3 (62) |
Complexity: 2 |
Complexity Density: 0.03 |
1
PASS
|
|
210 |
1
|
public void testModuleConstantsExistenceChecker_05() throws Exception {... |
211 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC051.xml")); |
212 |
1
|
if (!getServices().checkWellFormedness(address)) { |
213 |
0
|
getServices().getQedeqBo(address).getErrors().printStackTrace(System.out); |
214 |
0
|
throw getServices().getQedeqBo(address).getErrors(); |
215 |
|
} |
216 |
1
|
final DefaultKernelQedeqBo qedeq = (DefaultKernelQedeqBo) getServices().getQedeqBo(address); |
217 |
1
|
SourceFileExceptionList errors = qedeq.getErrors(); |
218 |
1
|
SourceFileExceptionList warnings = qedeq.getWarnings(); |
219 |
1
|
assertNotNull(warnings); |
220 |
1
|
assertEquals(0, warnings.size()); |
221 |
1
|
assertNotNull(errors); |
222 |
1
|
assertEquals(0, errors.size()); |
223 |
|
|
224 |
1
|
ModuleConstantsExistenceChecker checker = qedeq.getExistenceChecker(); |
225 |
|
|
226 |
1
|
assertEquals("MCEC052.equal", checker.getIdentityOperator()); |
227 |
1
|
assertFalse(qedeq.equals(checker.getQedeq(new PredicateKey(ExistenceChecker.NAME_EQUAL, "" + 2)))); |
228 |
1
|
assertNull(checker.getQedeq(new PredicateKey(ExistenceChecker.NAME_EQUAL, "" + 2))); |
229 |
1
|
assertNull(checker.getQedeq(new PredicateKey("unknown." + ExistenceChecker.NAME_EQUAL, "" + 2))); |
230 |
1
|
assertEquals(getServices().getQedeqBo(new DefaultModuleAddress(getFile("existence/MCEC052.xml"))), |
231 |
|
checker.getQedeq(new PredicateKey("MCEC052." + ExistenceChecker.NAME_EQUAL, "" + 2))); |
232 |
|
{ |
233 |
1
|
final PredicateKey predicate = new PredicateKey("MCEC052." + ExistenceChecker.NAME_EQUAL, "" + 2); |
234 |
1
|
assertTrue(checker.predicateExists(predicate)); |
235 |
1
|
final PredicateConstant def = checker.get(predicate); |
236 |
|
|
237 |
|
|
238 |
1
|
assertNull(def); |
239 |
1
|
assertTrue(checker.isInitialPredicate(predicate)); |
240 |
|
} |
241 |
|
|
242 |
|
{ |
243 |
1
|
assertTrue(checker.predicateExists("MCEC052." + ExistenceChecker.NAME_EQUAL, 2)); |
244 |
1
|
final PredicateConstant def = checker.getPredicate("MCEC052." + ExistenceChecker.NAME_EQUAL, 2); |
245 |
|
|
246 |
|
|
247 |
1
|
assertNull(def); |
248 |
|
} |
249 |
|
|
250 |
|
{ |
251 |
1
|
final PredicateKey predicate = new PredicateKey("MCEC052x." + ExistenceChecker.NAME_EQUAL, "" + 2); |
252 |
1
|
assertFalse(checker.predicateExists(predicate)); |
253 |
1
|
final PredicateConstant def = checker.get(predicate); |
254 |
1
|
assertNull(def); |
255 |
1
|
assertTrue(!checker.isInitialPredicate(predicate)); |
256 |
|
} |
257 |
|
|
258 |
|
{ |
259 |
1
|
assertFalse(checker.predicateExists("MCEC052x." + ExistenceChecker.NAME_EQUAL, 2)); |
260 |
1
|
final PredicateConstant def = checker.getPredicate("MCEC052x." + ExistenceChecker.NAME_EQUAL, 2); |
261 |
1
|
assertNull(def); |
262 |
|
} |
263 |
|
|
264 |
1
|
assertEquals("MCEC052.equal", checker.getIdentityOperator()); |
265 |
1
|
assertFalse(qedeq.equals(checker.getQedeq(new FunctionKey("union", "" + 2)))); |
266 |
1
|
assertNull(checker.getQedeq(new FunctionKey("union", "" + 2))); |
267 |
1
|
assertNull(checker.getQedeq(new FunctionKey("unknown." + "union", "" + 2))); |
268 |
1
|
assertEquals(getServices().getQedeqBo(new DefaultModuleAddress(getFile("existence/MCEC052.xml"))), |
269 |
|
checker.getQedeq(new FunctionKey("MCEC052." + "union", "" + 2))); |
270 |
|
{ |
271 |
1
|
final FunctionKey function = new FunctionKey("MCEC052x." + "union", "" + 2); |
272 |
1
|
assertFalse(checker.functionExists(function)); |
273 |
1
|
assertNull(checker.get(function)); |
274 |
|
} |
275 |
|
{ |
276 |
1
|
final FunctionKey function = new FunctionKey("MCEC05." + "union", "" + 2); |
277 |
1
|
assertFalse(checker.functionExists(function)); |
278 |
1
|
assertNull(checker.get(function)); |
279 |
|
} |
280 |
|
{ |
281 |
1
|
final FunctionKey function = new FunctionKey("MCEC052." + "uniont", "" + 2); |
282 |
1
|
assertFalse(checker.functionExists(function)); |
283 |
1
|
assertNull(checker.get(function)); |
284 |
|
} |
285 |
|
{ |
286 |
1
|
final FunctionKey function = new FunctionKey("MCEC052." + "union", "" + 2); |
287 |
1
|
assertTrue(checker.functionExists(function)); |
288 |
1
|
final FunctionConstant def2 = checker.get(function); |
289 |
|
|
290 |
|
|
291 |
1
|
assertEquals("PREDCON ( \"equal\", FUNCON ( \"union\", VAR ( \"x\"), VAR ( \"y\")), " |
292 |
|
+ "CLASS ( VAR ( \"z\"), OR ( PREDCON ( \"in\", VAR ( \"z\"), VAR ( \"x\"))," |
293 |
|
+ " PREDCON ( \"in\", VAR ( \"z\"), VAR ( \"y\")))))", |
294 |
|
def2.getCompleteFormula().toString()); |
295 |
1
|
assertEquals("union", def2.getName()); |
296 |
1
|
assertEquals("2", def2.getArguments()); |
297 |
1
|
assertTrue(!checker.isInitialFunction(function)); |
298 |
|
} |
299 |
|
{ |
300 |
1
|
assertTrue(checker.functionExists("MCEC052." + "union", 2)); |
301 |
1
|
final FunctionConstant def3 = checker.getFunction("MCEC052." + "union", 2); |
302 |
|
|
303 |
|
|
304 |
1
|
assertEquals("CLASS ( VAR ( \"z\"), OR ( PREDCON ( \"in\", VAR ( \"z\"), VAR ( \"x\"))," |
305 |
|
+ " PREDCON ( \"in\", VAR ( \"z\"), VAR ( \"y\"))))", def3.getDefiningTerm().toString()); |
306 |
1
|
assertEquals("union", def3.getName()); |
307 |
1
|
assertEquals("2", def3.getArguments()); |
308 |
|
} |
309 |
|
{ |
310 |
1
|
assertFalse(checker.functionExists("MCEC052x." + "union", 2)); |
311 |
|
} |
312 |
|
|
313 |
|
} |
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
|
|
322 |
|
|
323 |
|
@throws |
324 |
|
|
|
|
| 91.2% |
Uncovered Elements: 3 (34) |
Complexity: 2 |
Complexity Density: 0.06 |
1
PASS
|
|
325 |
1
|
public void testModuleConstantsExistenceChecker_06() throws Exception {... |
326 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC061.xml")); |
327 |
1
|
if (!getServices().checkWellFormedness(address)) { |
328 |
0
|
getServices().getQedeqBo(address).getErrors().printStackTrace(System.out); |
329 |
0
|
throw getServices().getQedeqBo(address).getErrors(); |
330 |
|
} |
331 |
1
|
final DefaultKernelQedeqBo qedeq = (DefaultKernelQedeqBo) getServices().getQedeqBo(address); |
332 |
1
|
SourceFileExceptionList errors = qedeq.getErrors(); |
333 |
1
|
SourceFileExceptionList warnings = qedeq.getWarnings(); |
334 |
1
|
assertNotNull(warnings); |
335 |
1
|
assertEquals(0, warnings.size()); |
336 |
1
|
assertNotNull(errors); |
337 |
1
|
assertEquals(0, errors.size()); |
338 |
|
|
339 |
1
|
ModuleConstantsExistenceChecker checker = qedeq.getExistenceChecker(); |
340 |
|
|
341 |
1
|
assertEquals("MCEC062a.equal", checker.getIdentityOperator()); |
342 |
1
|
assertFalse(qedeq.equals(checker.getQedeq(new PredicateKey(ExistenceChecker.NAME_EQUAL, "" + 2)))); |
343 |
1
|
assertNull(checker.getQedeq(new PredicateKey(ExistenceChecker.NAME_EQUAL, "" + 2))); |
344 |
1
|
assertNull(checker.getQedeq(new PredicateKey("unknown." + ExistenceChecker.NAME_EQUAL, "" + 2))); |
345 |
1
|
final PredicateKey key = new PredicateKey("MCEC062a." + ExistenceChecker.NAME_EQUAL, "" + 2); |
346 |
1
|
assertEquals(getServices().getQedeqBo(new DefaultModuleAddress(getFile("existence/MCEC062.xml"))), |
347 |
|
checker.getQedeq(key)); |
348 |
1
|
final PredicateConstant def = checker.get(key); |
349 |
|
|
350 |
|
|
351 |
1
|
assertNull(def); |
352 |
1
|
assertTrue(checker.isInitialPredicate(key)); |
353 |
|
|
354 |
1
|
assertEquals("MCEC062a.equal", checker.getIdentityOperator()); |
355 |
1
|
assertFalse(qedeq.equals(checker.getQedeq(new FunctionKey("union", "" + 2)))); |
356 |
1
|
assertNull(checker.getQedeq(new FunctionKey("union", "" + 2))); |
357 |
1
|
assertNull(checker.getQedeq(new FunctionKey("unknown." + "union", "" + 2))); |
358 |
1
|
final FunctionKey key2 = new FunctionKey("MCEC062a." + "union", "" + 2); |
359 |
1
|
assertEquals(getServices().getQedeqBo(new DefaultModuleAddress(getFile("existence/MCEC062.xml"))), |
360 |
|
checker.getQedeq(key2)); |
361 |
1
|
final FunctionConstant def2 = checker.get(key2); |
362 |
|
|
363 |
|
|
364 |
1
|
assertEquals("CLASS ( VAR ( \"z\"), OR ( PREDCON ( \"in\", VAR ( \"z\"), VAR ( \"x\"))," |
365 |
|
+ " PREDCON ( \"in\", VAR ( \"z\"), VAR ( \"y\"))))", def2.getDefiningTerm().toString()); |
366 |
1
|
assertEquals("union", def2.getName()); |
367 |
1
|
assertEquals("2", def2.getArguments()); |
368 |
1
|
assertTrue(!checker.isInitialFunction(key2)); |
369 |
|
|
370 |
|
} |
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
|
375 |
|
|
376 |
|
|
377 |
|
|
378 |
|
|
379 |
|
|
380 |
|
@throws |
381 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
382 |
1
|
public void testModuleConstantsExistenceChecker_07() throws Exception {... |
383 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC071.xml")); |
384 |
1
|
if (!getServices().checkWellFormedness(address)) { |
385 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
386 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
387 |
1
|
assertNotNull(warnings); |
388 |
1
|
assertEquals(0, warnings.size()); |
389 |
1
|
assertEquals(1, errors.size()); |
390 |
1
|
assertEquals(37390, errors.get(0).getErrorCode()); |
391 |
1
|
assertEquals(38, errors.get(0).getSourceArea().getStartPosition().getRow()); |
392 |
1
|
assertEquals(15, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
393 |
|
} else { |
394 |
0
|
fail("failure for double definition of class operator expected"); |
395 |
|
} |
396 |
|
} |
397 |
|
|
398 |
|
|
399 |
|
|
400 |
|
|
401 |
|
|
402 |
|
|
403 |
|
|
404 |
|
|
405 |
|
@throws |
406 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
407 |
1
|
public void testModuleConstantsExistenceChecker_08() throws Exception {... |
408 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC081.xml")); |
409 |
1
|
if (!getServices().checkWellFormedness(address)) { |
410 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
411 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
412 |
1
|
assertNotNull(warnings); |
413 |
1
|
assertEquals(0, warnings.size()); |
414 |
|
|
415 |
1
|
assertEquals(1, errors.size()); |
416 |
1
|
assertEquals(37260, errors.get(0).getErrorCode()); |
417 |
1
|
assertEquals(118, errors.get(0).getSourceArea().getStartPosition().getRow()); |
418 |
1
|
assertEquals(52, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
419 |
|
} else { |
420 |
0
|
fail("failure for double definition of class operator expected"); |
421 |
|
} |
422 |
|
} |
423 |
|
|
424 |
|
|
425 |
|
|
426 |
|
|
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
|
431 |
|
@throws |
432 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
433 |
1
|
public void testModuleConstantsExistenceChecker_09() throws Exception {... |
434 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC091.xml")); |
435 |
1
|
if (!getServices().checkWellFormedness(address)) { |
436 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
437 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
438 |
1
|
assertNotNull(warnings); |
439 |
1
|
assertEquals(0, warnings.size()); |
440 |
|
|
441 |
1
|
assertEquals(1, errors.size()); |
442 |
1
|
assertEquals(123476, errors.get(0).getErrorCode()); |
443 |
1
|
assertEquals(125, errors.get(0).getSourceArea().getStartPosition().getRow()); |
444 |
1
|
assertEquals(11, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
445 |
|
} else { |
446 |
0
|
fail("failure for double definition of class operator expected"); |
447 |
|
} |
448 |
|
} |
449 |
|
|
450 |
|
|
451 |
|
|
452 |
|
|
453 |
|
|
454 |
|
|
455 |
|
|
456 |
|
|
457 |
|
@throws |
458 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
459 |
1
|
public void testModuleConstantsExistenceChecker_10() throws Exception {... |
460 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC101.xml")); |
461 |
1
|
if (!getServices().checkWellFormedness(address)) { |
462 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
463 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
464 |
1
|
assertNotNull(warnings); |
465 |
1
|
assertEquals(0, warnings.size()); |
466 |
|
|
467 |
1
|
assertEquals(1, errors.size()); |
468 |
1
|
assertEquals(40530, errors.get(0).getErrorCode()); |
469 |
1
|
assertEquals(151, errors.get(0).getSourceArea().getStartPosition().getRow()); |
470 |
1
|
assertEquals(15, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
471 |
|
} else { |
472 |
0
|
fail("usage of identitiy opererator before definition of identity operator"); |
473 |
|
} |
474 |
|
} |
475 |
|
|
476 |
|
|
477 |
|
|
478 |
|
|
479 |
|
|
480 |
|
|
481 |
|
|
482 |
|
|
483 |
|
@throws |
484 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
485 |
1
|
public void testModuleConstantsExistenceChecker_11() throws Exception {... |
486 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC111.xml")); |
487 |
1
|
if (!getServices().checkWellFormedness(address)) { |
488 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
489 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
490 |
1
|
assertNotNull(warnings); |
491 |
1
|
assertEquals(0, warnings.size()); |
492 |
|
|
493 |
1
|
assertEquals(1, errors.size()); |
494 |
1
|
assertEquals(37260, errors.get(0).getErrorCode()); |
495 |
1
|
assertEquals(146, errors.get(0).getSourceArea().getStartPosition().getRow()); |
496 |
1
|
assertEquals(52, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
497 |
|
} else { |
498 |
0
|
fail("failure for double definition of class operator expected"); |
499 |
|
} |
500 |
|
} |
501 |
|
|
502 |
|
|
503 |
|
|
504 |
|
|
505 |
|
|
506 |
|
|
507 |
|
|
508 |
|
|
509 |
|
|
510 |
|
@throws |
511 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
512 |
1
|
public void testModuleConstantsExistenceChecker_12() throws Exception {... |
513 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC121.xml")); |
514 |
1
|
if (!getServices().checkWellFormedness(address)) { |
515 |
1
|
SourceFileExceptionList errors = getServices().getQedeqBo(address).getErrors(); |
516 |
1
|
SourceFileExceptionList warnings = getServices().getQedeqBo(address).getWarnings(); |
517 |
1
|
assertNotNull(warnings); |
518 |
1
|
assertEquals(0, warnings.size()); |
519 |
|
|
520 |
1
|
assertEquals(1, errors.size()); |
521 |
1
|
assertEquals(37390, errors.get(0).getErrorCode()); |
522 |
1
|
assertEquals(38, errors.get(0).getSourceArea().getStartPosition().getRow()); |
523 |
1
|
assertEquals(15, errors.get(0).getSourceArea().getStartPosition().getColumn()); |
524 |
|
} else { |
525 |
0
|
fail("failure for double definition of class operator expected"); |
526 |
|
} |
527 |
|
} |
528 |
|
|
529 |
|
|
530 |
|
|
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
|
535 |
|
|
536 |
|
@throws |
537 |
|
|
|
|
| 72.7% |
Uncovered Elements: 3 (11) |
Complexity: 3 |
Complexity Density: 0.33 |
1
PASS
|
|
538 |
1
|
public void testModuleConstantsExistenceChecker_13() throws Exception {... |
539 |
1
|
final ModuleAddress address = new DefaultModuleAddress(getFile("existence/MCEC131.xml")); |
540 |
1
|
if (!getServices().checkWellFormedness(address)) { |
541 |
0
|
fail("no failure expected"); |
542 |
|
} |
543 |
1
|
final KernelQedeqBo qedeq = (KernelQedeqBo) getServices().getQedeqBo(address); |
544 |
1
|
final ModuleConstantsExistenceCheckerImpl checker = (ModuleConstantsExistenceCheckerImpl) |
545 |
|
qedeq.getExistenceChecker(); |
546 |
1
|
try { |
547 |
1
|
checker.add(new RuleKey("CLASS_DEFINITION_BY_FORMULA", "1.00.00"), classDefinitionRule); |
548 |
0
|
fail("exception expected"); |
549 |
|
} catch (IllegalArgumentException e) { |
550 |
|
|
551 |
|
} |
552 |
1
|
checker.add(new RuleKey("CLASS_DEFINITION_BY_FORMULA", "0.00.00"), classDefinitionRule); |
553 |
|
} |
554 |
|
|
555 |
|
} |