Package org.codehaus.cargo.module.webapp

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


    public void testCustomFilterRedirectorMappingIgnored() throws Exception
    {
        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",
            !WebXmlUtils.getFilterNamesForClass(webXml,
                "org.apache.cactus.server.FilterTestRedirector").hasNext());
    }
View Full Code Here


    public void testMultipleNamedServletRedirectors() throws Exception
    {
        executeTestTarget();

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

    public void testMultipleNamedJspRedirectors() throws Exception
    {
        executeTestTarget();

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

    public void testMultipleNamedFilterRedirectors() throws Exception
    {
        executeTestTarget();

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

    public void testSecuredServletRedirector() throws Exception
    {
        executeTestTarget();

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

    public void testLoginConfigNotOverwritten() throws Exception
    {
        executeTestTarget();

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

    public void testAddWeblogicEjbRefs() throws Exception
    {
        executeTestTarget();
       
        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(WebXmlType.EJB_LOCAL_REF);
        org.jdom.Element e = (org.jdom.Element) i.next();
       
        List nl = e.getChildren("ejb-ref-name");
        Element f = (Element) nl.get(0);
View Full Code Here

        String resourceName = "/" + theClassName.replace('.', '/') + ".class";
        if (this.srcFile != null)
        {
            try
            {
                WarArchive srcWar = new DefaultWarArchive(srcFile);
                if (srcWar.containsClass(theClassName))
                {
                    log("The " + theDescription + " JAR is already present in "
                        + "the WAR", Project.MSG_VERBOSE);
                    return;
                }
View Full Code Here

    {
        // Open the archive as JAR file and extract the deployment descriptor
        WarArchive war = null;
        try
        {
            war = new DefaultWarArchive(this.srcFile);
            WebXml webXml = war.getWebXml();
            return webXml;
        }
        catch (SAXException e)
        {
View Full Code Here

    public void testDefaultRedirectors22Doctype() throws Exception
    {
        executeTestTarget();

        File destFile = getProject().resolveFile("work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile);
        WebXml webXml = destWar.getWebXml();
        assertEquals(WebXmlVersion.V2_2, webXml.getVersion());
        assertServletMapping(webXml,
            "org.apache.cactus.server.ServletTestRedirector",
            "ServletRedirector",
            "/ServletRedirector");
View Full Code Here

TOP

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

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.