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