Package org.apache.karaf.instance.core

Examples of org.apache.karaf.instance.core.InstanceSettings


        cfgFile.createNewFile();

       
        EasyMock.verify(instanceService); // check precondition
        EasyMock.reset(instanceService);
        InstanceSettings expectedIS =
            new InstanceSettings(9941, 1122, 44444, "top", "foo", Collections.singletonList("http://something"), Arrays.asList("abc", "def"));
        EasyMock.expect(instanceService.createInstance("myInstance", expectedIS, true)).andReturn(null);
        EasyMock.replay(instanceService);
       
        cc.doExecute();
        EasyMock.verify(instanceService);
View Full Code Here


            }
            if ("".equals(javaOpts)) {
                javaOpts = null;
            }

            InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts,
                    parseStringList(featureURLs), parseStringList(features), address);

            Instance inst = instanceService.createInstance(name, settings, false);
            if (inst != null) {
                return inst.getPid();
View Full Code Here

            }
            if ("".equals(javaOpts)) {
                javaOpts = null;
            }

            InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null);

            instanceService.cloneInstance(name, cloneName, settings, false);
        } catch (Exception e) {
            throw new MBeanException(null, e.getMessage());
        }
View Full Code Here

            p.store(os, "Test comment");
        } finally {
            os.close();
        }

        InstanceSettings s = new InstanceSettings(8122, 1122, 44444, null, null, null, Arrays.asList("test"));
        as.addFeaturesFromSettings(f, s);

        Properties p2 = new Properties();
        InputStream is = new FileInputStream(f);
        try {
View Full Code Here

    @Test
    public void testConfigurationFiles() throws Exception {
        InstanceServiceImpl service = new InstanceServiceImpl();
        service.setStorageLocation(tempFolder.newFolder("instances"));

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        Instance instance = service.createInstance(getName(), settings, true);

        assertFileExists(instance.getLocation(), "etc/config.properties");
        assertFileExists(instance.getLocation(), "etc/users.properties");
        assertFileExists(instance.getLocation(), "etc/startup.properties");
View Full Code Here

        InstanceServiceImpl service = new InstanceServiceImpl();
        service.setStorageLocation(new File("target/instances/" + System.currentTimeMillis()));
        Map<String, URL> textResources = new HashMap<String, URL>();
        textResources.put("etc/myresource", getClass().getClassLoader().getResource("myresource"));

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null, null, textResources, new HashMap<String, URL>());
        Instance instance = service.createInstance(getName(), settings, false);

        assertFileExists(instance.getLocation(), "etc/myresource");
    }
View Full Code Here

    @Test
    public void testRenameInstance() throws Exception {
        InstanceServiceImpl service = new InstanceServiceImpl();
        service.setStorageLocation(tempFolder.newFolder("instances"));

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        service.createInstance(getName(), settings, true);

        service.renameInstance(getName(), getName() + "b", true);
        assertNotNull(service.getInstance(getName() + "b"));
    }
View Full Code Here

    public void testToSimulateRenameInstanceByExternalProcess() throws Exception {
        InstanceServiceImpl service = new InstanceServiceImpl();
        File storageLocation = tempFolder.newFolder("instances");
        service.setStorageLocation(storageLocation);

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        service.createInstance(getName(), settings, true);
       
        //to simulate the scenario that the instance name get changed by
        //external process, likely the admin command CLI tool, which cause
        //the instance storage file get updated, the AdminService should be
View Full Code Here

TOP

Related Classes of org.apache.karaf.instance.core.InstanceSettings

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.