diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java index e73df50d64..a36e097ee8 100644 --- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java +++ b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java @@ -46,7 +46,7 @@ import org.jclouds.cloudsigma.util.Servers; import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.internal.BaseComputeServiceContextLiveTest; import org.jclouds.domain.LoginCredentials; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContext; import org.jclouds.ssh.SshClient; import org.jclouds.sshj.config.SshjSshClientModule; @@ -92,7 +92,8 @@ public class CloudSigmaClientLiveTest extends BaseComputeServiceContextLiveTest client = cloudSigmaContext.getApi(); driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS); - socketTester = retry(new InetSocketAddressConnect(), maxDriveImageTime, 1, SECONDS); + SocketOpen socketOpten = context.utils().injector().getInstance(SocketOpen.class); + socketTester = retry(socketOpten, maxDriveImageTime, 1, SECONDS); if (template == null || template.getImageId() == null) { imageId = view.getComputeService().templateBuilder().build().getImage().getId(); diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/internal/BaseCloudStackClientLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/internal/BaseCloudStackClientLiveTest.java index 1bda9c5f41..5cd97be5f8 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/internal/BaseCloudStackClientLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/internal/BaseCloudStackClientLiveTest.java @@ -54,7 +54,7 @@ import org.jclouds.cloudstack.strategy.BlockUntilJobCompletesAndReturnResult; import org.jclouds.compute.ComputeService; import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.internal.BaseGenericComputeServiceContextLiveTest; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContext; import org.jclouds.ssh.SshClient; import org.jclouds.sshj.config.SshjSshClientModule; @@ -224,7 +224,8 @@ public class BaseCloudStackClientLiveTest extends BaseGenericComputeServiceConte injector = cloudStackContext.utils().injector(); sshFactory = injector.getInstance(SshClient.Factory.class); - socketTester = retry(new InetSocketAddressConnect(), 180, 1, 1, SECONDS); + SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); + socketTester = retry(socketOpen, 180, 1, 1, SECONDS); injector.injectMembers(socketTester); jobComplete = retry(new JobComplete(client), 1200, 1, 5, SECONDS); diff --git a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java index f6769be965..e723212bd2 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java @@ -43,7 +43,7 @@ import org.jclouds.elasticstack.domain.ServerStatus; import org.jclouds.elasticstack.predicates.DriveClaimed; import org.jclouds.elasticstack.util.Servers; import org.jclouds.io.Payloads; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContext; import org.jclouds.ssh.SshClient; import org.jclouds.sshj.config.SshjSshClientModule; @@ -89,7 +89,8 @@ public class ElasticStackClientLiveTest extends BaseComputeServiceContextLiveTes client = view.unwrap(ElasticStackApiMetadata.CONTEXT_TOKEN).getApi(); driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS); - socketTester = retry(new InetSocketAddressConnect(), maxDriveImageTime, 1, SECONDS); + SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); + socketTester = retry(socketOpen, maxDriveImageTime, 1, SECONDS); } @Test diff --git a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BaseTerremarkClientLiveTest.java b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BaseTerremarkClientLiveTest.java index 25fd5e9f50..95ce36e4ad 100644 --- a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BaseTerremarkClientLiveTest.java +++ b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BaseTerremarkClientLiveTest.java @@ -23,7 +23,7 @@ import static org.jclouds.util.Predicates2.retry; import org.jclouds.compute.ComputeService; import org.jclouds.compute.internal.BaseComputeServiceContextLiveTest; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContext; import org.jclouds.ssh.SshClient.Factory; import org.jclouds.sshj.config.SshjSshClientModule; @@ -62,7 +62,8 @@ public abstract class BaseTerremarkClientLiveTest() { public boolean apply(Machine input) { return api.get(input.getId()).getState() == Machine.State.RUNNING; diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java index 0aa0d900f6..dcd0d1236e 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java @@ -29,7 +29,7 @@ import static org.testng.Assert.assertTrue; import java.util.logging.Logger; import org.jclouds.collect.IterableWithMarker; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.rds.domain.Authorization; import org.jclouds.rds.domain.Authorization.Status; import org.jclouds.rds.domain.Instance; @@ -64,7 +64,8 @@ public class InstanceApiLiveTest extends BaseRDSApiLiveTest { public void setupContext() { super.setupContext(); securityGroup = createSecurityGroupAndAuthorizeIngressToAll(INSTANCE); - socketTester = retry(new InetSocketAddressConnect(), 180, 1, 1, SECONDS); + SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); + socketTester = retry(socketOpen, 180, 1, 1, SECONDS); instanceAvailable = retry(new Predicate() { public boolean apply(Instance input) { return api().get(input.getId()).getStatus() == Instance.Status.AVAILABLE; diff --git a/labs/savvis-symphonyvpdc/src/test/java/org/jclouds/savvis/vpdc/features/VMApiLiveTest.java b/labs/savvis-symphonyvpdc/src/test/java/org/jclouds/savvis/vpdc/features/VMApiLiveTest.java index 3d335d7659..9d45548b91 100644 --- a/labs/savvis-symphonyvpdc/src/test/java/org/jclouds/savvis/vpdc/features/VMApiLiveTest.java +++ b/labs/savvis-symphonyvpdc/src/test/java/org/jclouds/savvis/vpdc/features/VMApiLiveTest.java @@ -29,7 +29,7 @@ import org.jclouds.cim.OSType; import org.jclouds.compute.domain.CIMOperatingSystem; import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.LoginCredentials; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.savvis.vpdc.domain.Network; import org.jclouds.savvis.vpdc.domain.Resource; import org.jclouds.savvis.vpdc.domain.Task; @@ -66,7 +66,8 @@ public class VMApiLiveTest extends BaseVPDCApiLiveTest { public void setupContext() { super.setupContext(); api = restContext.getApi().getVMApi(); - socketTester = retry(new InetSocketAddressConnect(), 130, 10, SECONDS);// make + SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); + socketTester = retry(socketOpen, 130, 10, SECONDS);// make } private String billingSiteId; diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java index bc92bfb652..5e5b54a5a5 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java @@ -53,7 +53,7 @@ import org.jclouds.gogrid.options.GetImageListOptions; import org.jclouds.gogrid.predicates.LoadBalancerLatestJobCompleted; import org.jclouds.gogrid.predicates.ServerLatestJobCompleted; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.predicates.InetSocketAddressConnect; +import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContext; import org.jclouds.ssh.SshClient; import org.testng.SkipException; @@ -342,10 +342,9 @@ public class GoGridLiveTestDisabled extends BaseComputeServiceContextLiveTest { assertNotNull(instanceCredentials); HostAndPort socket = HostAndPort.fromParts(createdServer.getIp().getIp(), 22); - - Predicate socketOpen = retry(new InetSocketAddressConnect(), 180, 5, SECONDS); - - socketOpen.apply(socket); + SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); + Predicate socketTester = retry(socketOpen, 180, 5, SECONDS); + socketTester.apply(socket); SshClient sshClient = gocontext.utils().injector().getInstance(SshClient.Factory.class).create(socket, instanceCredentials); sshClient.connect();