.
| Method from org.apache.cactus.integration.ant.deployment.webapp.TestWebXmlVersion Detail: |
public void setUp() throws ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(false);
this.domImpl = factory.newDocumentBuilder().getDOMImplementation();
}
|
public void testCompare22To22() throws Exception {
assertTrue(WebXmlVersion.V2_2.compareTo(WebXmlVersion.V2_2) == 0);
}
Verifies that comparing version 2.2 to version 2.2 yields zero. |
public void testCompare22To23() throws Exception {
assertTrue(WebXmlVersion.V2_2.compareTo(WebXmlVersion.V2_3) < 0);
}
Verifies that comparing version 2.2 to version 2.3 yields a negative
value. |
public void testCompare23To22() throws Exception {
assertTrue(WebXmlVersion.V2_3.compareTo(WebXmlVersion.V2_2) > 0);
}
Verifies that comparing version 2.2 to version 2.3 yields a negative
value. |
public void testCompare23To23() throws Exception {
assertTrue(WebXmlVersion.V2_3.compareTo(WebXmlVersion.V2_3) == 0);
}
Verifies that comparing version 2.3 to version 2.3 yields zero. |
public void testValueOfDocType22() throws Exception {
DocumentType docType = domImpl.createDocumentType("web-app",
WebXmlVersion.V2_2.getPublicId(), WebXmlVersion.V2_2.getSystemId());
assertEquals(WebXmlVersion.V2_2, WebXmlVersion.valueOf(docType));
}
Verifies that calling WebXmlVersion.valueOf() with a web-app 2.2 document
type returns the correct instance. |
public void testValueOfDocType23() throws Exception {
DocumentType docType = domImpl.createDocumentType("web-app",
WebXmlVersion.V2_3.getPublicId(), WebXmlVersion.V2_3.getSystemId());
assertEquals(WebXmlVersion.V2_3, WebXmlVersion.valueOf(docType));
}
Verifies that calling WebXmlVersion.valueOf() with a web-app 2.3 document
type returns the correct instance. |
public void testValueOfNull() throws Exception {
try
{
WebXmlVersion.valueOf((DocumentType) null);
fail("Expected NullPointerException");
}
catch (NullPointerException expected)
{
// expected
}
}
Verifies that calling WebXmlVersion.valueOf(null) throws a
NullPointerException. |
public void testValueOfUnknownDocType() throws Exception {
DocumentType docType = domImpl.createDocumentType("web-app",
"foo", "bar");
assertNull(WebXmlVersion.valueOf(docType));
}
Verifies that calling WebXmlVersion.valueOf() with a unknown document
type returns null. |