From 683b26d876303c76b08355aba6f9380449e6b214 Mon Sep 17 00:00:00 2001 From: Mattias Holmqvist Date: Tue, 27 Dec 2011 07:31:55 +0100 Subject: [PATCH] Fixed broken test in VirtualBox. --- .../StartVBoxIfNotAlreadyRunningTest.java | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/sandbox-apis/virtualbox/src/test/java/org/jclouds/virtualbox/functions/admin/StartVBoxIfNotAlreadyRunningTest.java b/sandbox-apis/virtualbox/src/test/java/org/jclouds/virtualbox/functions/admin/StartVBoxIfNotAlreadyRunningTest.java index 00506d22b1..6328cf164b 100644 --- a/sandbox-apis/virtualbox/src/test/java/org/jclouds/virtualbox/functions/admin/StartVBoxIfNotAlreadyRunningTest.java +++ b/sandbox-apis/virtualbox/src/test/java/org/jclouds/virtualbox/functions/admin/StartVBoxIfNotAlreadyRunningTest.java @@ -19,30 +19,28 @@ package org.jclouds.virtualbox.functions.admin; -import static org.easymock.EasyMock.expect; -import static org.easymock.classextension.EasyMock.createMock; -import static org.easymock.classextension.EasyMock.replay; -import static org.easymock.classextension.EasyMock.verify; -import static org.testng.Assert.assertEquals; - -import java.net.URI; - +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; +import com.google.inject.AbstractModule; +import com.google.inject.Module; import org.jclouds.compute.ComputeService; import org.jclouds.compute.ComputeServiceContextFactory; import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.domain.Credentials; +import org.jclouds.domain.LoginCredentials; import org.jclouds.net.IPSocket; import org.jclouds.ssh.ConfiguresSshClient; import org.jclouds.ssh.SshClient; import org.testng.annotations.Test; import org.virtualbox_4_1.VirtualBoxManager; -import com.google.common.base.Predicate; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; -import com.google.inject.AbstractModule; -import com.google.inject.Module; +import java.net.URI; + +import static org.easymock.EasyMock.expect; +import static org.easymock.classextension.EasyMock.*; +import static org.testng.Assert.assertEquals; @Test(groups = "unit", singleThreaded = true, testName = "StartVBoxIfNotAlreadyRunningTest") public class StartVBoxIfNotAlreadyRunningTest { @@ -112,11 +110,11 @@ public class StartVBoxIfNotAlreadyRunningTest { // these values. Right now, it is node 2 since the above test made node // 1. IPSocket expectedSshSockectFor2ndCreatedNode = new IPSocket("144.175.1.2", 22); - Credentials expectedCredentialsFor2ndCreatedNode = new Credentials("root", "password2"); - expect(factory.create(expectedSshSockectFor2ndCreatedNode, expectedCredentialsFor2ndCreatedNode)).andReturn( + LoginCredentials loginCredentials = new LoginCredentials("root", "password2", null, false); + expect(factory.create(expectedSshSockectFor2ndCreatedNode, loginCredentials)).andReturn( client).times(2); - expect(client.getUsername()).andReturn(expectedCredentialsFor2ndCreatedNode.identity).times(2); + expect(client.getUsername()).andReturn(loginCredentials.identity).times(2); expect(client.getHostAddress()).andReturn(expectedSshSockectFor2ndCreatedNode.getAddress()).times(2); client.disconnect();