.
| Method from org.apache.cactus.integration.ant.deployment.application.TestApplicationXmlVersion Detail: |
public void setUp() throws ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(false);
this.domImpl = factory.newDocumentBuilder().getDOMImplementation();
}
|
public void testCompare12To12() throws Exception {
assertTrue(ApplicationXmlVersion.V1_2.compareTo(
ApplicationXmlVersion.V1_2) == 0);
}
Verifies that comparing version 1.2 to version 1.2 yields zero. |
public void testCompare12To13() throws Exception {
assertTrue(ApplicationXmlVersion.V1_2.compareTo(
ApplicationXmlVersion.V1_3) < 0);
}
Verifies that comparing version 1.2 to version 1.3 yields a negative
value. |
public void testCompare13To12() throws Exception {
assertTrue(ApplicationXmlVersion.V1_3.compareTo(
ApplicationXmlVersion.V1_2) > 0);
}
Verifies that comparing version 1.2 to version 1.3 yields a negative
value. |
public void testCompare13To13() throws Exception {
assertTrue(ApplicationXmlVersion.V1_3.compareTo(
ApplicationXmlVersion.V1_3) == 0);
}
Verifies that comparing version 1.3 to version 1.3 yields zero. |
public void testValueOfDocType12() throws Exception {
DocumentType docType = domImpl.createDocumentType("application",
ApplicationXmlVersion.V1_2.getPublicId(),
ApplicationXmlVersion.V1_2.getSystemId());
assertEquals(ApplicationXmlVersion.V1_2,
ApplicationXmlVersion.valueOf(docType));
}
Verifies that calling ApplicationXmlVersion.valueOf() with a application
1.2 document type returns the correct instance. |
public void testValueOfDocType13() throws Exception {
DocumentType docType = domImpl.createDocumentType("application",
ApplicationXmlVersion.V1_3.getPublicId(),
ApplicationXmlVersion.V1_3.getSystemId());
assertEquals(ApplicationXmlVersion.V1_3,
ApplicationXmlVersion.valueOf(docType));
}
Verifies that calling ApplicationXmlVersion.valueOf() with a application
1.3 document type returns the correct instance. |
public void testValueOfNull() throws Exception {
try
{
ApplicationXmlVersion.valueOf((DocumentType) null);
fail("Expected NullPointerException");
}
catch (NullPointerException expected)
{
// expected
}
}
Verifies that calling ApplicationXmlVersion.valueOf(null) throws a
NullPointerException. |
public void testValueOfUnknownDocType() throws Exception {
DocumentType docType = domImpl.createDocumentType("application",
"foo", "bar");
assertNull(ApplicationXmlVersion.valueOf(docType));
}
Verifies that calling ApplicationXmlVersion.valueOf() with a unknown
document type returns null. |