| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
package org.qedeq.kernel.xml.parser; |
| 16 |
|
|
| 17 |
|
import org.qedeq.base.test.QedeqTestCase; |
| 18 |
|
import org.qedeq.kernel.common.DummyPlugin; |
| 19 |
|
import org.qedeq.kernel.xml.handler.module.QedeqHandler; |
| 20 |
|
|
| 21 |
|
|
| 22 |
|
@link |
| 23 |
|
|
| 24 |
|
@version |
| 25 |
|
@author |
| 26 |
|
|
|
|
|
| 85.7% |
Uncovered Elements: 4 (28) |
Complexity: 10 |
Complexity Density: 0.5 |
|
| 27 |
|
public class QedeqParserTest extends QedeqTestCase { |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
private SaxParser parser1; |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
private SaxParser parser2; |
| 34 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
|
| 35 |
2
|
protected void setUp() throws Exception {... |
| 36 |
2
|
super.setUp(); |
| 37 |
|
{ |
| 38 |
2
|
SaxDefaultHandler handler = new SaxDefaultHandler(new DummyPlugin()); |
| 39 |
2
|
AbstractSimpleHandler simple = new AbstractSimpleHandler(handler, null) { |
| 40 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 41 |
104
|
public void startElement(final String name, final SimpleAttributes attributes) {... |
| 42 |
|
|
| 43 |
|
} |
| 44 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 45 |
104
|
public void endElement(final String name) {... |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
} |
| 49 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 50 |
33
|
public void characters(final String name, final String value) {... |
| 51 |
|
|
| 52 |
|
} |
| 53 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 54 |
1
|
public void init() {... |
| 55 |
|
|
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
}; |
| 59 |
2
|
handler.setBasisDocumentHandler(simple); |
| 60 |
2
|
parser1 = new SaxParser(DummyPlugin.getInstance(), handler); |
| 61 |
|
} |
| 62 |
|
{ |
| 63 |
2
|
SaxDefaultHandler handler = new SaxDefaultHandler(new DummyPlugin()); |
| 64 |
2
|
AbstractSimpleHandler simple = new QedeqHandler(handler); |
| 65 |
2
|
handler.setBasisDocumentHandler(simple); |
| 66 |
2
|
parser2 = new SaxParser(DummyPlugin.getInstance(), handler); |
| 67 |
|
} |
| 68 |
|
} |
| 69 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 70 |
2
|
protected void tearDown() throws Exception {... |
| 71 |
2
|
parser1 = null; |
| 72 |
2
|
parser2 = null; |
| 73 |
2
|
super.tearDown(); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
@throws |
| 80 |
|
|
|
|
|
| 50% |
Uncovered Elements: 2 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
1
PASS
|
|
| 81 |
1
|
public void testParse1() throws Exception {... |
| 82 |
1
|
try { |
| 83 |
1
|
parser1.parse(getFile("qedeq.xml"), getFile("qedeq.xml").toURL().toString()); |
| 84 |
|
} catch (Exception e) { |
| 85 |
0
|
System.err.println(e.getMessage()); |
| 86 |
0
|
throw e; |
| 87 |
|
} |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
@throws |
| 94 |
|
|
|
|
|
| 50% |
Uncovered Elements: 2 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
1
PASS
|
|
| 95 |
1
|
public void testParse2() throws Exception {... |
| 96 |
1
|
try { |
| 97 |
1
|
parser2.parse(getFile("qedeq.xml"), getFile("qedeq.xml").toURL().toString()); |
| 98 |
|
} catch (Exception e) { |
| 99 |
0
|
System.err.println(e.getMessage()); |
| 100 |
0
|
throw e; |
| 101 |
|
} |
| 102 |
|
} |
| 103 |
|
} |