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

Examples of org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection.toBuilder()


         catalogApi.setOwner(catalog.getId(), newOwner);
         owner = catalogApi.getOwner(catalog.getId());
         Checks.checkOwner(owner);
         assertTrue(
                  equal(owner.toBuilder().links(ImmutableSet.<Link> of()).build(),
                           newOwner.toBuilder().user(newOwner.getUser()).build()),
                  String.format(OBJ_FIELD_UPDATABLE, CATALOG, "owner"));
      } finally {
         catalogApi.setOwner(catalog.getId(), oldOwner);
         owner = catalogApi.getOwner(catalog.getId());
         adminContext.getApi().getUserApi().remove(newOwnerUser.getHref());
View Full Code Here


   @Test(description = "GET /media/{id}/owner", dependsOnMethods = { "testGetMedia" })
   public void testGetMediaOwner() {
      Owner directOwner = mediaApi.getOwner(media.getId());
      assertEquals(owner.toBuilder().user(owner.getUser()).build(),
               directOwner.toBuilder().links(ImmutableSet.<Link> of()).build(), String.format(
                        GETTER_RETURNS_SAME_OBJ, "getOwner()", "owner", "media.getOwner()", owner.toString(),
                        directOwner.toString()));

      // parent type
      Checks.checkResource(directOwner);
View Full Code Here

         catalogApi.setOwner(catalog.getId(), newOwner);
         owner = catalogApi.getOwner(catalog.getId());
         Checks.checkOwner(owner);
         assertTrue(
                  equal(owner.toBuilder().links(ImmutableSet.<Link> of()).build(),
                           newOwner.toBuilder().user(newOwner.getUser()).build()),
                  String.format(OBJ_FIELD_UPDATABLE, CATALOG, "owner"));
      } finally {
         catalogApi.setOwner(catalog.getId(), oldOwner);
         owner = catalogApi.getOwner(catalog.getId());
         adminContext.getApi().getUserApi().remove(newOwnerUser.getHref());
View Full Code Here

   @Test(description = "GET /media/{id}/owner", dependsOnMethods = { "testGetMedia" })
   public void testGetMediaOwner() {
      Owner directOwner = mediaApi.getOwner(media.getId());
      assertEquals(owner.toBuilder().user(owner.getUser()).build(),
               directOwner.toBuilder().links(ImmutableSet.<Link> of()).build(), String.format(
                        GETTER_RETURNS_SAME_OBJ, "getOwner()", "owner", "media.getOwner()", owner.toString(),
                        directOwner.toString()));

      // parent type
      Checks.checkResource(directOwner);
View Full Code Here

   @Test(description = "GET /media/{id}/owner", dependsOnMethods = { "testGetMedia" })
   public void testGetMediaOwner() {
      Owner directOwner = mediaApi.getOwner(media.getId());
      assertEquals(owner.toBuilder().user(owner.getUser()).build(),
               directOwner.toBuilder().links(ImmutableSet.<Link> of()).build(), String.format(
                        GETTER_RETURNS_SAME_OBJ, "getOwner()", "owner", "media.getOwner()", owner.toString(),
                        directOwner.toString()));

      // parent type
      Checks.checkResource(directOwner);
View Full Code Here

      assertNotNull(settings);

      // Adjust account settings so we can lock the account - be careful to not set invalidLoginsBeforeLockout too low!
      if (!settings.isAccountLockoutEnabled()) {
         settingsToRevertTo = settings;
         settings = settings.toBuilder().accountLockoutEnabled(true).invalidLoginsBeforeLockout(5).build();
         settings = adminOrgApi.editPasswordPolicy(org.getId(), settings);
      }

      assertTrue(settings.isAccountLockoutEnabled());
     
View Full Code Here

      assertNotNull(settings);

      // Adjust account settings so we can lock the account - be careful to not set invalidLoginsBeforeLockout too low!
      if (!settings.isAccountLockoutEnabled()) {
         settingsToRevertTo = settings;
         settings = settings.toBuilder().accountLockoutEnabled(true).invalidLoginsBeforeLockout(5).build();
         settings = adminOrgApi.editPasswordPolicy(org.getId(), settings);
      }

      assertTrue(settings.isAccountLockoutEnabled());
     
View Full Code Here

      // 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

      // 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

                  dateService.iso8601DateFormat(modified.getStorageLeaseExpiration()),
                  dateService.iso8601DateFormat(newSection.getStorageLeaseExpiration())));
      }

      // Reset the date fields
      modified = modified.toBuilder().deploymentLeaseExpiration(null).storageLeaseExpiration(null).build();
      newSection = newSection.toBuilder().deploymentLeaseExpiration(null).storageLeaseExpiration(null).build();

      // Check the section was modified correctly
      assertEquals(
               modified.getDeploymentLeaseInSeconds(),
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.