Examples of GlassFishProperties


Examples of org.glassfish.embeddable.GlassFishProperties

    public void launchGlassFish() throws Exception {
        System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");
        System.setProperty("java.util.logging.config.file",
            "src/test/resources/glassfish-config/logging.properties");

        GlassFishProperties gfProps = new GlassFishProperties();
        GlassFish gf = GlassFishRuntime.bootstrap().newGlassFish(gfProps);
        gf.start();

        Deployer deployer = gf.getDeployer();
        for (String appName : deployer.getDeployedApplications()) {
View Full Code Here

Examples of org.glassfish.embeddable.GlassFishProperties

        System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");
        ConfigurationManager cm = new ConfigurationManager();
        configDirName = cm.getProperty(GLASSFISH_CONFIG_DIR_KEY,
            "src/test/resources/glassfish-config");
        File domainConfig = new File(configDirName, "domain.xml");
        GlassFishProperties gfProps = new GlassFishProperties();
        if (domainConfig.exists()) {
            gfProps.setConfigFileURI(domainConfig.toURI().toString());
        }

        try {
            glassFish = GlassFishRuntime.bootstrap().newGlassFish(gfProps);
            glassFish.start();
View Full Code Here

Examples of org.glassfish.embeddable.GlassFishProperties

                bootstrapProperties.setInstallRoot(installRoot);
            }
            glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProperties);
        }

        GlassFishProperties glassfishProperties = new GlassFishProperties();
        if (instanceRoot != null) {
            glassfishProperties.setInstanceRoot(instanceRoot);
        }
        if (configFileURI != null) {
            glassfishProperties.setConfigFileURI(configFileURI);
            glassfishProperties.setConfigFileReadOnly(configFileReadOnly);
        }

        if (instanceRoot==null && configFileURI==null) {
            // only set port if embedded domain.xml is used
            if (httpPort != -1) {
                glassfishProperties.setPort("http-listener", httpPort);
            }
        }

        glassfish = glassfishRuntime.newGlassFish(glassfishProperties);
        glassfish.start();
View Full Code Here

Examples of org.glassfish.embeddable.GlassFishProperties

            // Don't set temporarily created instanceroot in the user supplied
            // GlassFishProperties, hence clone it.
            Properties cloned = new Properties();
            cloned.putAll(glassFishProperties.getProperties());

            final GlassFishProperties gfProps = new GlassFishProperties(cloned);
            setEnv(gfProps);

            final StartupContext startupContext = new StartupContext(gfProps.getProperties());
           
            ModulesRegistry modulesRegistry = SingleHK2Factory.getInstance().createModulesRegistry();
           
            Binder postProcessorBinder = new Binder() {

        @Override
        public void bind(DynamicConfiguration config) {
          config.bind(BuilderHelper.createConstantDescriptor(new EmbeddedInhabitantsParser()));
        }
             
            };
           
            ServiceLocator serviceLocator = main.createServiceLocator(modulesRegistry, startupContext, postProcessorBinder, null);

            final ModuleStartup gfKernel = main.findStartupService(modulesRegistry, serviceLocator, null, startupContext);
            // create a new GlassFish instance
            GlassFishImpl gfImpl = new GlassFishImpl(gfKernel, serviceLocator, gfProps.getProperties()) {
                @Override
                public void dispose() throws GlassFishException {
                    try {
                        super.dispose();
                    } finally {
                        gfMap.remove(gfProps.getInstanceRoot());
                        if ("true".equalsIgnoreCase(gfProps.getProperties().
                                getProperty(autoDelete)) && gfProps.getInstanceRoot() != null) {
                            File instanceRoot = new File(gfProps.getInstanceRoot());
                            if (instanceRoot.exists()) { // might have been deleted already.
                                Util.deleteRecursive(instanceRoot);
                            }
                        }
                    }
                }
            };
            // Add this newly created instance to a Map
            gfMap.put(gfProps.getInstanceRoot(), gfImpl);
            return gfImpl;
        } catch (GlassFishException e) {
            throw e;
        } catch(Exception e) {
            throw new GlassFishException(e);
View Full Code Here

Examples of org.glassfish.embeddable.GlassFishProperties

            }
        }

        if (glassfish == null) {
            try {
                GlassFishProperties gfProperties = new GlassFishProperties();
                gfProperties.setPort("http-listener", getBaseUri().getPort());

                glassfish = gfr.newGlassFish(gfProperties);
                // use glassfish
            } catch (GlassFishException ngfex) {
                throw new TestContainerException(ngfex);
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.