| 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.base.list.Element; |
| 19 |
|
import org.qedeq.kernel.bo.logic.FormulaChecker; |
| 20 |
|
import org.qedeq.kernel.common.DefaultModuleAddress; |
| 21 |
|
import org.qedeq.kernel.common.ModuleContext; |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
@link |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
@version |
| 28 |
|
@author |
| 29 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 5 |
Complexity Density: 0.36 |
|
| 30 |
|
public class FormulaCheckerNegationTest extends AbstractFormulaChecker { |
| 31 |
|
|
| 32 |
|
private ModuleContext context; |
| 33 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
3
|
protected void setUp() throws Exception {... |
| 35 |
3
|
context = new ModuleContext(new DefaultModuleAddress("http://memory.org/sample.xml"), "getElement()"); |
| 36 |
|
} |
| 37 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
3
|
protected void tearDown() throws Exception {... |
| 39 |
3
|
context = null; |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
@throws |
| 48 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 49 |
1
|
public void testNegationPositive01() throws Exception {... |
| 50 |
1
|
final Element ele = TestParser.createElement( |
| 51 |
|
"<NOT><PREDVAR id=\"A\"/></NOT>"); |
| 52 |
|
|
| 53 |
1
|
assertFalse(FormulaChecker.checkFormula(ele, context).hasErrors()); |
| 54 |
1
|
assertFalse(FormulaChecker.checkFormula(ele, context, getChecker()).hasErrors()); |
| 55 |
1
|
assertFalse(FormulaChecker.checkFormula(ele, context, getCheckerWithoutClass()) |
| 56 |
|
.hasErrors()); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
@throws |
| 65 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 66 |
1
|
public void testNegationNegative01() throws Exception {... |
| 67 |
1
|
final Element ele = TestParser.createElement("<NOT />"); |
| 68 |
|
|
| 69 |
1
|
LogicalCheckExceptionList list = |
| 70 |
|
FormulaChecker.checkFormula(ele, context, getChecker()); |
| 71 |
1
|
assertEquals(1, list.size()); |
| 72 |
1
|
assertEquals(30710, list.get(0).getErrorCode()); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
@throws |
| 81 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 82 |
1
|
public void testNegationNegative02() throws Exception {... |
| 83 |
1
|
final Element ele = TestParser.createElement( |
| 84 |
|
"<NOT><PREDVAR id=\"A\"/><PREDVAR id=\"B\"/></NOT>"); |
| 85 |
|
|
| 86 |
1
|
LogicalCheckExceptionList list = |
| 87 |
|
FormulaChecker.checkFormula(ele, context, getChecker()); |
| 88 |
1
|
assertEquals(1, list.size()); |
| 89 |
1
|
assertEquals(30710, list.get(0).getErrorCode()); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
} |