コード例 #1
0
  @Test
  public void testWaitForVirtualMachineToBeExpunged() {
    VirtualMachine virtualMachine = VirtualMachine.builder().id("229").build();
    expect(virtualMachineClient.getVirtualMachine(virtualMachine.getId())).andReturn(null);

    replay(client, virtualMachineClient);
    assertTrue(new VirtualMachineExpunged(client).apply(virtualMachine));
    verify(client, virtualMachineClient);
  }
コード例 #2
0
  @Test
  public void testNoRemovedYet() {
    VirtualMachine virtualMachine = VirtualMachine.builder().id("229").build();
    expect(virtualMachineClient.getVirtualMachine(virtualMachine.getId()))
        .andReturn(virtualMachine);

    replay(client, virtualMachineClient);
    assertFalse(new VirtualMachineExpunged(client).apply(virtualMachine));
    verify(client, virtualMachineClient);
  }
コード例 #3
0
 @Override
 @Unwrap(depth = 2)
 public Set<VirtualMachine> expected() {
   return ImmutableSet.of(
       VirtualMachine.builder()
           .id(54)
           .name("i-3-54-VM")
           .displayName("i-3-54-VM")
           .account("adrian")
           .domainId(1)
           .domain("ROOT")
           .created(
               new SimpleDateFormatDateService()
                   .iso8601SecondsDateParse("2011-02-16T14:28:37-0800"))
           .state(VirtualMachine.State.STARTING)
           .isHAEnabled(false)
           .zoneId(1)
           .zoneName("San Jose 1")
           .templateId(2)
           .templateName("CentOS 5.3(64-bit) no GUI (XenServer)")
           .templateDisplayText("CentOS 5.3(64-bit) no GUI (XenServer)")
           .passwordEnabled(false)
           .serviceOfferingId(1)
           .serviceOfferingName("Small Instance")
           .cpuCount(1)
           .cpuSpeed(500)
           .memory(512)
           .guestOSId(11)
           .rootDeviceId(0)
           .rootDeviceType("NetworkFilesystem")
           .jobId(63l)
           .jobStatus(0)
           .nics(
               ImmutableSet.of(
                   NIC.builder()
                       .id(72)
                       .networkId(204)
                       .netmask("255.255.255.0")
                       .gateway("10.1.1.1")
                       .IPAddress("10.1.1.18")
                       .trafficType(TrafficType.GUEST)
                       .guestIPType(GuestIPType.VIRTUAL)
                       .isDefault(true)
                       .build()))
           .hypervisor("XenServer")
           .build());
 }