Package org.jclouds.abiquo.domain.task

Examples of org.jclouds.abiquo.domain.task.AsyncTask


   public void testUpdateVolume() {
      Volume volume = env.virtualDatacenter.findVolume(VolumePredicates.name(PREFIX + "Hawaian volume"));
      assertNotNull(volume);

      volume.setName("Hawaian volume updated");
      AsyncTask task = volume.update();
      assertNull(task);

      // Reload the volume to check
      Volume updated = env.virtualDatacenter.getVolume(volume.getId());
      assertEquals(updated.getName(), "Hawaian volume updated");
View Full Code Here


   }

   @Test(dependsOnMethods = "testCreateVirtualMachine")
   public void testUpdateVirtualMachineWhenNotDeployed() {
      vm.setNameLabel(PREFIX + "VM Kane Updated");
      AsyncTask task = vm.update();
      assertNull(task);

      VirtualMachine updated = vapp.findVirtualMachine(VirtualMachinePredicates.nameLabel(PREFIX + "VM Kane Updated"));
      assertNotNull(updated);
   }
View Full Code Here

      assertNotNull(updated);
   }

   @Test(dependsOnMethods = "testUpdateVirtualMachineWhenNotDeployed")
   public void testDeployVirtualMachine() {
      AsyncTask task = vm.deploy(true);
      assertNotNull(task);

      monitoringService.getVirtualMachineMonitor().awaitCompletionDeploy(MAX_WAIT, TimeUnit.MINUTES, vm);
      assertEquals(vm.getState(), VirtualMachineState.ON);
   }
View Full Code Here

      assertEquals(vm.getState(), VirtualMachineState.ON);
   }

   @Test(dependsOnMethods = "testDeployVirtualMachine")
   public void testChangeVirtualMachineState() {
      AsyncTask task = vm.changeState(VirtualMachineState.OFF);
      assertNotNull(task);

      monitoringService.getVirtualMachineMonitor().awaitState(MAX_WAIT, TimeUnit.MINUTES, VirtualMachineState.OFF, vm);
      assertEquals(vm.getState(), VirtualMachineState.OFF);
   }
View Full Code Here

   @Test(dependsOnMethods = "testChangeVirtualMachineState")
   public void testReconfigure() {
      Ip<?, ?> ip = getLast(vdc.getDefaultNetwork().listUnusedIps());

      AsyncTask task = vm.setNics(Lists.<Ip<?, ?>> newArrayList(ip));
      assertNotNull(task);

      monitoringService.getVirtualMachineMonitor().awaitState(MAX_WAIT, TimeUnit.MINUTES, VirtualMachineState.OFF, vm);
      assertNotNull(vm.findAttachedNic(IpPredicates.address(ip.getIp())));
   }
View Full Code Here

      assertNotNull(vm.findAttachedNic(IpPredicates.address(ip.getIp())));
   }

   @Test(dependsOnMethods = "testReconfigure")
   public void testUndeployVirtualMachine() {
      AsyncTask task = vm.undeploy();
      assertNotNull(task);

      monitoringService.getVirtualMachineMonitor().awaitCompletionUndeploy(MAX_WAIT, TimeUnit.MINUTES, vm);
      assertEquals(vm.getState(), VirtualMachineState.NOT_ALLOCATED);
   }
View Full Code Here

         vm.setCpu(vdc.getCpuCountHardLimit() + 1);
      } else if (ent.getCpuCountHardLimit() != 0) {
         vm.setCpu(ent.getCpuCountHardLimit() + 1);
      }

      AsyncTask task = vm.update();
      assertNull(task);

      try {
         vm.deploy(true);
         fail("Deployments over the hard limits should not be allowed");
View Full Code Here

   public void testAttachVolumes() {
      volume = createVolume();

      // Since the virtual machine is not deployed, this should not generate a
      // task
      AsyncTask task = env.virtualMachine.attachVolumes(volume);
      assertNull(task);

      List<Volume> attached = env.virtualMachine.listAttachedVolumes();
      assertEquals(attached.size(), 1);
      assertEquals(attached.get(0).getId(), volume.getId());
View Full Code Here

   @Test(dependsOnMethods = "detachVolume")
   public void detachAllVolumes() {
      // Since the virtual machine is not deployed, this should not generate a
      // task
      AsyncTask task = env.virtualMachine.attachVolumes(volume);
      assertNull(task);

      env.virtualMachine.detachAllVolumes();
      List<Volume> attached = env.virtualMachine.listAttachedVolumes();
      assertTrue(attached.isEmpty());
View Full Code Here

   public void testAttachHardDisks() {
      hardDisk = createHardDisk();

      // Since the virtual machine is not deployed, this should not generate a
      // task
      AsyncTask task = env.virtualMachine.attachHardDisks(hardDisk);
      assertNull(task);

      List<HardDisk> attached = env.virtualMachine.listAttachedHardDisks();
      assertEquals(attached.size(), 1);
      assertEquals(attached.get(0).getId(), hardDisk.getId());
View Full Code Here

TOP

Related Classes of org.jclouds.abiquo.domain.task.AsyncTask

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.