| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
package org.qedeq.kernel.xml.common; |
| 16 |
|
|
| 17 |
|
import org.qedeq.base.test.QedeqTestCase; |
| 18 |
|
|
| 19 |
|
|
| 20 |
|
@link |
| 21 |
|
|
| 22 |
|
@author |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (25) |
Complexity: 4 |
Complexity Density: 0.19 |
|
| 24 |
|
public class XmlSyntaxExceptionTest extends QedeqTestCase { |
| 25 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 26 |
2
|
protected void setUp() throws Exception {... |
| 27 |
2
|
super.setUp(); |
| 28 |
|
} |
| 29 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 30 |
2
|
protected void tearDown() throws Exception {... |
| 31 |
2
|
super.tearDown(); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
@throws |
| 38 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1
PASS
|
|
| 39 |
1
|
public void testCreator() throws Exception {... |
| 40 |
1
|
XmlSyntaxException xse = XmlSyntaxException.createUnexpectedTagException("blueBerry"); |
| 41 |
1
|
assertNull(xse.getCause()); |
| 42 |
1
|
assertEquals(XmlSyntaxException.UNEXPECTED_TAG_CODE, xse.getErrorCode()); |
| 43 |
1
|
RuntimeException re = new NullPointerException(); |
| 44 |
1
|
xse = XmlSyntaxException.createByRuntimeException(re); |
| 45 |
1
|
assertEquals(XmlSyntaxException.PROGRAMMING_ERROR_CODE, xse.getErrorCode()); |
| 46 |
1
|
assertEquals(re, xse.getCause()); |
| 47 |
1
|
xse = XmlSyntaxException.createEmptyAttributeException("TAGGG", "Attribute"); |
| 48 |
1
|
assertEquals(XmlSyntaxException.EMPTY_ATTRIBUTE_CODE, xse.getErrorCode()); |
| 49 |
1
|
assertNull(xse.getCause()); |
| 50 |
1
|
xse = XmlSyntaxException.createMissingAttributeException("TAAAG", "attribuTE"); |
| 51 |
1
|
assertEquals(XmlSyntaxException.MISSING_ATTRIBUTE_CODE, xse.getErrorCode()); |
| 52 |
1
|
assertNull(xse.getCause()); |
| 53 |
1
|
xse = XmlSyntaxException.createUnexpectedTextDataException("tag", "ATTRIBUTE"); |
| 54 |
1
|
assertEquals(XmlSyntaxException.UNEXPECTED_DATA_CODE, xse.getErrorCode()); |
| 55 |
1
|
assertNull(xse.getCause()); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
@throws |
| 62 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
| 63 |
1
|
public void testGetter() throws Exception {... |
| 64 |
1
|
XmlSyntaxException xse = XmlSyntaxException.createUnexpectedTagException("blueBerry"); |
| 65 |
1
|
assertNull(xse.getCause()); |
| 66 |
1
|
assertEquals(XmlSyntaxException.UNEXPECTED_TAG_CODE, xse.getErrorCode()); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
} |