Examples of createInstance()


Examples of org.apache.deltacloud.client.DeltaCloudClient.createInstance()

  @Test(expected=DeltaCloudClientException.class)
  public void canDestroy() throws DeltaCloudClientException {
    Image image = testSetup.getFirstImage(testSetup.getClient());
    DeltaCloudClient client = testSetup.getClient();
    Instance instance = client.createInstance(image.getId());
    instance.stop(client);
    instance.destroy(client);
    client.listInstances(instance.getId());
  }
View Full Code Here

Examples of org.apache.deltacloud.client.DeltaCloudClientImpl.createInstance()

  public void cannotDestroyIfNotAuthenticated() throws MalformedURLException, DeltaCloudClientException {
    DeltaCloudClientImpl unauthenticatedClient = new DeltaCloudClientImpl(
        MockIntegrationTestContext.DELTACLOUD_URL,
        "badUser", "badPassword");
    Image image = testSetup.getFirstImage(unauthenticatedClient);
    unauthenticatedClient.createInstance(image.getId());
  }

  @Test
  public void canCreateInstance() throws DeltaCloudClientException {
    Instance instance = null;
View Full Code Here

Examples of org.apache.felix.ipojo.api.PrimitiveComponentType.createInstance()

    @Test
    public void createACompositeWithAnImportedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
        // Define the component types
        PrimitiveComponentType prov = createAProvider();
        prov.createInstance();
        PrimitiveComponentType cons = createAConsumer();

        ServiceReference[] refs = osgiHelper.getServiceReferences(Factory.class.getName(),
                "(component.providedServiceSpecifications=" + Foo.class.getName() + ")");
        assertThat(refs.length, is(not(0)));
View Full Code Here

Examples of org.apache.felix.ipojo.api.composite.CompositeComponentType.createInstance()

           .setBundleContext(context)
           .setComponentTypeName("comp1")
           .addInstance(new Instance(prov.getFactory().getName()))
           .addInstance(new Instance(cons.getFactory().getName()));

       ComponentInstance ci = type.createInstance();

       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));

       // Stop cons
       cons.stop();
View Full Code Here

Examples of org.apache.felix.karaf.admin.AdminService.createInstance()

       
        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

Examples of org.apache.karaf.admin.AdminService.createInstance()

   
    public void testDoPostCreate() throws Exception {
        InstanceSettings is =
            new InstanceSettings(1234, 5678, null, 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);
       
        AdminPlugin ap = new AdminPlugin();
        ap.setAdminService(adminService);
View Full Code Here

Examples of org.apache.karaf.instance.core.InstanceService.createInstance()

   
    public void testDoPostCreate() throws Exception {
        InstanceSettings instanceSettings =
            new InstanceSettings(123, 456, 789,  null, null, Collections.singletonList("http://someURL"), Arrays.asList("abc", "def"));
        InstanceService instanceService = EasyMock.createMock(InstanceService.class);
        EasyMock.expect(instanceService.createInstance("instance1", instanceSettings, false)).andReturn(null);
        EasyMock.expect(instanceService.getInstances()).andReturn(new Instance[]{}).anyTimes();
        EasyMock.replay(instanceService);
       
        InstancePlugin ap = new InstancePlugin();
        ap.setInstanceService(instanceService);
View Full Code Here

Examples of org.apache.karaf.instance.core.InstancesMBean.createInstance()

        InstanceService instanceService = EasyMock.createMock(InstanceService.class);
        EasyMock.expect(instanceService.createInstance("t1", instanceSettings, false)).andReturn(null);
        EasyMock.replay(instanceService);
       
        InstancesMBean ab = new InstancesMBeanImpl(instanceService);
        assertEquals(-1, ab.createInstance("t1", 0, 0, 0, "", "", "", ""));
    }
   
    public void testGetInstances() throws Exception {      
        Instance i1 = EasyMock.createMock(Instance.class);
        EasyMock.expect(i1.getPid()).andReturn(1234);
View Full Code Here

Examples of org.apache.karaf.instance.core.internal.Instances.createInstance()

        org.apache.karaf.instance.core.InstanceService instanceService = EasyMock.createMock(org.apache.karaf.instance.core.InstanceService.class);
        EasyMock.expect(instanceService.createInstance("t1", instanceSettings, false)).andReturn(inst);
        EasyMock.replay(instanceService);
       
        Instances ab = new Instances(instanceService);
        assertEquals(42, ab.createInstance("t1", 123, 456, 789, "somewhere", "someopts", " webconsole,  funfeat", ""));
    }
   
    public void testCreateInstance2() throws Exception {
        final InstanceSettings instanceSettings = new InstanceSettings(0, 0, 0, null, null,
                Collections.<String>emptyList(), Collections.<String>emptyList());
View Full Code Here

Examples of org.apache.karaf.instance.core.internal.InstancesMBeanImpl.createInstance()

        org.apache.karaf.instance.core.InstanceService instanceService = EasyMock.createMock(org.apache.karaf.instance.core.InstanceService.class);
        EasyMock.expect(instanceService.createInstance("t1", instanceSettings, false)).andReturn(inst);
        EasyMock.replay(instanceService);
       
        InstancesMBeanImpl ab = new InstancesMBeanImpl(instanceService);
        assertEquals(42, ab.createInstance("t1", 123, 456, 789, "somewhere", "someopts", " webconsole,  funfeat", ""));
    }
   
    public void testCreateInstance2() throws Exception {
        final InstanceSettings instanceSettings = new InstanceSettings(0, 0, 0, null, null,
                Collections.<String>emptyList(), Collections.<String>emptyList());
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.