mirror of https://github.com/apache/jclouds.git
switched to use SocketOpen from guice
This commit is contained in:
parent
6c39fd2407
commit
21ab1ae836
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<S extends TerremarkVCloudClien
|
|||
public void setupContext() {
|
||||
super.setupContext();
|
||||
Injector injector = view.utils().injector();
|
||||
socketTester = retry(new InetSocketAddressConnect(), 300, 1, SECONDS);
|
||||
SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
|
||||
socketTester = retry(socketOpen, 300, 1, SECONDS);
|
||||
sshFactory = injector.getInstance(Factory.class);
|
||||
connection = (S) RestContext.class.cast(view.unwrap()).getApi();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.jclouds.joyent.cloudapi.v6_5.domain.Machine;
|
|||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.options.CreateMachineOptions;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.reference.Metadata;
|
||||
import org.jclouds.predicates.InetSocketAddressConnect;
|
||||
import org.jclouds.predicates.SocketOpen;
|
||||
import org.jclouds.ssh.SshClient;
|
||||
import org.jclouds.ssh.SshKeys;
|
||||
import org.jclouds.sshj.config.SshjSshClientModule;
|
||||
|
@ -96,7 +96,8 @@ public class MachineApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
|||
cloudApiContext.getApi().getKeyApi().create(Key.builder().name(fingerprint).key(key.get("public")).build());
|
||||
api = cloudApiContext.getApi().getMachineApiForDatacenter(
|
||||
Iterables.get(cloudApiContext.getApi().getConfiguredDatacenters(), 0));
|
||||
socketTester = retry(new InetSocketAddressConnect(), 180, 1, 1, SECONDS);
|
||||
SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
|
||||
socketTester = retry(socketOpen, 180, 1, 1, SECONDS);
|
||||
machineRunning = retry(new Predicate<Machine>() {
|
||||
public boolean apply(Machine input) {
|
||||
return api.get(input.getId()).getState() == Machine.State.RUNNING;
|
||||
|
|
|
@ -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<Instance>() {
|
||||
public boolean apply(Instance input) {
|
||||
return api().get(input.getId()).getStatus() == Instance.Status.AVAILABLE;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<HostAndPort> socketOpen = retry(new InetSocketAddressConnect(), 180, 5, SECONDS);
|
||||
|
||||
socketOpen.apply(socket);
|
||||
SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
|
||||
Predicate<HostAndPort> socketTester = retry(socketOpen, 180, 5, SECONDS);
|
||||
socketTester.apply(socket);
|
||||
|
||||
SshClient sshClient = gocontext.utils().injector().getInstance(SshClient.Factory.class).create(socket, instanceCredentials);
|
||||
sshClient.connect();
|
||||
|
|
Loading…
Reference in New Issue