Package org.jclouds.trmk.vcloud_0_8.domain

Examples of org.jclouds.trmk.vcloud_0_8.domain.VApp


               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/composeVApp.xml", VCloudDirectorMediaType.VAPP)
               .httpResponseBuilder().build());
     
      VApp expected = composeVApp();

      // TODO: configure params
      ComposeVAppParams params = ComposeVAppParams.builder()
        
         .build();
View Full Code Here


               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/instantiateVAppTemplate.xml", VCloudDirectorMediaType.VAPP)
               .httpResponseBuilder().build());
     
      VApp expected = instantiateVAppTemplate();

      // TODO: configure params
      InstantiateVAppTemplateParams params = InstantiateVAppTemplateParams.builder()
        
         .build();
View Full Code Here

   }

   @Test(groups = { "live", "user" }, description = "POST /vApp/{id}/action/recomposeVApp")
   public void testRecomposeVApp() {
     
      VApp composedVApp = vdcApi.composeVApp(vdcUrn, ComposeVAppParams.builder()
               .name(name("composed-"))
               .instantiationParams(instantiationParams())
               .build());
     
      Set<Vm> vms = getAvailableVMsFromVAppTemplate(vAppTemplate);
         
      // get the first vm to be added to vApp
      Vm toAddVm = Iterables.get(vms, 0);

      // TODO clean up network config of the vm
      //cleanUpNetworkConnectionSection(toAddVm);
     
      RecomposeVAppParams params = addRecomposeParams(composedVApp, toAddVm);

      // The method under test
      Task recomposeVApp = vAppApi.recompose(composedVApp.getId(), params);
      assertTaskSucceedsLong(recomposeVApp);

      // remove a vm
      VApp configured = vAppApi.get(composedVApp.getId());
      List<Vm> vmsToBeDeleted = configured.getChildren().getVms();
      Vm toBeDeleted = Iterables.find(vmsToBeDeleted, new Predicate<Vm>() {

         @Override
         public boolean apply(Vm vm) {
            return vm.getName().startsWith("vm-");
View Full Code Here

   /**
    * @see VAppApi#edit(URI, VApp)
    */
   @Test(groups = { "live", "user" }, description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" })
   public void testEditVApp() {
      VApp newVApp = VApp.builder().name(name("new-name-")).description("New Description").build();
      vAppNames.add(newVApp.getName());

      // The method under test
      Task editVApp = vAppApi.edit(vAppUrn, newVApp);
      assertTrue(retryTaskSuccess.apply(editVApp), String.format(TASK_COMPLETE_TIMELY, "editVApp"));

      // Get the edited VApp
      vApp = vAppApi.get(vAppUrn);

      // Check the required fields are set
      assertEquals(vApp.getName(), newVApp.getName(),
               String.format(OBJ_FIELD_EQ, VAPP, "Name", newVApp.getName(), vApp.getName()));
      assertEquals(vApp.getDescription(), newVApp.getDescription(),
               String.format(OBJ_FIELD_EQ, VAPP, "Description", newVApp.getDescription(), vApp.getDescription()));
   }
View Full Code Here

    * @see VAppApi#remove(URI)
    */
   @Test(groups = { "live", "user" }, description = "DELETE /vApp/{id}")
   public void testRemoveVApp() {
      // Create a temporary VApp to remove
      VApp temp = instantiateVApp();

      // The method under test
      Task removeVApp = vAppApi.remove(temp.getId());
      assertTrue(retryTaskSuccess.apply(removeVApp), String.format(TASK_COMPLETE_TIMELY, "removeVApp"));

      VApp removed = vAppApi.get(temp.getId());
      assertNull(removed, "The VApp " + temp.getName() + " should have been removed");
   }
View Full Code Here

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vApp/vApp.xml", VCloudDirectorMediaType.VAPP)
               .httpResponseBuilder().build());

      VApp expected = getVApp();

      assertEquals(api.getVAppApi().get(vAppURI), expected);
   }
View Full Code Here

            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/modifiedVapp.xml", VCloudDirectorMediaType.VAPP)
            .httpResponseBuilder().build());

    VApp modified = getVApp();
    modified.setName("new-name");
    modified.setDescription("New Description");

    Task expected = editVAppTask();

    assertEquals(api.getVAppApi().edit(vAppURI, modified), expected);
   }
View Full Code Here

    assertEquals(api.getVAppApi().editStartupSection(vAppURI, section), expected);
   }

   public static VApp getVApp() {
      // FIXME Does not match XML
      VApp vApp = VApp.builder()
            .href(URI.create("https://mycloud.greenhousedata.com/api/vApp/vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be"))
//            .link(Link.builder()
//                     .href(URI.create())
//                     .build())
            .build();
View Full Code Here

   }

   @Test(groups = { "live", "user" }, description = "POST /vApp/{id}/action/recomposeVApp")
   public void testRecomposeVApp() {
     
      VApp composedVApp = vdcApi.composeVApp(vdcUrn, ComposeVAppParams.builder()
               .name(name("composed-"))
               .instantiationParams(instantiationParams())
               .build());
     
      Set<Vm> vms = getAvailableVMsFromVAppTemplate(vAppTemplate);
         
      // get the first vm to be added to vApp
      Vm toAddVm = Iterables.get(vms, 0);

      // TODO clean up network config of the vm
      //cleanUpNetworkConnectionSection(toAddVm);
     
      RecomposeVAppParams params = addRecomposeParams(composedVApp, toAddVm);

      // The method under test
      Task recomposeVApp = vAppApi.recompose(composedVApp.getId(), params);
      assertTaskSucceedsLong(recomposeVApp);

      // remove a vm
      VApp configured = vAppApi.get(composedVApp.getId());
      List<Vm> vmsToBeDeleted = configured.getChildren().getVms();
      Vm toBeDeleted = Iterables.find(vmsToBeDeleted, new Predicate<Vm>() {

         @Override
         public boolean apply(Vm vm) {
            return vm.getName().startsWith("vm-");
View Full Code Here

   /**
    * @see VAppApi#edit(URI, VApp)
    */
   @Test(groups = { "live", "user" }, description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" })
   public void testEditVApp() {
      VApp newVApp = VApp.builder().name(name("new-name-")).description("New Description").build();
      vAppNames.add(newVApp.getName());

      // The method under test
      Task editVApp = vAppApi.edit(vAppUrn, newVApp);
      assertTrue(retryTaskSuccess.apply(editVApp), String.format(TASK_COMPLETE_TIMELY, "editVApp"));

      // Get the edited VApp
      vApp = vAppApi.get(vAppUrn);

      // Check the required fields are set
      assertEquals(vApp.getName(), newVApp.getName(),
               String.format(OBJ_FIELD_EQ, VAPP, "Name", newVApp.getName(), vApp.getName()));
      assertEquals(vApp.getDescription(), newVApp.getDescription(),
               String.format(OBJ_FIELD_EQ, VAPP, "Description", newVApp.getDescription(), vApp.getDescription()));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.trmk.vcloud_0_8.domain.VApp

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.