Package org.apache.tomcat.util.descriptor.web

Examples of org.apache.tomcat.util.descriptor.web.WebRuleSet


public class TestSchemaValidation {

    @Test
    public void testWebapp() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        digester.push(new WebXml());
        WebXml desc = (WebXml) digester.parse(
                new File("test/webapp/WEB-INF/web.xml"));
        Assert.assertEquals("3.1", desc.getVersion());
    }
View Full Code Here


    }

    @Test
    public void testWebapp_2_2() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        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());
View Full Code Here

    }

    @Test
    public void testWebapp_2_3() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        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());
View Full Code Here

    }

    @Test
    public void testWebapp_2_4() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        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());
    }
View Full Code Here

    }

    @Test
    public void testWebapp_2_5() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        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());
    }
View Full Code Here

    }

    @Test
    public void testWebapp_3_0() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        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());
    }
View Full Code Here

    }

    @Test
    public void testWebapp_3_1() throws Exception {
        Digester digester =
                DigesterFactory.newDigester(true, true, new WebRuleSet(false));
        digester.push(new WebXml());
        WebXml desc = (WebXml) digester.parse(
                new File("test/webapp-3.1/WEB-INF/web.xml"));
        Assert.assertEquals("3.1", desc.getVersion());
    }
View Full Code Here

    @Test
    public void testWebapp() 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/WEB-INF/web.xml"));
        Assert.assertEquals("3.1", desc.getVersion());
View Full Code Here

    @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());
View Full Code Here

    @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());
View Full Code Here

TOP

Related Classes of org.apache.tomcat.util.descriptor.web.WebRuleSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.