Examples of WebAppDocument


Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument


    public void testParsing() throws Exception {
        roleSet.add("Admin");
        URL srcXml = classLoader.getResource("security/web1.xml");
        WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
        WebAppType webAppType = webAppDoc.getWebApp();
        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType, roleSet, rolePermissionMap);
        PermissionCollection unchecked = permissions.getUncheckedPermissions();
        assertTrue(unchecked.implies(new WebResourcePermission("/login.do", "!")));
        assertTrue(unchecked.implies(new WebResourcePermission("/foo", "!")));
        assertFalse(unchecked.implies(new WebResourcePermission("/foo.do", "!")));
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

     * @throws Exception
     */
    public void testAllMethodsConstraint() throws Exception {
        roleSet.add("Admin");
        URL srcXml = classLoader.getResource("security/web2.xml");
        WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
        WebAppType webAppType = webAppDoc.getWebApp();
        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType, roleSet, rolePermissionMap);
        PermissionCollection unchecked = permissions.getUncheckedPermissions();
        assertFalse(unchecked.implies(new WebResourcePermission("/Test", "!")));
        PermissionCollection adminPermissions = permissions.getRolePermissions().get("Admin");
        assertTrue(adminPermissions.implies(new WebResourcePermission("/Test", "GET,POST")));
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

        URL specDDUrl = DeploymentUtil.createJarURL(jarFile, "WEB-INF/web.xml");
        // read in the entire specDD as a string
        specDD = DeploymentUtil.readAll(specDDUrl);
        // parse it
        XmlObject parsed = XmlBeansUtil.parse(specDD);
        WebAppDocument webAppDoc = webModuleBuilder
                .convertToServletSchema(parsed);
        webApp = webAppDoc.getWebApp();
        Set securityRoles = AbstractWebModuleBuilder.collectRoleNames(webApp);
        Map rolePermissions = new HashMap();
        try {
        ComponentPermissions componentPermissions = webModuleBuilder
                .buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

            // on the J2ee management object
            specDD = DeploymentUtil.readAll(specDDUrl);

            // we found web.xml, if it won't parse that's an error.
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            WebAppDocument webAppDoc = convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
            check(webApp);
        } catch (XmlException e) {
            // Output the target path in the error to make it clearer to the user which webapp
            // has the problem.  The targetPath is used, as moduleFile may have an unhelpful
            // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

                cursor.toFirstChild();
                isJavaee = "http://java.sun.com/xml/ns/javaee".equals(cursor.getName().getNamespaceURI());
            } finally {
                cursor.dispose();
            }
            WebAppDocument webAppDoc = convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
            check(webApp);
        } catch (XmlException e) {
            // Output the target path in the error to make it clearer to the user which webapp
            // has the problem.  The targetPath is used, as moduleFile may have an unhelpful
            // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

    }

    public void testContextRootWithoutPlanButWebApp() throws Exception {

        WebAppDocument webAppDocument = WebAppDocument.Factory.newInstance();
        WebAppType webAppType = webAppDocument.addNewWebApp();
        webAppType.setId("myId");

        URL war = classLoader.getResource("deployables/war2.war");
        assertTrue(war != null);
        JarFile dummyFile = new JarFile(new File(war.getFile()));
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument


    public void testParsing() throws Exception {
        roleSet.add("Admin");
        URL srcXml = classLoader.getResource("security/web1.xml");
        WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
        WebAppType webAppType = webAppDoc.getWebApp();
        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType, roleSet, rolePermissionMap);
        PermissionCollection unchecked = permissions.getUncheckedPermissions();
        assertTrue(unchecked.implies(new WebResourcePermission("/login.do", "!")));
        assertTrue(unchecked.implies(new WebResourcePermission("/foo", "!")));
        assertFalse(unchecked.implies(new WebResourcePermission("/foo.do", "!")));
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument


    public void testParsing() throws Exception {
        roleSet.add("Admin");
        URL srcXml = classLoader.getResource("security/web1.xml");
        WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
        WebAppType webAppType = webAppDoc.getWebApp();
        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType, roleSet, rolePermissionMap);
        PermissionCollection unchecked = permissions.getUncheckedPermissions();
        assertTrue(unchecked.implies(new WebResourcePermission("/login.do", "!")));
        assertTrue(unchecked.implies(new WebResourcePermission("/foo", "!")));
        assertFalse(unchecked.implies(new WebResourcePermission("/foo.do", "!")));
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

        URL specDDUrl = DeploymentUtil.createJarURL(jarFile, "WEB-INF/web.xml");
        // read in the entire specDD as a string
        specDD = DeploymentUtil.readAll(specDDUrl);
        // parse it
        XmlObject parsed = XmlBeansUtil.parse(specDD);
        WebAppDocument webAppDoc = webModuleBuilder
                .convertToServletSchema(parsed);
        webApp = webAppDoc.getWebApp();
        Set securityRoles = AbstractWebModuleBuilder.collectRoleNames(webApp);
        Map rolePermissions = new HashMap();
        try {
        ComponentPermissions componentPermissions = webModuleBuilder
                .buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
View Full Code Here

Examples of org.apache.geronimo.xbeans.javaee.WebAppDocument

            // on the J2ee management object
            specDD = DeploymentUtil.readAll(specDDUrl);

            // we found web.xml, if it won't parse that's an error.
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            WebAppDocument webAppDoc = convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
            check(webApp);
        } catch (XmlException e) {
            // Output the target path in the error to make it clearer to the user which webapp
            // has the problem.  The targetPath is used, as moduleFile may have an unhelpful
            // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.