1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package com.sun.syndication.io; |
16 |
|
|
17 |
|
import java.io.IOException; |
18 |
|
import java.io.InputStream; |
19 |
|
|
20 |
|
import org.qedeq.base.test.QedeqTestCase; |
21 |
|
|
22 |
|
|
23 |
|
@link |
24 |
|
|
25 |
|
@author |
26 |
|
|
|
|
| 86.2% |
Uncovered Elements: 4 (29) |
Complexity: 7 |
Complexity Density: 0.32 |
|
27 |
|
public class XmlReaderExceptionTest extends QedeqTestCase { |
28 |
|
|
29 |
|
|
30 |
|
private XmlReaderException object1; |
31 |
|
private InputStream in1; |
32 |
|
|
33 |
|
private XmlReaderException object2; |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
35 |
3
|
protected void setUp() throws Exception {... |
36 |
3
|
super.setUp(); |
37 |
3
|
in1 = new InputStream(){ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
38 |
0
|
public int read() throws IOException {... |
39 |
0
|
return 0; |
40 |
|
} |
41 |
|
}; |
42 |
3
|
object1 = new XmlReaderException("XML reading failure", "UTF8", "UTF16", "UTF32", in1); |
43 |
3
|
object2 = new XmlReaderException("XML reading failure", "mime", "ISO", "UTF8", "UTF16", "UTF32", in1); |
44 |
|
} |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
3
|
protected void tearDown() throws Exception {... |
47 |
3
|
super.tearDown(); |
48 |
|
} |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
@throws |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
55 |
1
|
public void testCreator() throws Exception {... |
56 |
1
|
new XmlReaderException("XML reading failure", "UTF8", "UTF16", "UTF32", |
57 |
|
new InputStream(){ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
0
|
public int read() throws IOException {... |
59 |
0
|
return 0; |
60 |
|
} |
61 |
|
}); |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
@throws |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1
PASS
|
|
69 |
1
|
public void testGetter() throws Exception {... |
70 |
1
|
assertEquals("XML reading failure", object1.getMessage()); |
71 |
1
|
assertEquals("UTF8", object1.getBomEncoding()); |
72 |
1
|
assertEquals("UTF16", object1.getXmlGuessEncoding()); |
73 |
1
|
assertEquals("UTF32", object1.getXmlEncoding()); |
74 |
1
|
assertSame(in1, object1.getInputStream()); |
75 |
1
|
assertNull(object1.getContentTypeEncoding()); |
76 |
1
|
assertNull(object1.getContentTypeMime()); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
@throws |
83 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1
PASS
|
|
84 |
1
|
public void testGetter2() throws Exception {... |
85 |
1
|
assertEquals("XML reading failure", object2.getMessage()); |
86 |
1
|
assertEquals("UTF8", object2.getBomEncoding()); |
87 |
1
|
assertEquals("UTF16", object2.getXmlGuessEncoding()); |
88 |
1
|
assertEquals("UTF32", object2.getXmlEncoding()); |
89 |
1
|
assertSame(in1, object2.getInputStream()); |
90 |
1
|
assertEquals("ISO", object2.getContentTypeEncoding()); |
91 |
1
|
assertEquals("mime", object2.getContentTypeMime()); |
92 |
|
} |
93 |
|
|
94 |
|
} |