Package org.codehaus.cargo.module.webapp

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


    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertJspMapping(webXml, "/jspRedirector.jsp", "JspRedirector",
            "/test/jspRedirector");
    }
View Full Code Here


    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertFilterMapping(webXml,
            "org.apache.cactus.server.FilterTestRedirector",
            "FilterRedirector",
            "/test/filterRedirector");
    }
View Full Code Here

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertTrue("The filter redirector should not have been defined",
            !webXml.getFilterNamesForClass(
                "org.apache.cactus.server.FilterTestRedirector").hasNext());
    }
View Full Code Here

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertTrue(webXml.hasServlet("ServletRedirector"));
        assertEquals("/test/ServletRedirector",
            webXml.getServletMappings("ServletRedirector").next());
        assertTrue(webXml.hasServlet("ServletRedirectorSecure"));
        assertEquals("/test/ServletRedirectorSecure",
            webXml.getServletMappings("ServletRedirectorSecure").next());
    }
View Full Code Here

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertTrue(webXml.hasServlet("JspRedirector"));
        assertEquals("/test/JspRedirector",
            webXml.getServletMappings("JspRedirector").next());
        assertTrue(webXml.hasServlet("JspRedirectorSecure"));
        assertEquals("/test/JspRedirectorSecure",
            webXml.getServletMappings("JspRedirectorSecure").next());
    }
View Full Code Here

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertTrue(webXml.hasFilter("FilterRedirector"));
        assertEquals("/test/FilterRedirector",
            webXml.getFilterMappings("FilterRedirector").next());
        assertTrue(webXml.hasFilter("FilterRedirectorSecure"));
        assertEquals("/test/FilterRedirectorSecure",
            webXml.getFilterMappings("FilterRedirectorSecure").next());
    }
View Full Code Here

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertTrue(webXml.hasServlet("ServletRedirectorSecure"));
        assertEquals("/ServletRedirectorSecure",
            webXml.getServletMappings("ServletRedirectorSecure").next());
        assertTrue(webXml.hasSecurityRole("test"));
        assertTrue(webXml.hasSecurityRole("cactus"));
        assertTrue(webXml.hasSecurityConstraint("/ServletRedirectorSecure"));
        Element securityConstraintElement =
            webXml.getSecurityConstraint("/ServletRedirectorSecure");
        assertNotNull(securityConstraintElement);
        Element authConstraintElement = (Element)
            securityConstraintElement.getElementsByTagName(
                "auth-constraint").item(0);
        assertNotNull(authConstraintElement);
        NodeList roleNameElements =
            authConstraintElement.getElementsByTagName("role-name");
        assertEquals(2, roleNameElements.getLength());
        assertEquals("test",
            roleNameElements.item(0).getChildNodes().item(0).getNodeValue());
        assertEquals("cactus",
            roleNameElements.item(1).getChildNodes().item(0).getNodeValue());
        Iterator loginConfigElements =
            webXml.getElements(WebXmlTag.LOGIN_CONFIG);
        assertTrue(loginConfigElements.hasNext());
        Element loginConfigElement = (Element) loginConfigElements.next();
        Element authMethodElement = (Element)
            loginConfigElement.getElementsByTagName("auth-method").item(0);
        assertEquals("BASIC",
View Full Code Here

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
        WebXml webXml = destWar.getWebXml();
        assertEquals("FORM", webXml.getLoginConfigAuthMethod());
    }
View Full Code Here

       
        File destFile = getProject().resolveFile("target/work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile.getAbsolutePath());
       
        // test web.xml
        WebXml webXml = destWar.getWebXml();
        Iterator i = webXml.getElements(WebXmlTag.EJB_LOCAL_REF);
        Element e = (Element) i.next();
        NodeList nl = e.getElementsByTagName("ejb-ref-name");
        Element f = (Element) nl.item(0);
        assertEquals("MyEjb", f.getFirstChild().getNodeValue());
        nl = e.getElementsByTagName("ejb-ref-type");
        f = (Element) nl.item(0);
        assertEquals("Session", f.getFirstChild().getNodeValue());
        nl = e.getElementsByTagName("local-home");
        f = (Element) nl.item(0);
        assertEquals("com.wombat.MyEjbHome", f.getFirstChild().getNodeValue());
        nl = e.getElementsByTagName("local");
        f = (Element) nl.item(0);
        assertEquals("com.wombat.MyEjb", f.getFirstChild().getNodeValue());
       
        // test weblogic.xml
       
        Iterator iter = webXml.getVendorDescriptors();
        WeblogicXml weblogicXml = null;
        while(iter.hasNext()) {
          weblogicXml = (WeblogicXml) iter.next();
        }
       
View Full Code Here

     * {@inheritDoc}
     * @see org.apache.tools.ant.Task#execute()
     */
    public void execute() throws BuildException
    {
        WebXml webXml = null;
        if (this.srcFile != null)
        {
            log("Analyzing war: " + this.srcFile.getAbsolutePath(),
                Project.MSG_INFO);

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.