use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestSchemaValidation method testWebapp_2_2.
@Test
public void testWebapp_2_2() 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.2/WEB-INF/web.xml"));
Assert.assertEquals("2.2", desc.getVersion());
Assert.assertEquals(XmlIdentifiers.WEB_22_PUBLIC, desc.getPublicId());
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_3.
@Test
public void testWebapp_2_3() 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.3/WEB-INF/web.xml"));
Assert.assertEquals("2.3", desc.getVersion());
Assert.assertEquals(XmlIdentifiers.WEB_23_PUBLIC, desc.getPublicId());
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 TestWebRuleSet method testSingleOrderingInWebXml.
@Test
public void testSingleOrderingInWebXml() throws Exception {
WebXml webXml = new WebXml();
parse(webXml, "web-1ordering.xml", false, true);
Assert.assertEquals(1, webXml.getAbsoluteOrdering().size());
Assert.assertTrue(webXml.getAbsoluteOrdering().contains("bar"));
}
use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestWebRuleSet method testSingleOrderingInWebFragmentXml.
@Test
public void testSingleOrderingInWebFragmentXml() throws Exception {
WebXml webXml = new WebXml();
parse(webXml, "web-fragment-1ordering.xml", true, true);
Assert.assertEquals(1, webXml.getBeforeOrdering().size());
Assert.assertTrue(webXml.getBeforeOrdering().contains("bar"));
}
use of org.apache.catalina.deploy.WebXml in project tomcat70 by apache.
the class TestWebRuleSet method testRecycle.
@Test
public void testRecycle() throws Exception {
// Name
parse(new WebXml(), "web-fragment-2name.xml", true, false);
parse(new WebXml(), "web-fragment-1name.xml", true, true);
parse(new WebXml(), "web-fragment-2name.xml", true, false);
parse(new WebXml(), "web-fragment-1name.xml", true, true);
// Relative ordering
parse(new WebXml(), "web-fragment-2ordering.xml", true, false);
parse(new WebXml(), "web-fragment-1ordering.xml", true, true);
parse(new WebXml(), "web-fragment-2ordering.xml", true, false);
parse(new WebXml(), "web-fragment-1ordering.xml", true, true);
// Absolute ordering
parse(new WebXml(), "web-2ordering.xml", false, false);
parse(new WebXml(), "web-1ordering.xml", false, true);
parse(new WebXml(), "web-2ordering.xml", false, false);
parse(new WebXml(), "web-1ordering.xml", false, true);
}
Aggregations