missing guice bindings found in live tests

This commit is contained in:
Adrian Cole 2011-07-24 11:18:44 -07:00
parent 6f6b11c45a
commit a604d25477
3 changed files with 12 additions and 16 deletions

View File

@ -21,18 +21,14 @@ package org.jclouds.trmk.vcloud_0_8;
import java.util.List;
import java.util.Properties;
import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.compute.ComputeServiceContextBuilder;
import org.jclouds.compute.internal.ComputeServiceContextImpl;
import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
import org.jclouds.logging.jdk.config.JDKLoggingModule;
import org.jclouds.trmk.vcloud_0_8.compute.config.TerremarkVCloudComputeServiceContextModule;
import org.jclouds.trmk.vcloud_0_8.config.TerremarkVCloudRestClientModule;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
/**
* Creates {@link VCloudComputeServiceContext} or {@link Injector} instances
@ -66,12 +62,4 @@ public class TerremarkVCloudContextBuilder<S extends TerremarkVCloudClient, A ex
protected void addClientModule(List<Module> modules) {
modules.add(new TerremarkVCloudRestClientModule<S, A>(syncClientType, asyncClientType));
}
@Override
public ComputeServiceContext buildComputeServiceContext() {
// need the generic type information
return (ComputeServiceContext) this.buildInjector().getInstance(
Key.get(new TypeLiteral<ComputeServiceContextImpl<S, A>>() {
}));
}
}

View File

@ -74,6 +74,13 @@ public class DefaultVCloudReferencesModule extends AbstractModule {
return defaultTasksListURIForOrg.apply(defaultOrg);
}
@Provides
@Singleton
@org.jclouds.trmk.vcloud_0_8.endpoints.TasksList
protected Predicate<ReferenceType> provideDefaultTasksListSelector(Injector i) {
return Predicates.alwaysTrue();
}
@Provides
@org.jclouds.trmk.vcloud_0_8.endpoints.Catalog
@Singleton

View File

@ -202,12 +202,13 @@ public class TerremarkVCloudRestClientModule<S extends TerremarkVCloudClient, A
@Singleton
public static class OrgCatalogSupplier implements
Supplier<Map<String, Map<String, ? extends org.jclouds.trmk.vcloud_0_8.domain.Catalog>>> {
protected final Supplier<Map<String, ? extends Org>> orgSupplier;
protected final Function<Org, Iterable<? extends org.jclouds.trmk.vcloud_0_8.domain.Catalog>> allCatalogsInOrg;
protected final Supplier<Map<String, ? extends org.jclouds.trmk.vcloud_0_8.domain.Org>> orgSupplier;
protected final Function<org.jclouds.trmk.vcloud_0_8.domain.Org, Iterable<? extends org.jclouds.trmk.vcloud_0_8.domain.Catalog>> allCatalogsInOrg;
@Inject
protected OrgCatalogSupplier(Supplier<Map<String, ? extends Org>> orgSupplier,
Function<Org, Iterable<? extends org.jclouds.trmk.vcloud_0_8.domain.Catalog>> allCatalogsInOrg) {
protected OrgCatalogSupplier(
Supplier<Map<String, ? extends org.jclouds.trmk.vcloud_0_8.domain.Org>> orgSupplier,
Function<org.jclouds.trmk.vcloud_0_8.domain.Org, Iterable<? extends org.jclouds.trmk.vcloud_0_8.domain.Catalog>> allCatalogsInOrg) {
this.orgSupplier = orgSupplier;
this.allCatalogsInOrg = allCatalogsInOrg;
}