Package org.jclouds.vcloud.director.v1_5.domain

Examples of org.jclouds.vcloud.director.v1_5.domain.ProductSectionList$ConcreteBuilder


   }

   @Test(groups = { "live", "user" }, description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" })
   public void testGetProductSections() {
      // The method under test
      ProductSectionList sectionList = vAppApi.getProductSections(vAppUrn);

      // Check the retrieved object is well formed
      checkProductSectionList(sectionList);
   }
View Full Code Here


   }

   @Test(groups = { "live", "user" }, description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
   public void testEditProductSections() {
      // Copy existing section and edit fields
      ProductSectionList oldSections = vAppApi.getProductSections(vAppUrn);
      ProductSectionList newSections = oldSections
               .toBuilder()
               .productSection(
                        ProductSection.builder().info("Information about the installed software")
                                 // Default ovf:Info text
                                 .required().product(MsgType.builder().value("jclouds").build())
                                 .vendor(MsgType.builder().value("jclouds Inc.").build())
                                 // NOTE other ProductSection elements not returned by vCloud
                                 .build()).build();

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

      // Retrieve the modified section
      ProductSectionList modified = vAppApi.getProductSections(vAppUrn);

      // Check the retrieved object is well formed
      checkProductSectionList(modified);

      // Check the modified object has an extra ProductSection
      assertEquals(modified.getProductSections().size(), oldSections.getProductSections().size() + 1);

      // Check the section was modified correctly
      assertEquals(modified, newSections);
   }
View Full Code Here

      return task;
   }

   public static ProductSectionList getProductSections() {
      ProductSectionList sectionItems = ProductSectionList.builder()
            .build();

      return sectionItems;
   }
View Full Code Here

      // session api isn't typically exposed to the user, as it is implicit
      SessionApi sessionApi = context.utils().injector().getInstance(SessionApi.class);

      // Check the user can really login with the changed password
      // NOTE: the password is NOT returned in the User object returned from the server
      SessionWithToken sessionWithToken = sessionApi.loginUserInOrgWithPassword(URI.create(endpoint + "/sessions"), user.getName(), org.getName(), "newPassword");
      assertNotNull(sessionWithToken.getToken());
      sessionApi.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken());
   }
View Full Code Here

      user = userApi.get(user.getHref());
      assertFalse(user.isLocked());

      // Double-check the user can now login again
      SessionWithToken sessionWithToken = sessionApi.loginUserInOrgWithPassword(URI.create(endpoint + "/sessions"), user.getName(), org.getName(), "newPassword");
      assertNotNull(sessionWithToken.getToken());
      sessionApi.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken());
     
      // Return account settings to the previous values, if necessary
      if (settingsToRevertTo != null) {
         adminOrgApi.editPasswordPolicy(org.getId(), settingsToRevertTo);
      }
View Full Code Here

  }

   @Test(description = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" })
   public void testQueryAllVms() {
      // Wait for vApp to have been entirely instantiated
      Task instantiateTask = Iterables.getFirst(vApp.getTasks(), null);
      if (instantiateTask != null) {
         assertTaskSucceedsLong(instantiateTask);
      }

      // Start the vApp so that it has VMs
      Task task = vAppApi.powerOn(vApp.getId());
      assertTaskSucceedsLong(task);

      vApp = vAppApi.get(vApp.getId()); // reload, so it has the VMs
      List<Vm> vms = vApp.getChildren().getVms();
      Set<URI> vmHrefs = toHrefs(vms);
View Full Code Here

   @AfterClass(alwaysRun = true)
   public void cleanUp() throws Exception {
      if (metadataKey != null) {
         try {
            Task task = metadataApi.remove(metadataKey);
            taskDoneEventually(task);
         } catch (VCloudDirectorException e) {
            logger.warn(e, "Error deleting metadata-value (perhaps it doesn't exist?); continuing...");
         }
      }
View Full Code Here

      Exception exception = null;

      AdminVdc vdc = AdminVdc.builder().name(newName).build();

      try {
         Task task = vdcApi.edit(vdcUrn, vdc);
         assertTaskSucceeds(task);

         AdminVdc modified = vdcApi.get(vdcUrn);
         assertEquals(modified.getName(), newName);

         // parent type
         Checks.checkAdminVdc(vdc);
      } catch (Exception e) {
         exception = e;
      } finally {
         try {
            AdminVdc restorableVdc = AdminVdc.builder().name(origName).build();
            Task task = vdcApi.edit(vdcUrn, restorableVdc);
            assertTaskSucceeds(task);
         } catch (Exception e) {
            if (exception != null) {
               logger.warn(e, "Error resetting adminVdc.name; rethrowing original test exception...");
               throw exception;
View Full Code Here

   // TODO insufficient permissions to test
   @Test(description = "DELETE /admin/vdc/{id}", enabled = false)
   public void testRemoveVdc() throws Exception {
      // TODO Need to have a VDC that we're happy to remove!
      Task task = vdcApi.remove(vdcUrn);
      assertTaskSucceeds(task);

      try {
         vdcApi.get(vdcUrn);
      } catch (VCloudDirectorException e) {
View Full Code Here

   @Test(description = "PUT /admin/vdc/{id}/metadata", enabled = false)
   public void testSetMetadata() throws Exception {
      metadataKey = name("key-");
      metadataValue = name("value-");

      Task task = metadataApi.putAll(ImmutableMap.of(metadataKey, metadataValue));
     
      assertTaskSucceeds(task);

      String modified = metadataApi.get(metadataKey);
      assertEquals(modified, metadataValue);
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.domain.ProductSectionList$ConcreteBuilder

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.