Package org.codehaus.cargo.module.webapp

Examples of org.codehaus.cargo.module.webapp.WebXml


    public void testHasLoginConfigEmpty()
        throws Exception
    {
        String xml = "<web-app></web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(!webXml.hasLoginConfig());
    }
View Full Code Here


            + "  <login-config>"
            + "    <auth-method>BASIC</auth-method>"
            + "  </login-config>"
            + "</web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(webXml.hasLoginConfig());
    }
View Full Code Here

            + "  <login-config>"
            + "    <auth-method>BASIC</auth-method>"
            + "  </login-config>"
            + "</web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertEquals("BASIC", webXml.getLoginConfigAuthMethod());
    }
View Full Code Here

    public void testSetLoginConfigAdding()
        throws Exception
    {
        String xml = "<web-app></web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        webXml.setLoginConfig("BASIC", "Test Realm");
        assertTrue(webXml.hasLoginConfig());
        assertEquals("BASIC", webXml.getLoginConfigAuthMethod());
    }
View Full Code Here

        + "  <login-config>"
        + "    <auth-method>DIGEST</auth-method>"
        + "  </login-config>"
        + "</web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        webXml.setLoginConfig("BASIC", "Test Realm");
        assertTrue(webXml.hasLoginConfig());
        assertEquals("BASIC", webXml.getLoginConfigAuthMethod());
    }
View Full Code Here

    public void testHasSecurityConstraintEmpty()
        throws Exception
    {
        String xml = "<web-app></web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(!webXml.hasSecurityConstraint("/TestUrl"));
    }
View Full Code Here

            + "      <url-pattern>/url1</url-pattern>"
            + "    </web-resource-collection>"
            + "  </security-constraint>"
            + "</web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(webXml.hasSecurityConstraint("/url1"));
        Element securityConstraintElement =
            webXml.getSecurityConstraint("/url1");
        assertNotNull(securityConstraintElement);
    }
View Full Code Here

            + "      <url-pattern>/url3</url-pattern>"
            + "    </web-resource-collection>"
            + "  </security-constraint>"
            + "</web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(webXml.hasSecurityConstraint("/url1"));
        assertTrue(webXml.hasSecurityConstraint("/url2"));
        assertTrue(webXml.hasSecurityConstraint("/url3"));
        Iterator securityConstraints =
            webXml.getElements(WebXmlTag.SECURITY_CONSTRAINT);
        assertNotNull(securityConstraints.next());
        assertNotNull(securityConstraints.next());
        assertNotNull(securityConstraints.next());
        assertTrue(!securityConstraints.hasNext());
    }
View Full Code Here

    public void testGetLoginConfigEmpty()
        throws Exception
    {
        String xml = "<web-app></web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(!webXml.getElements(WebXmlTag.LOGIN_CONFIG).hasNext());
    }
View Full Code Here

    public void testGetLoginConfig()
        throws Exception
    {
        String xml = "<web-app><login-config/></web-app>";
        Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        WebXml webXml = new WebXml(doc);
        assertTrue(webXml.getElements(WebXmlTag.LOGIN_CONFIG).hasNext());
    }
View Full Code Here

TOP

Related Classes of org.codehaus.cargo.module.webapp.WebXml

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.