Package org.apache.geronimo.deployment

Examples of org.apache.geronimo.deployment.DeploymentContext$ConfigurationParentSource


                serviceBuilder,
                persistenceUnitBuilder,
                naming, artifactResolvers);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(resolveFile("src/test/resources/plans/test-bad-war.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            //we now may get a FileNotFoundException for missing wars.
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here


                serviceBuilder,
                persistenceUnitBuilder,
                naming, artifactResolvers);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(resolveFile("src/test/resources/plans/test-bad-rar.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            //we now may get a FileNotFoundException for missing wars.
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                serviceBuilder,
                persistenceUnitBuilder,
                naming, artifactResolvers);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(resolveFile("src/test/resources/plans/test-bad-car.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            //we now may get a FileNotFoundException for missing wars.
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                persistenceUnitBuilder,
                naming, artifactResolvers);


        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(null, earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                serviceBuilder,
                persistenceUnitBuilder,
                naming, artifactResolvers);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(null, earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                serviceBuilder,
                persistenceUnitBuilder,
                naming, artifactResolvers);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(null, earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

            outfile = targetConfigurationStore.createNewConfigurationDir(configId);
        } catch (ConfigurationAlreadyExistsException e) {
            throw new DeploymentException(e);
        }

        DeploymentContext context = null;
        try {
            ConfigurationManager configurationManager = this.configurationManager;
            if (configurationManager == null) {
                configurationManager = new SimpleConfigurationManager(configurationStores, artifactResolver, repositories);
            }

            AbstractName moduleName = naming.createRootName(configId, configId.toString(), SERVICE_MODULE);
            context = new DeploymentContext(outfile,
                    inPlaceDeployment && null != jar ? DeploymentUtil.toFile(jar) : null,
                    environment,
                    moduleName,
                    ConfigurationModuleType.SERVICE,
                    naming,
                    configurationManager,
                    repositories);
            if(jar != null) {
                File file = new File(jar.getName());
                context.addIncludeAsPackedJar(URI.create(file.getName()), jar);
            }

            serviceBuilders.build(moduleType, context, context);
            return context;
        } catch (DeploymentException de) {
View Full Code Here

            MockRepository mockRepository = new MockRepository();
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.singleton(mockRepository), null);
            ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);
            AbstractName moduleName = naming.createRootName(environment.getConfigId(), "foo", "bar");
            DeploymentContext context = new DeploymentContext(outFile, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.singleton(mockRepository));

            gbeanBuilder.build(plan, context, context);
            Set gbeanNames = context.getGBeanNames();
            assertEquals(1, gbeanNames.size());
            AbstractName beanName = (AbstractName) gbeanNames.iterator().next();
            GBeanData data = context.getGBeanInstance(beanName);
            FooBarBean fooBarBean = (FooBarBean) data.getAttribute("fooBarBean");
            assertNotNull(fooBarBean);
            assertEquals("foo", fooBarBean.getFoo());
            assertEquals(10, fooBarBean.getBar());
            FooBarBean inner = fooBarBean.getBean();
View Full Code Here

                    serviceBuilder,
                    null,
                    kernel.getNaming(),
                    null);
            ConfigurationData configData = null;
            DeploymentContext context = null;
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET, null);

            try {
                File planFile = new File(BASEDIR, "src/test/data/data/external-application-plan.xml");
                ModuleIDBuilder idBuilder = new ModuleIDBuilder();
                Object plan = configBuilder.getDeploymentPlan(planFile, rarFile, idBuilder);
                context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, rarFile, idBuilder), plan, rarFile, Collections.singleton(configurationStore), artifactResolver, configurationStore);

                // add the a j2ee server so the application context reference can be resolved
                context.addGBean("geronimo", J2EEServerImpl.GBEAN_INFO);

                configData = context.getConfigurationData();
            } finally {
                if (context != null) {
                    context.close();
                }
                if (configData != null) {
                    DeploymentUtil.recursiveDelete(configData.getConfigurationDir());
                }
            }
View Full Code Here

        Jsr77Naming naming = new Jsr77Naming();
        ArtifactManager artifactManager = new DefaultArtifactManager();
        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET, null);
        ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);
        AbstractName moduleName = naming.createRootName(configID, "testejb", NameFactory.EJB_MODULE);
        context = new DeploymentContext(tmpbasedir, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.EMPTY_SET);

        File moduleLocation = new File(tmpbasedir, "ejb");
        moduleLocation.mkdirs();
        module = new EJBModule(true, moduleName, environment, new UnpackedJarFile(moduleLocation), "ejb", null, null, null, null);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.DeploymentContext$ConfigurationParentSource

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.