Renamed IsoToIMachine to CreateAndInstallVm.

This commit is contained in:
Mattias Holmqvist 2011-12-15 22:51:47 +01:00
parent 9965d76e91
commit 5a2d2303a7
4 changed files with 10 additions and 10 deletions

View File

@ -47,7 +47,7 @@ import static org.jclouds.virtualbox.util.MachineUtils.*;
import static org.virtualbox_4_1.LockType.Shared; import static org.virtualbox_4_1.LockType.Shared;
import static org.virtualbox_4_1.LockType.Write; import static org.virtualbox_4_1.LockType.Write;
public class IsoToIMachine implements Function<VmSpec, IMachine> { public class CreateAndInstallVm implements Function<VmSpec, IMachine> {
@Resource @Resource
@Named(ComputeServiceConstants.COMPUTE_LOGGER) @Named(ComputeServiceConstants.COMPUTE_LOGGER)
@ -63,9 +63,9 @@ public class IsoToIMachine implements Function<VmSpec, IMachine> {
private final ExecutionType executionType; private final ExecutionType executionType;
@Inject @Inject
public IsoToIMachine(VirtualBoxManager manager, String guestId, ComputeServiceContext context, public CreateAndInstallVm(VirtualBoxManager manager, String guestId, ComputeServiceContext context,
String hostId, Predicate<IPSocket> socketTester, String hostId, Predicate<IPSocket> socketTester,
String webServerHost, int webServerPort, ExecutionType executionType) { String webServerHost, int webServerPort, ExecutionType executionType) {
this.manager = manager; this.manager = manager;
this.guestId = guestId; this.guestId = guestId;
this.context = context; this.context = context;

View File

@ -91,7 +91,7 @@ public class CloneAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest extends Ba
VmSpec vmSpecification = VmSpec.builder().id(vmId).name(vmName).osTypeId(osTypeId) VmSpec vmSpecification = VmSpec.builder().id(vmId).name(vmName).osTypeId(osTypeId)
.controller(ideController) .controller(ideController)
.forceOverwrite(true).build(); .forceOverwrite(true).build();
return new IsoToIMachine(manager, guestId, localHostContext, hostId, socketTester, return new CreateAndInstallVm(manager, guestId, localHostContext, hostId, socketTester,
"127.0.0.1", 8080, HEADLESS).apply(vmSpecification); "127.0.0.1", 8080, HEADLESS).apply(vmSpecification);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
// already created // already created

View File

@ -56,8 +56,8 @@ import static org.testng.Assert.assertTrue;
/** /**
* @author Andrea Turli, Mattias Holmqvist * @author Andrea Turli, Mattias Holmqvist
*/ */
@Test(groups = "live", singleThreaded = true, testName = "IsoToIMachineLiveTest") @Test(groups = "live", singleThreaded = true, testName = "CreateAndInstallVmLiveTest")
public class IsoToIMachineLiveTest extends BaseVirtualBoxClientLiveTest { public class CreateAndInstallVmLiveTest extends BaseVirtualBoxClientLiveTest {
Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() { Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
}.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule()) }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
@ -94,7 +94,7 @@ public class IsoToIMachineLiveTest extends BaseVirtualBoxClientLiveTest {
.controller(ideController) .controller(ideController)
.forceOverwrite(true) .forceOverwrite(true)
.natNetworkAdapter(0, NatAdapter.builder().tcpRedirectRule("127.0.0.1", 2222, "", 22).build()).build(); .natNetworkAdapter(0, NatAdapter.builder().tcpRedirectRule("127.0.0.1", 2222, "", 22).build()).build();
IMachine imageMachine = new IsoToIMachine(manager, guestId, localHostContext, hostId, IMachine imageMachine = new CreateAndInstallVm(manager, guestId, localHostContext, hostId,
socketTester, "127.0.0.1", 8080, HEADLESS) socketTester, "127.0.0.1", 8080, HEADLESS)
.apply(vmSpecification); .apply(vmSpecification);

View File

@ -11,7 +11,7 @@ import org.jclouds.virtualbox.BaseVirtualBoxClientLiveTest;
import org.jclouds.virtualbox.domain.ExecutionType; import org.jclouds.virtualbox.domain.ExecutionType;
import org.jclouds.virtualbox.domain.StorageController; import org.jclouds.virtualbox.domain.StorageController;
import org.jclouds.virtualbox.domain.VmSpec; import org.jclouds.virtualbox.domain.VmSpec;
import org.jclouds.virtualbox.functions.IsoToIMachine; import org.jclouds.virtualbox.functions.CreateAndInstallVm;
import org.jclouds.virtualbox.functions.LaunchMachineIfNotAlreadyRunning; import org.jclouds.virtualbox.functions.LaunchMachineIfNotAlreadyRunning;
import org.jclouds.virtualbox.util.PropertyUtils; import org.jclouds.virtualbox.util.PropertyUtils;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -74,7 +74,7 @@ public class SshAvailableLiveTest extends BaseVirtualBoxClientLiveTest {
.controller(ideController) .controller(ideController)
.forceOverwrite(true).build(); .forceOverwrite(true).build();
return new IsoToIMachine(manager, guestId, localHostContext, return new CreateAndInstallVm(manager, guestId, localHostContext,
hostId, socketTester, "127.0.0.1", 8080, HEADLESS).apply(vmSpecification); hostId, socketTester, "127.0.0.1", 8080, HEADLESS).apply(vmSpecification);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
// already created // already created