From 19b9d5c4c7c3dae43766c45b33155beea0392815 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Mon, 29 Apr 2013 00:22:34 +0200 Subject: [PATCH] Fix TransientChef and Strategy live tests --- .../jclouds/chef/test/config/TransientChefApiModule.java | 8 ++++++-- .../java/org/jclouds/chef/internal/BaseChefLiveTest.java | 4 ++++ .../internal/CleanupStaleNodesAndClientsImplLiveTest.java | 2 +- ...ateNodeAndPopulateAutomaticAttributesImplLiveTest.java | 2 +- .../internal/DeleteAllApisAndNodesInListImplLiveTest.java | 2 +- .../chef/strategy/internal/GetNodesImplLiveTest.java | 2 +- .../UpdateAutomaticAttributesOnNodeImplLiveTest.java | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/apis/chef/src/main/java/org/jclouds/chef/test/config/TransientChefApiModule.java b/apis/chef/src/main/java/org/jclouds/chef/test/config/TransientChefApiModule.java index 8318042047..a10ba71c5b 100644 --- a/apis/chef/src/main/java/org/jclouds/chef/test/config/TransientChefApiModule.java +++ b/apis/chef/src/main/java/org/jclouds/chef/test/config/TransientChefApiModule.java @@ -41,12 +41,14 @@ import org.jclouds.concurrent.config.ExecutorServiceModule; import org.jclouds.crypto.Crypto; import org.jclouds.domain.JsonBall; import org.jclouds.rest.ConfiguresHttpApi; -import org.jclouds.rest.config.HttpApiModule; +import org.jclouds.rest.config.RestModule; +import org.jclouds.rest.config.SyncToAsyncHttpInvocationModule; import com.google.common.base.Optional; import com.google.common.base.Supplier; import com.google.common.cache.CacheLoader; import com.google.common.collect.ImmutableSet; +import com.google.inject.AbstractModule; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.Provides; @@ -57,10 +59,12 @@ import com.google.inject.name.Names; * @author Adrian Cole */ @ConfiguresHttpApi -public class TransientChefApiModule extends HttpApiModule { +public class TransientChefApiModule extends AbstractModule { @Override protected void configure() { + install(new RestModule()); + install(new SyncToAsyncHttpInvocationModule()); bind(ChefApi.class).to(TransientChefApi.class); bind(LocalBlobStore.class).annotatedWith(Names.named("databags")) .toInstance( diff --git a/apis/chef/src/test/java/org/jclouds/chef/internal/BaseChefLiveTest.java b/apis/chef/src/test/java/org/jclouds/chef/internal/BaseChefLiveTest.java index 0503b8628b..03ce7072e5 100644 --- a/apis/chef/src/test/java/org/jclouds/chef/internal/BaseChefLiveTest.java +++ b/apis/chef/src/test/java/org/jclouds/chef/internal/BaseChefLiveTest.java @@ -48,6 +48,10 @@ public abstract class BaseChefLiveTest extends BaseApiLiveTes protected ChefService chefService; protected Json json; + protected BaseChefLiveTest() { + provider = "chef"; + } + /** * the credential is a path to the pem file. */ diff --git a/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/CleanupStaleNodesAndClientsImplLiveTest.java b/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/CleanupStaleNodesAndClientsImplLiveTest.java index 0ba238156b..ce5c050836 100644 --- a/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/CleanupStaleNodesAndClientsImplLiveTest.java +++ b/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/CleanupStaleNodesAndClientsImplLiveTest.java @@ -39,7 +39,7 @@ public class CleanupStaleNodesAndClientsImplLiveTest extends BaseChefLiveTest { private CreateNodeAndPopulateAutomaticAttributesImpl creater; @Override - public void initialize() { + protected void initialize() { super.initialize(); this.creater = injector.getInstance(CreateNodeAndPopulateAutomaticAttributesImpl.class); this.strategy = injector.getInstance(ListNodesImpl.class); diff --git a/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/UpdateAutomaticAttributesOnNodeImplLiveTest.java b/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/UpdateAutomaticAttributesOnNodeImplLiveTest.java index e3268f2c2b..54bd0cc061 100644 --- a/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/UpdateAutomaticAttributesOnNodeImplLiveTest.java +++ b/apis/chef/src/test/java/org/jclouds/chef/strategy/internal/UpdateAutomaticAttributesOnNodeImplLiveTest.java @@ -42,7 +42,7 @@ public class UpdateAutomaticAttributesOnNodeImplLiveTest extends BaseChefLiveTes private UpdateAutomaticAttributesOnNodeImpl strategy; @Override - public void initialize() { + protected void initialize() { super.initialize(); this.currentUserProvider = injector.getInstance(CurrentUserProvider.class); this.strategy = injector.getInstance(UpdateAutomaticAttributesOnNodeImpl.class);