mirror of https://github.com/apache/jclouds.git
Issue 1004: GAE uses SocketOpenUnsupported
This commit is contained in:
parent
95c35487f0
commit
9e0f22207c
|
@ -27,6 +27,8 @@ import org.jclouds.http.HttpCommandExecutorService;
|
|||
import org.jclouds.http.TransformingHttpCommandExecutorService;
|
||||
import org.jclouds.http.TransformingHttpCommandExecutorServiceImpl;
|
||||
import org.jclouds.http.config.ConfiguresHttpCommandExecutorService;
|
||||
import org.jclouds.predicates.SocketOpen;
|
||||
import org.jclouds.predicates.SocketOpenUnsupported;
|
||||
|
||||
import com.google.appengine.api.urlfetch.URLFetchService;
|
||||
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
|
||||
|
@ -35,6 +37,7 @@ import com.google.common.util.concurrent.ListeningExecutorService;
|
|||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Module;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Scopes;
|
||||
|
||||
/**
|
||||
* Configures {@link GaeHttpCommandExecutorService}.
|
||||
|
@ -75,6 +78,7 @@ public class GoogleAppEngineConfigurationModule extends AbstractModule {
|
|||
protected void configure() {
|
||||
install(executorServiceModule);
|
||||
bind(TransformingHttpCommandExecutorService.class).to(TransformingHttpCommandExecutorServiceImpl.class);
|
||||
bind(SocketOpen.class).to(SocketOpenUnsupported.class).in(Scopes.SINGLETON);
|
||||
bindHttpCommandExecutorService();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package org.jclouds.gae;
|
||||
|
||||
import org.jclouds.Context;
|
||||
import org.jclouds.ContextBuilder;
|
||||
import org.jclouds.gae.config.GoogleAppEngineConfigurationModule;
|
||||
import org.jclouds.http.IntegrationTestAsyncClient;
|
||||
import org.jclouds.http.IntegrationTestClient;
|
||||
import org.jclouds.predicates.SocketOpen;
|
||||
import org.jclouds.providers.AnonymousProviderMetadata;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.HostAndPort;
|
||||
|
||||
public class GaeSocketOpenTest {
|
||||
|
||||
@Test(expectedExceptions=UnsupportedOperationException.class)
|
||||
public void testSocketOpenThrowsUnsupported() {
|
||||
Context context = ContextBuilder.newBuilder(
|
||||
AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class, IntegrationTestAsyncClient.class,
|
||||
"dummyurl"))
|
||||
.modules(ImmutableSet.of(new GoogleAppEngineConfigurationModule()))
|
||||
.build();
|
||||
|
||||
SocketOpen socketOpen = context.getUtils().getInjector().getInstance(SocketOpen.class);
|
||||
socketOpen.apply(HostAndPort.fromParts("localhost", 22));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue