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

Examples of org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection


      // Get URI for child VM
      String vmUrn = Iterables.getOnlyElement(vApp.getChildren().getVms()).getId();

      // The method under test
      try {
         GuestCustomizationSection section = getGuestCustomizationSection.apply(vmUrn);

         // Check the retrieved object is well formed
         checkGuestCustomizationSection(section);
      } catch (Exception e) {
         Throwables.propagate(e);
View Full Code Here


   @Inject private static SectionForVApp<GuestCustomizationSection> findGuestCustomizationSectionForVApp =
         new SectionForVApp<GuestCustomizationSection>(GuestCustomizationSection.class);

   public static LoginCredentials getCredentialsFrom(Vm vm) {
      LoginCredentials.Builder builder = LoginCredentials.builder();
      GuestCustomizationSection guestCustomizationSection = findGuestCustomizationSectionForVApp.apply(vm);
      if (guestCustomizationSection != null)
         builder.password(guestCustomizationSection.getAdminPassword());
      return builder.build();
   }
View Full Code Here

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

    GuestCustomizationSection expected = getGuestCustomizationSection();

    assertEquals(api.getVmApi().getGuestCustomizationSection(vmURI), expected);
   }
View Full Code Here

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

      GuestCustomizationSection section = getGuestCustomizationSection().toBuilder()
            .build();

      Task expected = editGuestCustomizationSectionTask();

      assertEquals(api.getVmApi().editGuestCustomizationSection(vmURI, section), expected);
View Full Code Here

      return params;
   }

   public static GuestCustomizationSection getGuestCustomizationSection() {
      GuestCustomizationSection section = GuestCustomizationSection.builder()
            .build();

      return section;
   }
View Full Code Here

   }

   @Test(description = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" })
   public void testEditGuestCustomizationSection() {
      // Copy existing section and edit fields
      GuestCustomizationSection oldSection = vmApi.getGuestCustomizationSection(vmUrn);
      GuestCustomizationSection newSection = oldSection.toBuilder().computerName(name("n")).enabled(Boolean.TRUE)
               .adminPassword(null) // Not allowed
               .build();

      // The method under test
      Task editGuestCustomizationSection = vmApi.editGuestCustomizationSection(vmUrn, newSection);
      assertTrue(retryTaskSuccess.apply(editGuestCustomizationSection),
               String.format(TASK_COMPLETE_TIMELY, "editGuestCustomizationSection"));

      // Retrieve the modified section
      GuestCustomizationSection modified = vmApi.getGuestCustomizationSection(vmUrn);

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

      // Check the modified section fields are set correctly
      assertEquals(modified.getComputerName(), newSection.getComputerName());
      assertTrue(modified.isEnabled());

      // Reset the admin password in the retrieved GuestCustomizationSection for equality check
      modified = modified.toBuilder().adminPassword(null).build();

      // Check the section was modified correctly
      assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "GuestCustomizationSection"));
   }
View Full Code Here

      return params;
   }

   public static GuestCustomizationSection getGuestCustomizationSection() {
      GuestCustomizationSection section = GuestCustomizationSection.builder()
            .build();

      return section;
   }
View Full Code Here

      return params;
   }

   public static GuestCustomizationSection getGuestCustomizationSection() {
      GuestCustomizationSection section = GuestCustomizationSection.builder()
            .build();

      return section;
   }
View Full Code Here

      // Get URI for child VM
      String vmUrn = Iterables.getOnlyElement(vApp.getChildren().getVms()).getId();

      // The method under test
      try {
         GuestCustomizationSection section = getGuestCustomizationSection.apply(vmUrn);

         // Check the retrieved object is well formed
         checkGuestCustomizationSection(section);
      } catch (Exception e) {
         Throwables.propagate(e);
View Full Code Here

   @Inject private static SectionForVApp<GuestCustomizationSection> findGuestCustomizationSectionForVApp =
         new SectionForVApp<GuestCustomizationSection>(GuestCustomizationSection.class);

   public static LoginCredentials getCredentialsFrom(Vm vm) {
      LoginCredentials.Builder builder = LoginCredentials.builder();
      GuestCustomizationSection guestCustomizationSection = findGuestCustomizationSectionForVApp.apply(vm);
      if (guestCustomizationSection != null)
         builder.password(guestCustomizationSection.getAdminPassword());
      return builder.build();
   }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection

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.