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

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


        if (jspServlet != null) {
            jspServletInfo = jspServlet.servlets.get(0);
        } else {
            jspServletInfo = null;
        }
        this.webAppInfoFactory = new StandardWebAppInfoFactory(defaultWebApp, jspServletInfo);

        this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders);//, GerClusteringDocument.type.getDocumentElementName());
    }
View Full Code Here


        if (jspServlet != null) {
            jspServletInfo = jspServlet.servlets.get(0);
        } else {
            jspServletInfo = null;
        }
        this.webAppInfoFactory = new StandardWebAppInfoFactory(defaultWebApp, jspServletInfo);

    }
View Full Code Here

            }

            webAppData.setReferencePattern("ContextCustomizer", jspLifecycleName);
        }

        WebAppInfoBuilder webAppInfoBuilder = (WebAppInfoBuilder)sharedContext.get(WebModule.WEB_APP_INFO);
        if (webAppInfoBuilder != null) {
            WebAppInfo webAppInfo = webAppInfoBuilder.getWebAppInfo();
            webAppInfo.listeners.addAll(listenerNames);
            //install default jsp servlet....
            ServletInfo jspServlet = webAppInfoBuilder.copy(defaultJspServletInfo);
            List<JspConfig> jspConfigs = webApp.getJspConfig();
            List<String> jspMappings = new ArrayList<String>();
            for (JspConfig jspConfig : jspConfigs) {
                for (JspPropertyGroup propertyGroup : jspConfig.getJspPropertyGroup()) {
                    WebAppInfoBuilder.normalizeUrlPatterns(propertyGroup.getUrlPattern(), jspMappings);
View Full Code Here

    private ClassLoader classLoader = this.getClass().getClassLoader();

    public void testParsing() throws Exception {
        WebApp webApp = parse("security/web1.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        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

     * HTTPMethod "all" handling
     * @throws Exception
     */
    public void testAllMethodsConstraint() throws Exception {
        WebApp webApp = parse("security/web2.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        Permission p = new WebResourcePermission("/Test/Foo", "GET,POST");
        assertTrue(implies(p, permissions, "Admin"));
        assertFalse(implies(new WebResourcePermission("/Test", ""), permissions, null));
        assertFalse(implies(new WebResourcePermission("/Test", "!"), permissions, null));
View Full Code Here

        assertFalse(implies(new WebResourcePermission("/Test", "!"), permissions, null));
    }

    public void testExcludedConstraint() throws Exception {
        WebApp webApp = parse("security/web3.xml");
        WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, new DefaultWebAppInfoFactory());
        webAppInfoBuilder.build();
        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppInfoBuilder.getWebAppInfo());
        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
        Permission p = new WebResourcePermission("/Test/Foo", "GET,POST");
        assertTrue(implies(p, permissions, "Admin"));
        assertFalse(implies(p, permissions, null));
        p = new WebResourcePermission("/Test/Bar/Foo", "GET,POST");
View Full Code Here

        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

TOP

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

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.