コード例 #1
0
  @Test(
      description = "PUT /vApp/{id}/virtualHardwareSection/cpu",
      dependsOnMethods = {"testGetVirtualHardwareSectionCpu"})
  public void testEditVirtualHardwareSectionCpu() {
    // Copy existing section and edit fields
    RasdItem oldItem = vmApi.getVirtualHardwareSectionCpu(vmUrn);
    RasdItem newItem =
        oldItem
            .toBuilder()
            .elementName("2 virtual CPU(s)")
            .virtualQuantity(new BigInteger("2"))
            .build();

    // Method under test
    Task editVirtualHardwareSectionCpu = vmApi.editVirtualHardwareSectionCpu(vmUrn, newItem);
    assertTrue(
        retryTaskSuccess.apply(editVirtualHardwareSectionCpu),
        String.format(TASK_COMPLETE_TIMELY, "editVirtualHardwareSectionCpu"));

    // Retrieve the modified section
    RasdItem modified = vmApi.getVirtualHardwareSectionCpu(vmUrn);

    // Check the retrieved object
    checkResourceAllocationSettingData(modified);

    // Check modified item
    assertEquals(
        modified.getVirtualQuantity(),
        new BigInteger("2"),
        String.format(
            OBJ_FIELD_EQ,
            "ResourceAllocationSettingData",
            "VirtualQuantity",
            "2",
            modified.getVirtualQuantity().toString()));
    assertEquals(modified, newItem);
  }
コード例 #2
0
  public static RasdItem getVirtualHardwareSectionMemory() {
    RasdItem memory = RasdItem.builder().build();

    return memory;
  }
コード例 #3
0
  public static RasdItem getVirtualHardwareSectionCpu() {
    RasdItem cpu = RasdItem.builder().build();

    return cpu;
  }