Package org.codehaus.cargo.module.webapp

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


    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

       
        File destFile = getProject().resolveFile("target/work/cactified.ear");
        EarArchive destEar = new DefaultEarArchive(destFile.getAbsolutePath());
        ApplicationXml appXml = destEar.getApplicationXml();
        assertEquals("/cactus", appXml.getWebModuleContextRoot("cactus.war"));
        WarArchive cactusWar = destEar.getWebModule("cactus.war");
        WebXml webXml = cactusWar.getWebXml();
        assertNotNull(WebXmlUtils.getServlet(webXml, "ServletRedirector"));
    }
View Full Code Here

    {
        executeTestTarget();
       
        File destFile = getProject().resolveFile("target/work/cactified.ear");
        EarArchive destEar = new DefaultEarArchive(destFile.getAbsolutePath());
        WarArchive cactusWar = destEar.getWebModule("cactus.war");
       
        // test web.xml
        WebXml webXml = cactusWar.getWebXml();
        Iterator i = webXml.getElements(WebXmlType.EJB_LOCAL_REF);
        assertEjbRef((Element) i.next(), "ejb/Session2", "Session",
                     "com.wombat.Session2", "com.wombat.Session2Home");
        assertEjbRef((Element) i.next(), "ejb/Entity1", "Entity",
                     "com.wombat.Entity1", "com.wombat.Entity1Home");
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

     *         parsed
     */
    private WebXml getOriginalWebXml() throws BuildException
    {
        // 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)
        {
            throw new BuildException(
View Full Code Here

       
        File destFile = getProject().resolveFile("work/cactified.ear");
        EarArchive destEar = new DefaultEarArchive(destFile);
        ApplicationXml appXml = destEar.getApplicationXml();
        assertEquals("/cactus", appXml.getWebModuleContextRoot("cactus.war"));
        WarArchive cactusWar = destEar.getWebModule("cactus.war");
        WebXml webXml = cactusWar.getWebXml();
        assertNotNull(webXml.getServlet("ServletRedirector"));
    }
View Full Code Here

    {
        executeTestTarget();
       
        File destFile = getProject().resolveFile("work/cactified.ear");
        EarArchive destEar = new DefaultEarArchive(destFile);
        WarArchive cactusWar = destEar.getWebModule("cactus.war");
       
        // test web.xml
        WebXml webXml = cactusWar.getWebXml();
        Iterator i = webXml.getElements(WebXmlTag.EJB_LOCAL_REF);
        assertEjbRef((Element) i.next(), "ejb/Session2", "Session",
                     "com.wombat.Session2", "com.wombat.Session2Home");
        assertEjbRef((Element) i.next(), "ejb/Entity1", "Entity",
                     "com.wombat.Entity1", "com.wombat.Entity1Home");
View Full Code Here

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

        File destFile = getProject().resolveFile("work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile);
        WebXml webXml = destWar.getWebXml();
        assertNull("The web.xml should not have a version specified",
            webXml.getVersion());
        assertServletMapping(webXml,
            "org.apache.cactus.server.ServletTestRedirector",
            "ServletRedirector",
View Full Code Here

TOP

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

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.