Package org.jclouds.virtualbox.domain

Examples of org.jclouds.virtualbox.domain.ErrorCode


      HardDisk hardDisk = HardDisk.builder().diskpath(path).controllerPort(0).deviceSlot(0).build();
      try {
         new CreateMediumIfNotAlreadyExists(manager, machineUtils, true).apply(hardDisk);
         fail();
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         assertEquals(errorCode, ErrorCode.VBOX_E_FILE_ERROR);
      }
   }
View Full Code Here


      try {
         Injector injector = view.utils().injector();
         injector.getInstance(CreateAndRegisterMachineFromIsoIfNotAlreadyExists.class).apply(machineSpec);
         fail();
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         // According to the documentation VBOX_E_OBJECT_NOT_FOUND
         // if osTypeId is not found.
         assertEquals(errorCode, ErrorCode.VBOX_E_OBJECT_NOT_FOUND);
      }
      undoVm(vmName);
View Full Code Here

      try {
         final IProgress progress = machine
                 .launchVMProcess(session, type.stringValue(), environment);
         progress.waitForCompletion(-1);
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         switch (errorCode) {
            case VBOX_E_INVALID_OBJECT_STATE:
               logger.warn(e, "Could not start machine. Got error code %s from launchMachine(). "
                       + "The machine might already be running.", errorCode);
               break;
View Full Code Here

      try {
         Injector injector = view.utils().injector();
         injector.getInstance(CreateAndRegisterMachineFromIsoIfNotAlreadyExists.class).apply(machineSpec);
         fail();
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         // According to the documentation VBOX_E_OBJECT_NOT_FOUND
         // if osTypeId is not found.
         assertEquals(errorCode, ErrorCode.VBOX_E_OBJECT_NOT_FOUND);
      }
      undoVm(vmName);
View Full Code Here

      HardDisk hardDisk = HardDisk.builder().diskpath(path).controllerPort(0).deviceSlot(0).build();
      try {
         new CreateMediumIfNotAlreadyExists(manager, machineUtils, true).apply(hardDisk);
         fail();
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         assertEquals(errorCode, ErrorCode.VBOX_E_FILE_ERROR);
      }
   }
View Full Code Here

      try {
         final IProgress progress = machine
                 .launchVMProcess(session, type.stringValue(), environment);
         progress.waitForCompletion(-1);
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         switch (errorCode) {
            case VBOX_E_INVALID_OBJECT_STATE:
               logger.warn(e, "Could not start machine. Got error code %s from launchMachine(). "
                       + "The machine might already be running.", errorCode);
               break;
View Full Code Here

   public Void apply(IMachine machine) {
      List<IMedium> mediaToBeDeleted = ImmutableList.of();
      try {
         mediaToBeDeleted = machine.unregister(CleanupMode.Full);
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         switch (errorCode) {
            case VBOX_E_OBJECT_NOT_FOUND:
               logger.debug("Machine %s does not exists, cannot unregister", machine.getName());
               break;
            default:
View Full Code Here

   public Void apply(IMachine machine) {
      List<IMedium> mediaToBeDeleted = ImmutableList.of();
      try {
         mediaToBeDeleted = machine.unregister(vmSpec.getCleanupMode());
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         switch (errorCode) {
            case VBOX_E_OBJECT_NOT_FOUND:
               logger.debug("Machine %s does not exists, cannot unregister", vmSpec.getVmName());
               break;
            default:
View Full Code Here

TOP

Related Classes of org.jclouds.virtualbox.domain.ErrorCode

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.