Package org.apache.felix.karaf.admin

Examples of org.apache.felix.karaf.admin.InstanceSettings


        } else if ("create".equals(action)) {
            int port = parsePortNumber(req.getParameter("port"));
            String location = parseString(req.getParameter("location"));
            List<String> featureURLs = parseStringList(req.getParameter("featureURLs"));
            List<String> features = parseStringList(req.getParameter("features"));
            InstanceSettings settings = new InstanceSettings(port, location, featureURLs, features);
            success = createInstance(name, settings);
        } else if ("destroy".equals(action)) {
            success = destroyInstance(name);
        } else if ("start".equals(action)) {
            String javaOpts = req.getParameter("javaOpts");
View Full Code Here


import org.apache.felix.karaf.admin.InstanceSettings;
import org.junit.Assert;

public class InstanceSettingsTest extends TestCase {
    public void testInstanceSettings() {
        InstanceSettings is =
            new InstanceSettings(1, null, Collections.<String>emptyList(), Arrays.asList("hi"));
        assertEquals(1, is.getPort());
        Assert.assertNull(is.getLocation());
        assertEquals(Arrays.asList("hi"), is.getFeatures());
        assertEquals(0, is.getFeatureURLs().size());
    }
View Full Code Here

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

        testEqualsHashCode(1, "top", Collections.<String>emptyList(), Arrays.asList("hi"));
        testEqualsHashCode(0, null, null, null);
    }

    private void testEqualsHashCode(int port, String location, List<String> featureURLs, List<String> features) {
        InstanceSettings is = new InstanceSettings(port, location, featureURLs, features);
        InstanceSettings is2 = new InstanceSettings(port, location, featureURLs, features);
        assertEquals(is, is2);
        assertEquals(is.hashCode(), is2.hashCode());
    }
View Full Code Here

        assertEquals(is, is2);
        assertEquals(is.hashCode(), is2.hashCode());
    }
   
    public void testEqualsHashCode2() {
        InstanceSettings is = new InstanceSettings(1, "top", Collections.<String>emptyList(), Arrays.asList("hi"));
        Assert.assertFalse(is.equals(null));
        Assert.assertFalse(is.equals(new Object()));
        assertEquals(is, is);
    }
View Full Code Here

    @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 {
        InstanceSettings settings = new InstanceSettings(port, location, featureURLs, features);
        getAdminService().createInstance(instance, settings);
        return null;
    }
View Full Code Here

                p.store(os, "Test comment");
            } finally {
                os.close();
            }
           
            InstanceSettings s = new InstanceSettings(8122, null, null, Arrays.asList("test"));
            as.handleFeatures(f, s);
           
            Properties p2 = new Properties();
            InputStream is = new FileInputStream(f);
            try {
View Full Code Here

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

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

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

        m.setAccessible(true);
        return (List<String>) m.invoke(ap, s);
    }
   
    public void testDoPostCreate() throws Exception {
        InstanceSettings is =
            new InstanceSettings(1234, null, Collections.singletonList("http://someURL"), Arrays.asList("abc", "def"));
        AdminService adminService = EasyMock.createMock(AdminService.class);
        EasyMock.expect(adminService.createInstance("instance1", is)).andReturn(null);
        EasyMock.expect(adminService.getInstances()).andReturn(new Instance[] {}).anyTimes();
        EasyMock.replay(adminService);
       
View Full Code Here

            throws Exception {
        if ("".equals(location)) {
            location = null;
        }

        InstanceSettings settings = new InstanceSettings(port, location,
                parseStringList(featureURLs), parseStringList(features));

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

TOP

Related Classes of org.apache.felix.karaf.admin.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.