Examples of InstanceSettings


Examples of org.apache.karaf.admin.InstanceSettings

        AdminServiceImpl service = new AdminServiceImpl();
        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, textResources, new HashMap<String, URL>());
        Instance instance = service.createInstance(getName(), settings);

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

Examples of org.apache.karaf.admin.InstanceSettings

     */
    public void testRenameInstance() throws Exception {
        AdminServiceImpl service = new AdminServiceImpl();
        service.setStorageLocation(new File("target/instances/" + System.currentTimeMillis()));

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

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

Examples of org.apache.karaf.admin.InstanceSettings

    public void testToSimulateRenameInstanceByExternalProcess() throws Exception {
        AdminServiceImpl service = new AdminServiceImpl();
        File storageLocation = new File("target/instances/" + System.currentTimeMillis());
        service.setStorageLocation(storageLocation);

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        service.createInstance(getName(), settings);
       
        //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

Examples of org.apache.karaf.admin.InstanceSettings

import org.easymock.EasyMock;
import org.junit.Assert;

public class AdminServiceMBeanImplTest extends TestCase {
    public void testCreateInstance() throws Exception {
        final InstanceSettings is = new InstanceSettings(123, 456, 789, "somewhere", "someopts",
                Collections.<String>emptyList(), Arrays.asList("webconsole", "funfeat"));
       
        final Instance inst = EasyMock.createMock(Instance.class);
        EasyMock.expect(inst.getPid()).andReturn(42);
        EasyMock.replay(inst);
View Full Code Here

Examples of org.apache.karaf.admin.InstanceSettings

       
        assertEquals(42, ab.createInstance("t1", 123, 456, 789, "somewhere", "someopts", " webconsole,  funfeat", ""));
    }
   
    public void testCreateInstance2() throws Exception {
        final InstanceSettings is = new InstanceSettings(0, 0, 0, null, null,
                Collections.<String>emptyList(), Collections.<String>emptyList());
       
        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.createInstance("t1", is)).andReturn(null);
        EasyMock.replay(as);
View Full Code Here

Examples of org.apache.karaf.admin.InstanceSettings

    @Argument(index = 0, name = "name", description="The name of the new container instance", required = true, multiValued = false)
    String instance = null;
    protected Object doExecute() throws Exception {
        Map<String, URL> textResources = getResources(textResourceLocation);
        Map<String, URL> binaryResources = getResources(binaryResourceLocations);
        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, featureURLs, features, textResources, binaryResources, address);
        getAdminService().createInstance(instance, settings);
        return null;
    }
View Full Code Here

Examples of org.apache.karaf.admin.InstanceSettings

    String cloneName;

    protected Object doExecute() throws Exception {
        Map<String, URL> textResources = getResources(textResourceLocation);
        Map<String, URL> binaryResources = getResources(binaryResourceLocations);
        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null, textResources, binaryResources);
        getAdminService().cloneInstance(name, cloneName, settings);
        return null;
    }
View Full Code Here

Examples of org.apache.karaf.admin.InstanceSettings

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

        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts,
                parseStringList(featureURLs), parseStringList(features), new HashMap<String, URL>(), new HashMap<String, URL>(), address);

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

Examples of org.apache.karaf.admin.InstanceSettings

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

        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null);
        adminService.cloneInstance(name, cloneName, settings);
    }
View Full Code Here

Examples of org.apache.karaf.admin.InstanceSettings

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

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

        Instance inst = adminService.createInstance(name, settings);
        if (inst != null) {
            return inst.getPid();
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.