Examples of JettyWebAppType


Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

     * @throws Exception
     */
    public void testContextRootWithPlanAndContextSet() throws Exception {

        JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
        JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
        webApp.setConfigId("myId");
        webApp.setContextRoot("myContextRoot");
        webApp.setContextPriorityClassloader(false);

        JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));

        webApp = builder.getJettyWebApp(webApp, dummyFile, true, null, null);

        assertEquals("myContextRoot", webApp.getContextRoot());

    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

    }

    public void testContextRootWithoutPlanStandAlone() throws Exception {

        JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, true, null, null);

        assertEquals("war2", GerWebAppType.getContextRoot());

    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

    }

    public void testContextRootWithoutPlanAndTargetPath() throws Exception {

        JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", null);

        assertEquals("myTargetPath", GerWebAppType.getContextRoot());

    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

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

        JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", webAppType);

        assertEquals("myId", GerWebAppType.getContextRoot());

    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

    }

    public void testContents() throws Exception {
        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
        assertTrue(resourcePlan.exists());
        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, jettyWebApp.getResourceRefArray().length);
        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

    }

    public void testMoveSecurity1() throws Exception {
        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1A.xml");
        assertTrue(resourcePlan.exists());
        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, jettyWebApp.getResourceRefArray().length);
        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

            throw new DeploymentException("Error parsing web.xml", xmle);
        }
        check(webApp);

        // parse vendor dd
        JettyWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, standAlone, targetPath, webApp);
        if (contextRoot == null) {
            if (jettyWebApp.isSetContextRoot()) {
                contextRoot = jettyWebApp.getContextRoot();
            } else {
                contextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
            }
        }

        Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);

        //look for a webservices dd
        Map portMap = Collections.EMPTY_MAP;
        try {
            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
            portMap = webServiceBuilder.parseWebServiceDescriptor(wsDDUrl, moduleFile, false, servletNameToPathMap);
        } catch (MalformedURLException e) {
            //no descriptor
        }

        // get the ids from either the application plan or for a stand alone module from the specific deployer
        URI configId = null;
        try {
            configId = new URI(jettyWebApp.getConfigId());
        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e);
        }

        List parentId = ServiceConfigBuilder.getParentID(jettyWebApp.getParentId(), jettyWebApp.getImportArray());
        if (parentId.isEmpty()) {
            parentId = new ArrayList(defaultParentId);
        }
        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
        return module;
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

                }
            } catch (IOException e) {
                log.warn(e);
            }

            JettyWebAppType jettyWebApp = null;
            if (rawPlan != null) {
                XmlObject webPlan = new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
                        JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI(), "jetty").convertToSpecificPlan(rawPlan);
                jettyWebApp = (JettyWebAppType) webPlan.changeType(JettyWebAppType.type);
                SchemaConversionUtils.validateDD(jettyWebApp);
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

        return path;
    }

    private JettyWebAppType createDefaultPlan(String contextRoot) {
        JettyWebAppType jettyWebApp = JettyWebAppType.Factory.newInstance();

        // set the parentId, configId and context root
        jettyWebApp.setConfigId(contextRoot);
        jettyWebApp.setContextRoot(contextRoot);
        jettyWebApp.setContextPriorityClassloader(defaultContextPriorityClassloader);
        return jettyWebApp;
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType

            // we have to explicitly add these since we are unpacking the web module
            // and the url class loader will not pick up a manifest from an unpacked dir
            earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));

            // add the dependencies declared in the geronimo-web.xml file
            JettyWebAppType jettyWebApp = (JettyWebAppType) module.getVendorDD();
            DependencyType[] dependencies = jettyWebApp.getDependencyArray();
            ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
        } catch (IOException e) {
            throw new DeploymentException("Problem deploying war", e);
        } catch (URISyntaxException e) {
            throw new DeploymentException("Could not construct URI for location of war entry", e);
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.