From 5414f7e06a047290f18859cf49ae66504369b743 Mon Sep 17 00:00:00 2001 From: Richard Downer Date: Wed, 21 Dec 2011 23:05:37 +0000 Subject: [PATCH] Clarify LoadBalancerClientLiveTest --- .../features/LoadBalancerClientLiveTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java index 123c594ecc..e9298e2f65 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java @@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit; import com.google.common.base.Predicates; import org.jclouds.cloudstack.domain.AsyncJob; +import org.jclouds.cloudstack.domain.JobResult; import org.jclouds.cloudstack.domain.LoadBalancerRule; import org.jclouds.cloudstack.domain.LoadBalancerRule.Algorithm; import org.jclouds.cloudstack.domain.LoadBalancerRule.State; @@ -121,10 +122,18 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest { public void testAssignToLoadBalancerRule() throws Exception { if (networksDisabled) return; - assertTrue(jobComplete.apply(client.getLoadBalancerClient().assignVirtualMachinesToLoadBalancerRule(rule.getId(), - vm.getId()))); - assertEquals(client.getLoadBalancerClient().listVirtualMachinesAssignedToLoadBalancerRule(rule.getId()).size(), 1); + long jobId = client.getLoadBalancerClient().assignVirtualMachinesToLoadBalancerRule(rule.getId(), + vm.getId()); + assertTrue(jobComplete.apply(jobId)); + AsyncJob result = client.getAsyncJobClient().getAsyncJob(jobId); + assertTrue(result.hasSucceed()); + Set machines = client.getLoadBalancerClient().listVirtualMachinesAssignedToLoadBalancerRule(rule.getId()); + assertEquals(machines.size(), 1); assertTrue(loadBalancerRuleActive.apply(rule), rule.toString()); + } + + @Test(dependsOnMethods = "testAssignToLoadBalancerRule") + public void testCanSshInThroughNewLoadBalancerRule() throws Exception { loopAndCheckSSH(); }