Package org.apache.geronimo.web25.deployment.merge

Examples of org.apache.geronimo.web25.deployment.merge.MergeHelper


        assertFalse(implies(p, permissions, "Admin"));
        assertFalse(implies(p, permissions, "Peon"));
    }
    public void testExcludedRemovesRoleConstraint() throws Exception {
        WebApp webApp = parse("security/web4.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        // test excluding longer path than allowed
        Permission p = new WebResourcePermission("/Foo/Baz", "GET");
        assertTrue(implies(p, permissions, "Admin"));
        assertFalse(implies(p, permissions, "Peon"));
View Full Code Here


    }

    //overlapping excluded and role constraint, excluded constraint wins.
    public void testExcludedAndRoleConstraint() throws Exception {
        WebApp webApp = parse("security/web5.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        // test excluding longer path than allowed
        Permission p = new WebResourcePermission("/foo/Baz", "GET");
        assertFalse(implies(p, permissions, "user"));
        assertFalse(implies(p, permissions, null));
View Full Code Here

        assertTrue(implies(p, permissions, null));
    }

    public void testHTTPOmissionMethodsConstraint() throws Exception {
        WebApp webApp = parse("security/web6.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        Permission p = new WebResourcePermission("/app/*", "GET");
        assertFalse(implies(p, permissions, null));
        p = new WebResourcePermission("/app/home", "POST");
        assertTrue(implies(p, permissions, null));
View Full Code Here

        assertTrue(implies(p, permissions, null));
    }

    public void testDifferentRoleDifferentHttpMethod() throws Exception {
        WebApp webApp = parse("security/web7.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        Permission p = new WebResourcePermission("/app/*", "GET");
        assertTrue(implies(p, permissions, "userGet"));
        assertFalse(implies(p, permissions, "userPost"));
        p = new WebResourcePermission("/app/home", "POST");
View Full Code Here

    public void testNoSecConstraint() throws Exception {
        URL specDDUrl = classLoader.getResource("security/web-nosecurity.xml");
        InputStream in = specDDUrl.openStream();
        try {
            WebApp webApp = (WebApp) JaxbJavaee.unmarshalJavaee(WebApp.class, in);
            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
            webAppInfoBuilder.build();
            SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
            ComponentPermissions componentPermissions = builder.buildSpecSecurityConfig();
        } finally {
            in.close();
        }
    }
View Full Code Here

                webModuleData.setReferencePattern("JettyContainer", jettyContainerObjectName);
            }
            //stuff that jetty used to do
            webModuleData.setAttribute("displayName", webApp.getDisplayName());

            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, webAppInfoFactory);
            WebAppInfo webAppInfo = webAppInfoBuilder.build();

            webModuleData.setAttribute("webAppInfo", webAppInfo);

            webModule.getSharedContext().put(WebModule.WEB_APP_INFO, webAppInfoBuilder);
View Full Code Here

        try {
            XMLStreamReader reader = enclosing.newXMLStreamReader();
            while (reader.hasNext() && reader.next() != 1);
            if (s.endsWith("WebAppInfo")) {
                WebApp webApp = (WebApp) unmarshalJavaee(WebApp.class, reader);
                return new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory()).build();
            }
            throw new DeploymentException("Unrecognized xml: " + enclosing.xmlText());
        } catch (XMLStreamException e) {
            throw new DeploymentException("xml problem", e);
        }
View Full Code Here

                }
            });


            JAXBElement<WebApp> element = unmarshaller.unmarshal(new StreamSource(new StringReader(text)), WebApp.class);
            WebAppInfo webAppInfo = new WebAppInfoBuilder(element.getValue(), new DefaultWebAppInfoFactory()).build();
            setValue(webAppInfo);
        } catch (JAXBException e) {
            throw new RuntimeException("parsing problem", e);
        } catch (DeploymentException e) {
            throw new RuntimeException("conversion problem", e);
View Full Code Here

                if (null == webModuleData.getReferencePatterns(TomcatWebAppContext.GBEAN_REF_CLUSTERED_VALVE_RETRIEVER)) {
                    log.warn("No clustering builders configured: app will not be clustered");
                }
            }

            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, webAppInfoFactory);
            WebAppInfo webAppInfo = webAppInfoBuilder.build();

            webModuleData.setAttribute("webAppInfo", webAppInfo);

            webModule.getSharedContext().put(WebModule.WEB_APP_INFO, webAppInfoBuilder);
View Full Code Here

                webModuleData.setReferencePattern("JettyContainer", jettyContainerObjectName);
            }
            //stuff that jetty used to do
            webModuleData.setAttribute("displayName", webApp.getDisplayName());

            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, webAppInfoFactory);
            WebAppInfo webAppInfo = webAppInfoBuilder.build();

            webModuleData.setAttribute("webAppInfo", webAppInfo);

            webModule.getSharedContext().put(WebModule.WEB_APP_INFO, webAppInfoBuilder);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.web25.deployment.merge.MergeHelper

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.