From 912a2f9ae08ef3756ef0a12e5dabeac7106f1dd3 Mon Sep 17 00:00:00 2001 From: andreaturli Date: Tue, 20 Dec 2011 08:30:55 +0000 Subject: [PATCH] issue 384: improve UnregisterMachineIfExistsAndDeleteItsMedia + Test, vmSpec --- .../src/main/java/org/jclouds/virtualbox/domain/VmSpec.java | 5 ++++- .../admin/UnregisterMachineIfExistsAndDeleteItsMedia.java | 5 +++-- .../UnregisterMachineIfExistsAndDeleteItsMediaTest.java | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/domain/VmSpec.java b/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/domain/VmSpec.java index 69bc56b2f3..acbc32a77b 100644 --- a/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/domain/VmSpec.java +++ b/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/domain/VmSpec.java @@ -52,6 +52,7 @@ public class VmSpec { checkArgument(memory > 0, "memory must be > 0"); checkNotNull(controllers, "controllers"); checkNotNull(natNetworkAdapters, "natNetworkAdapters"); + checkNotNull(cleanupMode, "cleanupMode"); this.vmId = vmId; this.vmName = vmName; this.osTypeId = osTypeId; @@ -170,7 +171,8 @@ public class VmSpec { Objects.equal(memory, other.memory) && Objects.equal(forceOverwrite, other.forceOverwrite) && Objects.equal(natNetworkAdapters, other.natNetworkAdapters) && - Objects.equal(controllers, other.controllers); + Objects.equal(controllers, other.controllers) && + Objects.equal(cleanupMode, other.cleanupMode); } return false; } @@ -190,6 +192,7 @@ public class VmSpec { ", forceOverwrite=" + forceOverwrite + ", natNetworkAdapters=" + natNetworkAdapters + ", controllers=" + controllers + + ", cleanupMode=" + cleanupMode + '}'; } } diff --git a/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/functions/admin/UnregisterMachineIfExistsAndDeleteItsMedia.java b/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/functions/admin/UnregisterMachineIfExistsAndDeleteItsMedia.java index adc17c4d39..9f9d48fdfe 100644 --- a/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/functions/admin/UnregisterMachineIfExistsAndDeleteItsMedia.java +++ b/sandbox-apis/virtualbox/src/main/java/org/jclouds/virtualbox/functions/admin/UnregisterMachineIfExistsAndDeleteItsMedia.java @@ -39,6 +39,7 @@ import org.virtualbox_4_1.VirtualBoxManager; import com.google.common.base.Function; import com.google.common.base.Throwables; +import com.google.common.collect.Lists; public class UnregisterMachineIfExistsAndDeleteItsMedia implements Function { @@ -48,7 +49,7 @@ public class UnregisterMachineIfExistsAndDeleteItsMedia implements Function