Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.WebApp


        assertFalse(implies(p, permissions, "Peon"));
    }

    //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
View Full Code Here


        assertTrue(implies(p, permissions, "user"));
        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");
View Full Code Here

        p = new WebResourcePermission("/app/home", "POST");
        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");
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 {
View Full Code Here

        Map<String, WebFragment> jarURLWebFragmentMap = new LinkedHashMap<String, WebFragment>();
        jarURLWebFragmentMap.put("WEB-INF/lib/testA.jar", loadXmlObject("webfragments/absolute/webfragmentA.xml", WebFragment.class));
        jarURLWebFragmentMap.put("WEB-INF/lib/testB.jar", loadXmlObject("webfragments/absolute/webfragmentB.xml", WebFragment.class));
        jarURLWebFragmentMap.put("WEB-INF/lib/testC.jar", loadXmlObject("webfragments/absolute/webfragmentC.xml", WebFragment.class));
        jarURLWebFragmentMap.put("WEB-INF/lib/testD.jar", loadXmlObject("webfragments/absolute/webfragmentD.xml", WebFragment.class));
        WebApp webApp = loadXmlObject("webfragments/absolute/web-withothers.xml", WebApp.class);
        EARContext rootContext = new DummyEARContext();
        WebFragmentEntry[] webFragmentEntries = MergeHelper.sortWebFragments(rootContext, createDummyWebModule(rootContext), null, webApp, jarURLWebFragmentMap);
        Assert.assertEquals(4, webFragmentEntries.length);
        Assert.assertEquals("webfragmentD", webFragmentEntries[0].getName());
        Assert.assertEquals("webfragmentB", webFragmentEntries[1].getName());
View Full Code Here

        Map<String, WebFragment> jarURLWebFragmentMap = new LinkedHashMap<String, WebFragment>();
        jarURLWebFragmentMap.put("WEB-INF/lib/testA.jar", loadXmlObject("webfragments/absolute/webfragmentA.xml", WebFragment.class));
        jarURLWebFragmentMap.put("WEB-INF/lib/testB.jar", loadXmlObject("webfragments/absolute/webfragmentB.xml", WebFragment.class));
        jarURLWebFragmentMap.put("WEB-INF/lib/testC.jar", loadXmlObject("webfragments/absolute/webfragmentC.xml", WebFragment.class));
        jarURLWebFragmentMap.put("WEB-INF/lib/testD.jar", loadXmlObject("webfragments/absolute/webfragmentD.xml", WebFragment.class));
        WebApp webApp = loadXmlObject("webfragments/absolute/web-withoutothers.xml", WebApp.class);
        EARContext rootContext = new DummyEARContext();
        WebFragmentEntry[] webFragmentEntries = MergeHelper.sortWebFragments(rootContext, createDummyWebModule(rootContext), null, webApp, jarURLWebFragmentMap);
        Assert.assertEquals(2, webFragmentEntries.length);
        Assert.assertEquals("webfragmentD", webFragmentEntries[0].getName());
        Assert.assertEquals("webfragmentA", webFragmentEntries[1].getName());
View Full Code Here

        jarURLWebFragmentMap.put("WEB-INF/lib/testB.jar", loadXmlObject("webfragments/relative/webfragmentB.xml", WebFragment.class));
        //C -(before) -> others
        jarURLWebFragmentMap.put("WEB-INF/lib/testC.jar", loadXmlObject("webfragments/relative/webfragmentC.xml", WebFragment.class));
        //D -(after) -> others
        jarURLWebFragmentMap.put("WEB-INF/lib/testD.jar", loadXmlObject("webfragments/relative/webfragmentD.xml", WebFragment.class));
        WebApp webApp = loadXmlObject("webfragments/relative/web.xml", WebApp.class);
        EARContext rootContext = new DummyEARContext();
        WebFragmentEntry[] webFragmentEntries = MergeHelper.sortWebFragments(rootContext, createDummyWebModule(rootContext), null, webApp, jarURLWebFragmentMap);
        Assert.assertEquals("webfragmentC", webFragmentEntries[0].getName());
        Assert.assertEquals("webfragmentB", webFragmentEntries[1].getName());
        Assert.assertEquals("webfragmentA", webFragmentEntries[2].getName());
View Full Code Here

            //A  -(before)-> A
            jarURLWebFragmentMap.put("WEB-INF/lib/testA.jar", loadXmlObject("webfragments/circus/circusA/webfragmentA.xml", WebFragment.class));
            jarURLWebFragmentMap.put("WEB-INF/lib/testB.jar", loadXmlObject("webfragments/circus/circusA/webfragmentB.xml", WebFragment.class));
            jarURLWebFragmentMap.put("WEB-INF/lib/testC.jar", loadXmlObject("webfragments/circus/circusA/webfragmentC.xml", WebFragment.class));
            jarURLWebFragmentMap.put("WEB-INF/lib/testD.jar", loadXmlObject("webfragments/circus/circusA/webfragmentD.xml", WebFragment.class));
            WebApp webApp = loadXmlObject("webfragments/circus/circusA/web.xml", WebApp.class);
            EARContext rootContext = new DummyEARContext();
            WebFragmentEntry[] webFragmentEntries = MergeHelper.sortWebFragments(rootContext, createDummyWebModule(rootContext), null, webApp, jarURLWebFragmentMap);
            fail("Circus Dependency should be found");
        } catch (DeploymentException e) {
            Assert.assertTrue(e.getMessage().indexOf("WEB-INF/lib/testA.jar") != -1);
View Full Code Here

            jarURLWebFragmentMap.put("WEB-INF/lib/testA.jar", loadXmlObject("webfragments/circus/circusB/webfragmentA.xml", WebFragment.class));
            //B -(before) -> A
            jarURLWebFragmentMap.put("WEB-INF/lib/testB.jar", loadXmlObject("webfragments/circus/circusB/webfragmentB.xml", WebFragment.class));
            jarURLWebFragmentMap.put("WEB-INF/lib/testC.jar", loadXmlObject("webfragments/circus/circusB/webfragmentC.xml", WebFragment.class));
            jarURLWebFragmentMap.put("WEB-INF/lib/testD.jar", loadXmlObject("webfragments/circus/circusB/webfragmentD.xml", WebFragment.class));
            WebApp webApp = loadXmlObject("webfragments/circus/circusB/web.xml", WebApp.class);
            EARContext rootContext = new DummyEARContext();
            WebFragmentEntry[] webFragmentEntries = MergeHelper.sortWebFragments(rootContext, createDummyWebModule(rootContext), null, webApp, jarURLWebFragmentMap);
            fail("Circus Dependency should be found");
        } catch (DeploymentException e) {
            Assert.assertTrue(e.getMessage().indexOf("WEB-INF/lib/testA.jar") != -1 || e.getMessage().indexOf("WEB-INF/lib/testB.jar") != -1);
View Full Code Here

            jarURLWebFragmentMap.put("WEB-INF/lib/testB.jar", loadXmlObject("webfragments/circus/circusC/webfragmentB.xml", WebFragment.class));
            //C -(before) -> others
            jarURLWebFragmentMap.put("WEB-INF/lib/testC.jar", loadXmlObject("webfragments/circus/circusC/webfragmentC.xml", WebFragment.class));
            //D -(after) -> A
            jarURLWebFragmentMap.put("WEB-INF/lib/testD.jar", loadXmlObject("webfragments/circus/circusC/webfragmentD.xml", WebFragment.class));
            WebApp webApp = loadXmlObject("webfragments/circus/circusC/web.xml", WebApp.class);
            EARContext rootContext = new DummyEARContext();
            WebFragmentEntry[] webFragmentEntries = MergeHelper.sortWebFragments(rootContext, createDummyWebModule(rootContext), null, webApp, jarURLWebFragmentMap);
            fail("Circus Dependency should be found");
        } catch (DeploymentException e) {
            Assert.assertTrue(e.getMessage().indexOf("WEB-INF/lib/testA.jar") != -1 || e.getMessage().indexOf("WEB-INF/lib/testB.jar") != -1 || e.getMessage().indexOf("WEB-INF/lib/testD.jar") != -1);
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.WebApp

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.