コード例 #1
0
  @Test
  public void testCdRomGet() throws Exception {
    PowerShellCdRomsResource parent =
        new PowerShellCdRomsResource(VM_ID, poolMap, resource.new CdRomQuery(VM_ID), uriProvider);
    PowerShellDeviceResource<CdRom, CdRoms> cdromResource =
        new PowerShellDeviceResource<CdRom, CdRoms>(parent, CDROM_ID);

    setUriInfo(setUpBasicUriExpectations());
    setUpCmdExpectations(GET_CDROMS_CMD, formatVm(VM_NAME));
    verifyCdRom(cdromResource.get());
  }
コード例 #2
0
  @Test
  public void testDiskGet() throws Exception {
    PowerShellDisksResource parent =
        new PowerShellDisksResource(VM_ID, poolMap, parser, "get-vm", uriProvider, httpHeaders);
    PowerShellDeviceResource<Disk, Disks> diskResource =
        new PowerShellDeviceResource<Disk, Disks>(parent, DISK_ID);

    setUriInfo(setUpBasicUriExpectations());
    setUpCmdExpectations(
        PowerShellVmsResource.getStorageDomainLookupHack(VM_ID) + GET_DISKS_CMD,
        formatDisk(DISK_NAME));
    verifyDisk(diskResource.get());
  }
コード例 #3
0
  @Test
  public void testNicGet() throws Exception {
    PowerShellNicsResource parent =
        new PowerShellNicsResource(VM_ID, poolMap, parser, "get-vm", uriProvider);
    PowerShellDeviceResource<NIC, Nics> nicResource =
        new PowerShellDeviceResource<NIC, Nics>(parent, NIC_ID);

    String[] commands = {GET_NICS_CMD, LOOKUP_NETWORK_ID_COMMAND};
    String[] returns = {formatNic(NIC_NAME), formatNetwork(NETWORK_NAME)};

    setUriInfo(setUpBasicUriExpectations());
    setUpCmdExpectations(commands, returns);

    verifyNic(nicResource.get());
  }