Package org.codehaus.cargo.module.webapp

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


            + "  </servlet>".trim()
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        Element servletElement = srcWebXml.getServlet("s1");
        assertEquals("load-on-startup",
            ((Element) servletElement.getLastChild()).getTagName());
    }
View Full Code Here


            + "  </servlet>"
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        Iterator servletNames = srcWebXml.getServletNames();
        assertEquals("s1", servletNames.next());
        assertEquals("s2", servletNames.next());
        assertEquals("s3", servletNames.next());
        assertTrue(!servletNames.hasNext());
View Full Code Here

            + "  </servlet-mapping>"
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        assertTrue(srcWebXml.hasServlet("s1"));
        Iterator servletMappings = srcWebXml.getServletMappings("s1");
        assertEquals("/s1mapping1", servletMappings.next());
        assertTrue(!servletMappings.hasNext());
    }
View Full Code Here

            + "  </servlet-mapping>"
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        assertTrue(srcWebXml.hasServlet("s1"));
        Iterator servletMappings = srcWebXml.getServletMappings("s1");
        assertEquals("/s1mapping1", servletMappings.next());
        assertEquals("/s1mapping2", servletMappings.next());
        assertEquals("/s1mapping3", servletMappings.next());
View Full Code Here

            + "  </security-role>"
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        Iterator securityRoleNames = srcWebXml.getSecurityRoleNames();
        assertTrue(securityRoleNames.hasNext());
        assertEquals("role1", securityRoleNames.next());
        assertTrue(!securityRoleNames.hasNext());
    }
View Full Code Here

            + "  </security-role>"
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        Iterator securityRoleNames = srcWebXml.getSecurityRoleNames();
        assertTrue(securityRoleNames.hasNext());
        assertEquals("role1", securityRoleNames.next());
        assertTrue(!securityRoleNames.hasNext());
    }
View Full Code Here

            + "  </ejb-ref>"
            + "</web-app>";
        Document mergeDoc =
            builder.parse(new ByteArrayInputStream(mergeXml.getBytes()));
        WebXml mergeWebXml = new WebXml(mergeDoc);
        WebXmlMerger merger = new WebXmlMerger(srcWebXml);
        merger.merge(mergeWebXml);
        Iterator ejbRefs = srcWebXml.getElements(WebXmlTag.EJB_REF);
        assertTrue(ejbRefs.hasNext());
    }
View Full Code Here

                {
                    WebXml srcWebXml = WebXmlIo.parseWebXmlFromFile(
                        this.srcFile, this.xmlCatalog);
                    WebXml mergeWebXml = WebXmlIo.parseWebXmlFromFile(
                        this.mergeFile, this.xmlCatalog);
                    WebXmlMerger merger = new WebXmlMerger(srcWebXml);
                    merger.setMonitor(new AntMonitor(this));
                    merger.merge(mergeWebXml);
                    WebXmlIo.writeWebXml(srcWebXml, this.destFile,
                        this.encoding, this.indent);
                }
                else
                {
View Full Code Here

        {
            try
            {
                WebXml parsedMergeWebXml = WebXmlIo.parseWebXmlFromFile(
                    this.mergeWebXml, this.xmlCatalog);
                WebXmlMerger merger = new WebXmlMerger(theWebXml);
                merger.setMonitor(new AntMonitor(this));
                merger.merge(parsedMergeWebXml);
            }
            catch (IOException e)
            {
                throw new BuildException(
                    "Could not merge deployment descriptors", e);
View Full Code Here

TOP

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

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.