use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestWebRuleSet method testLifecycleMethodsDefinitions.
@Test
public void testLifecycleMethodsDefinitions() throws Exception {
// post-construct and pre-destroy
parse(new WebXml(), "web-1lifecyclecallback.xml", false, true);
// conflicting post-construct definitions
parse(new WebXml(), "web-2lifecyclecallback.xml", false, false);
}
use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestWebRuleSet method testSingleNameInWebFragmentXml.
@Test
public void testSingleNameInWebFragmentXml() throws Exception {
WebXml webXml = new WebXml();
parse(webXml, "web-fragment-1name.xml", true, true);
Assert.assertEquals("name1", webXml.getName());
}
use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestSchemaValidation method testWebapp_2_5.
@Test
public void testWebapp_2_5() throws Exception {
XmlErrorHandler handler = new XmlErrorHandler();
Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false), true);
digester.setErrorHandler(handler);
digester.push(new WebXml());
WebXml desc = (WebXml) digester.parse(new File("test/webapp-2.5/WEB-INF/web.xml"));
Assert.assertEquals("2.5", desc.getVersion());
Assert.assertEquals(0, handler.getErrors().size());
Assert.assertEquals(0, handler.getWarnings().size());
}
use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestSchemaValidation method testWebapp_2_4.
@Test
public void testWebapp_2_4() throws Exception {
XmlErrorHandler handler = new XmlErrorHandler();
Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false), true);
digester.setErrorHandler(handler);
digester.push(new WebXml());
WebXml desc = (WebXml) digester.parse(new File("test/webapp-2.4/WEB-INF/web.xml"));
Assert.assertEquals("2.4", desc.getVersion());
Assert.assertEquals(0, handler.getErrors().size());
Assert.assertEquals(0, handler.getWarnings().size());
}
use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestSchemaValidation method testWebapp_3_0.
@Test
public void testWebapp_3_0() throws Exception {
XmlErrorHandler handler = new XmlErrorHandler();
Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false), true);
digester.setErrorHandler(handler);
digester.push(new WebXml());
WebXml desc = (WebXml) digester.parse(new File("test/webapp-3.0/WEB-INF/web.xml"));
Assert.assertEquals("3.0", desc.getVersion());
Assert.assertEquals(0, handler.getErrors().size());
Assert.assertEquals(0, handler.getWarnings().size());
}
Aggregations