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

Examples of org.jclouds.vcloud.director.v1_5.domain.dmtf.RasdItem$ConcreteBuilder


      checkUser(user);
   }
   @Test(description = "PUT /admin/user/{id}", dependsOnMethods = { "testGetUser" })
   public void testEditUser() {
      User oldUser = user.toBuilder().build();
      User newUser = user.toBuilder()
         .fullName("new"+oldUser.getFullName())
         .emailAddress("new"+oldUser.getEmailAddress())
         .telephone("1-"+oldUser.getTelephone())
         .isEnabled(true)
         .im("new"+oldUser.getIM())
         .isAlertEnabled(true)
         .alertEmailPrefix("new"+oldUser.getAlertEmailPrefix())
         .alertEmail("new"+oldUser.getAlertEmail())
         .storedVmQuota(1)
         .deployedVmQuota(1)
         .password("newPassword")
         // TODO test setting other fields?
//         .name("new"+oldUser.getName())
         .role(getRoleReferenceFor(DefaultRoles.AUTHOR.value()))
         .build();
     
      userApi.edit(user.getHref(), newUser);
      user = userApi.get(user.getHref());
     
      checkUser(user);
      assertTrue(equal(user.getFullName(), newUser.getFullName()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "fullName"));
      assertTrue(equal(user.getEmailAddress(), newUser.getEmailAddress()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "emailAddress"));
      assertTrue(equal(user.getTelephone(), newUser.getTelephone()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "telephone"));
      assertTrue(equal(user.isEnabled(), newUser.isEnabled()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "isEnabled"));
      assertTrue(equal(user.getIM(), newUser.getIM()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "im"));
      assertTrue(equal(user.isAlertEnabled(), newUser.isAlertEnabled()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "isAlertEnabled"));
      assertTrue(equal(user.getAlertEmailPrefix(), newUser.getAlertEmailPrefix()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "alertEmailPrefix"));
      assertTrue(equal(user.getAlertEmail(), newUser.getAlertEmail()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "alertEmail"));
//         assertTrue(equal(user.getRole(), newUser.getRole()),
//               String.format(OBJ_FIELD_UPDATABLE, USER, "role"));
      assertTrue(equal(user.getStoredVmQuota(), newUser.getStoredVmQuota()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "storedVmQuota"));
      assertTrue(equal(user.getDeployedVmQuota(), newUser.getDeployedVmQuota()),
            String.format(OBJ_FIELD_UPDATABLE, USER, "deployedVmQuota"));
          
      // session api isn't typically exposed to the user, as it is implicit
      SessionApi sessionApi = context.utils().injector().getInstance(SessionApi.class);
View Full Code Here


   }
   @Test(description = "DELETE /admin/user/{id}", dependsOnMethods = { "testAddUser" })
   public void testRemoveUser() {
      // Create a user to be removed (so we remove dependencies on test ordering)
      User newUser = randomTestUser("testRemoveUser"+getTestDateTimeStamp());
      User userToBeDeleted = userApi.addUserToOrg(newUser, org.getId());

      // Delete the user
      userApi.remove(userToBeDeleted.getHref());

      // Confirm cannot no longer be accessed
      User removed = userApi.get(userToBeDeleted.getHref());
      assertNull(removed);
   }
View Full Code Here

      cleanUpVAppTemplateInOrg();
   }

   @Test(description = "GET /query")
   public void testQuery() {
      VAppTemplate vAppTemplate = lazyGetVAppTemplate();
      QueryResultRecords queryResult = queryApi
               .query("vAppTemplate", String.format("name==%s", vAppTemplate.getName()));
      Set<URI> hrefs = toHrefs(queryResult);

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null),
               QueryResultVAppTemplateRecord.class);
      assertTrue(hrefs.contains(vAppTemplate.getHref()), "VAppTemplates query result should include vAppTemplate "
               + vAppTemplate.getHref() + "; but only has " + hrefs);
   }
View Full Code Here

               + lazyGetVAppTemplate().getHref() + "; but only has " + hrefs);
   }

   @Test(description = "GET /vAppTemplates/query?filter")
   public void testQueryVAppTemplatesWithFilter() {
      VAppTemplate vAppTemplate = lazyGetVAppTemplate();
      QueryResultRecords queryResult = queryApi.vAppTemplatesQuery(String.format("name==%s", vAppTemplate.getName()));
      Set<URI> hrefs = toHrefs(queryResult);

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null),
               QueryResultVAppTemplateRecord.class);
      assertTrue(hrefs.contains(vAppTemplate.getHref()), "VAppTemplates query result should have found vAppTemplate "
               + vAppTemplate.getHref());
   }
View Full Code Here

      return task;
   }

   public static RasdItem getVirtualHardwareSectionCpu() {
      RasdItem cpu = RasdItem.builder()
            .build();

      return cpu;
   }
View Full Code Here

      return media;
   }

   public static RasdItem getVirtualHardwareSectionMemory() {
      RasdItem memory = RasdItem.builder()
            .build();

      return memory;
   }
View Full Code Here

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

      RasdItem expected = getVirtualHardwareSectionCpu();

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

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

      RasdItem cpu = getVirtualHardwareSectionCpu(); // .toBuilder();
//               .build();

         Task expected = editVirtualHardwareSectionCpuTask();

         assertEquals(api.getVmApi().editVirtualHardwareSectionCpu(vmURI, cpu), expected);
View Full Code Here

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

      RasdItem expected = getVirtualHardwareSectionMemory();

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

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

      RasdItem memory = getVirtualHardwareSectionCpu(); // .toBuilder();
//               .build();

         Task expected = editVirtualHardwareSectionMemoryTask();

         assertEquals(api.getVmApi().editVirtualHardwareSectionMemory(vmURI, memory), expected);
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.domain.dmtf.RasdItem$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.