Issue 274: updated to latest guice

This commit is contained in:
Adrian Cole 2010-08-05 19:04:15 -04:00
parent 55e7b82ba8
commit ef86f2da1b
46 changed files with 70 additions and 72 deletions

View File

@ -30,9 +30,9 @@ import org.jclouds.atmosonline.saas.reference.AtmosStorageHeaders;
import org.jclouds.http.HttpResponse;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.inject.internal.ImmutableSet;
/**
* @author Adrian Cole

View File

@ -18,10 +18,10 @@
*/
package org.jclouds.aws.ec2.domain;
import com.google.inject.internal.ImmutableSet;
import java.util.Set;
import com.google.common.collect.ImmutableSet;
/**
*
* Availability zones used for all ec2 instance commands.

View File

@ -28,8 +28,8 @@ import org.jclouds.aws.ec2.services.ElasticBlockStoreClient;
import org.jclouds.logging.Logger;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.internal.Iterables;
/**
*

View File

@ -27,9 +27,9 @@ import org.jclouds.aws.ec2.services.ElasticBlockStoreClient;
import org.jclouds.logging.Logger;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import com.google.inject.internal.Iterables;
/**
*

View File

@ -26,8 +26,8 @@ import org.jclouds.aws.ec2.services.ElasticBlockStoreClient;
import org.jclouds.logging.Logger;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.internal.Iterables;
/**
*

View File

@ -31,7 +31,7 @@ import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ReturnStringIf2xx;
import com.google.common.base.Function;
import com.google.inject.internal.Iterables;
import com.google.common.collect.Iterables;
/**
*

View File

@ -74,11 +74,11 @@ import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.internal.ImmutableMap;
/**
* Adapted from the following sources: {@link http://gist.github.com/249915}, {@link http

View File

@ -43,12 +43,12 @@ import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.ImmutableMap;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code AMIClient}

View File

@ -27,8 +27,8 @@ import static org.testng.Assert.assertNotNull;
import java.io.IOException;
import java.net.URI;
import java.util.Iterator;
import java.util.SortedMap;
import java.util.Set;
import java.util.SortedMap;
import java.util.Map.Entry;
import org.jclouds.aws.domain.Region;
@ -43,10 +43,10 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code AvailabilityZoneAndRegionClient}

View File

@ -48,9 +48,9 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code ElasticBlockStoreClient}

View File

@ -37,9 +37,9 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code ElasticIPAddressClient}

View File

@ -37,8 +37,8 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code EC2Client}

View File

@ -38,9 +38,9 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code KeyPairClient}

View File

@ -58,9 +58,9 @@ import com.google.common.base.Predicate;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code PlacementGroupClient}

View File

@ -44,9 +44,9 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code SecurityGroupClient}

View File

@ -31,7 +31,7 @@ import org.jclouds.http.functions.ParseSax;
import org.jclouds.rest.internal.GeneratedHttpRequest;
import org.testng.annotations.Test;
import com.google.inject.internal.Iterables;
import com.google.common.collect.Iterables;
/**
* Tests behavior of {@code DescribeBundleTasksResponseHandler}

View File

@ -30,7 +30,7 @@ import org.jclouds.http.functions.ParseSax;
import org.jclouds.rest.internal.GeneratedHttpRequest;
import org.testng.annotations.Test;
import com.google.inject.internal.Iterables;
import com.google.common.collect.Iterables;
/**
* Tests behavior of {@code DescribePlacementGroupsResponseHandler}

View File

@ -30,7 +30,7 @@ import org.jclouds.http.functions.ParseSax;
import org.jclouds.rest.internal.GeneratedHttpRequest;
import org.testng.annotations.Test;
import com.google.inject.internal.Iterables;
import com.google.common.collect.Iterables;
/**
* Tests behavior of {@code DescribeReservedInstancesOfferingResponseHandler}

View File

@ -37,8 +37,8 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code ELBClient}

View File

@ -39,9 +39,9 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Module;
import com.google.inject.internal.Lists;
/**
* Tests behavior of {@code SQSClient}

View File

@ -52,7 +52,7 @@
<dependency>
<groupId>com.google.code.guice</groupId>
<artifactId>guice-servlet</artifactId>
<version>2.1-r1172</version>
<version>2.1-r1201</version>
</dependency>
<dependency>
<groupId>displaytag</groupId>

View File

@ -54,8 +54,8 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.inject.Module;
import com.google.inject.internal.Iterables;
/**
* Tests behavior of {@code AzureBlobClient}

View File

@ -29,7 +29,7 @@ import org.jclouds.http.functions.BaseHandlerTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.google.inject.internal.ImmutableSet;
import com.google.common.collect.ImmutableSet;
/**
* Tests behavior of {@code QueueMessagesListHandler}

View File

@ -72,7 +72,7 @@
<dependency>
<groupId>com.google.code.guice</groupId>
<artifactId>guice</artifactId>
<version>2.1-r1172</version>
<version>2.1-r1201</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>

View File

@ -20,7 +20,7 @@ package org.jclouds.http;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.inject.internal.Lists.newArrayList;
import static com.google.common.collect.Lists.newArrayList;
import java.net.URI;
import java.util.Arrays;
@ -33,7 +33,8 @@ import org.jclouds.io.Payload;
import com.google.common.collect.Multimap;
/**
* Represents a request that can be executed within {@link HttpCommandExecutorService}
* Represents a request that can be executed within
* {@link HttpCommandExecutorService}
*
* @author Adrian Cole
*/
@ -58,8 +59,7 @@ public class HttpRequest extends HttpMessage {
public HttpRequest(String method, URI endpoint, char[] skips) {
this.setMethod(checkNotNull(method, "method"));
this.setEndpoint(checkNotNull(endpoint, "endpoint"));
checkArgument(endpoint.getHost() != null, String.format("endpoint.getHost() is null for %s",
endpoint));
checkArgument(endpoint.getHost() != null, String.format("endpoint.getHost() is null for %s", endpoint));
this.skips = skips;
}
@ -82,8 +82,7 @@ public class HttpRequest extends HttpMessage {
* @param method
* If the request is HEAD, this may change to GET due to redirects
*/
protected HttpRequest(String method, URI endpoint, Multimap<String, String> headers,
@Nullable Payload payload) {
protected HttpRequest(String method, URI endpoint, Multimap<String, String> headers, @Nullable Payload payload) {
this(method, endpoint);
getHeaders().putAll(checkNotNull(headers, "headers"));
setPayload(payload);
@ -94,10 +93,12 @@ public class HttpRequest extends HttpMessage {
}
/**
* We cannot return an enum, as per specification custom methods are allowed. Enums are not
* extensible.
* We cannot return an enum, as per specification custom methods are allowed.
* Enums are not extensible.
*
* @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1" >rfc2616</a>
* @see <a
* href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1"
* >rfc2616</a>
*/
public String getMethod() {
return method;
@ -188,8 +189,7 @@ public class HttpRequest extends HttpMessage {
@Override
public String toString() {
return "[method=" + method + ", endpoint=" + endpoint + ", headers=" + headers + ", payload="
+ payload + "]";
return "[method=" + method + ", endpoint=" + endpoint + ", headers=" + headers + ", payload=" + payload + "]";
}
}

View File

@ -26,7 +26,7 @@ import javax.inject.Singleton;
import org.jclouds.http.HttpResponse;
import com.google.common.base.Function;
import com.google.inject.internal.Iterables;
import com.google.common.collect.Iterables;
/**
* @author Adrian Cole

View File

@ -35,8 +35,8 @@ import org.jclouds.internal.ClassMethodArgs;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.internal.ImmutableMap;
/**
* Tests behavior of ListenableFutureExceptionParser
@ -152,7 +152,7 @@ public class SyncProxyTest {
@BeforeTest
public void setUp() throws IllegalArgumentException, SecurityException, NoSuchMethodException {
sync = SyncProxy.proxy(Sync.class, new SyncProxy(Sync.class, new Async(),
new ConcurrentHashMap<ClassMethodArgs, Object>(), ImmutableMap.<Class<?>, Class<?>> of()));
new ConcurrentHashMap<ClassMethodArgs, Object>(), ImmutableMap.<Class<?>, Class<?>> of()));
}
@Test

View File

@ -103,7 +103,7 @@
<dependency>
<groupId>com.google.code.guice</groupId>
<artifactId>guice-servlet</artifactId>
<version>2.1-r1172</version>
<version>2.1-r1201</version>
</dependency>
<dependency>
<groupId>displaytag</groupId>

View File

@ -24,7 +24,6 @@
package org.jclouds.gogrid.functions;
import static com.google.common.base.Preconditions.checkState;
import static com.google.inject.internal.Iterables.getOnlyElement;
import java.util.Map;
@ -35,6 +34,7 @@ import org.jclouds.domain.Credentials;
import org.jclouds.http.HttpResponse;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
/**
*
@ -58,6 +58,6 @@ public class ParseCredentialsFromJsonResponse implements
checkState(!(returnVal.size() > 1),
"expecting only 1 credential in response, but had more: "
+ returnVal.keySet());
return (returnVal.size() > 0) ? getOnlyElement(returnVal.values()) : null;
return (returnVal.size() > 0) ? Iterables.getOnlyElement(returnVal.values()) : null;
}
}

View File

@ -18,7 +18,11 @@
*/
package org.jclouds.gogrid.predicates;
import com.google.inject.internal.ImmutableSet;
import static org.easymock.EasyMock.expect;
import static org.easymock.classextension.EasyMock.createMock;
import static org.easymock.classextension.EasyMock.replay;
import static org.testng.Assert.assertTrue;
import org.jclouds.gogrid.domain.Job;
import org.jclouds.gogrid.domain.JobState;
import org.jclouds.gogrid.domain.Server;
@ -26,10 +30,7 @@ import org.jclouds.gogrid.options.GetJobListOptions;
import org.jclouds.gogrid.services.GridJobClient;
import org.testng.annotations.Test;
import static org.easymock.EasyMock.expect;
import static org.easymock.classextension.EasyMock.createMock;
import static org.easymock.classextension.EasyMock.replay;
import static org.testng.Assert.assertTrue;
import com.google.common.collect.ImmutableSet;
/**
* @author Oleksiy Yarmula

View File

@ -79,9 +79,9 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Ordering;
import com.google.common.collect.Sets;
import com.google.common.io.Files;
import com.google.inject.Module;
import com.google.inject.internal.Sets;
/**
* Tests behavior of {@code IBMDeveloperCloudClient}

View File

@ -20,7 +20,6 @@ package org.jclouds.opscodeplatform.domain;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import com.google.gson.annotations.SerializedName;
@ -254,7 +253,7 @@ public class User {
return privateKey;
}
public Certificate getCertificate() {
public X509Certificate getCertificate() {
return certificate;
}

View File

@ -61,11 +61,10 @@ import com.google.common.collect.ImmutableMap;
@RequiresHttp
@ConfiguresRestClient
public class OpscodePlatformRestClientModule extends
BaseChefRestClientModule<OpscodePlatformClient, OpscodePlatformAsyncClient> {
public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap
.<Class<?>, Class<?>> builder()//
.put(ChefClient.class, ChefAsyncClient.class)//
.build();
BaseChefRestClientModule<OpscodePlatformClient, OpscodePlatformAsyncClient> {
public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()//
.put(ChefClient.class, ChefAsyncClient.class)//
.build();
public OpscodePlatformRestClientModule() {
super(OpscodePlatformClient.class, OpscodePlatformAsyncClient.class, DELEGATE_MAP);

View File

@ -20,7 +20,7 @@ package org.jclouds.rackspace.cloudservers.domain;
import java.util.List;
import com.google.inject.internal.Lists;
import com.google.common.collect.Lists;
public class Limits {

View File

@ -20,14 +20,13 @@ package org.jclouds.rackspace.cloudservers.domain;
import java.util.Map;
import com.google.inject.internal.Maps;
import com.google.common.collect.Maps;
/**
* A server is a virtual machine instance in the Cloud Servers system. Flavor and image are
* requisite elements when creating a server.
*
* @author Adrian Cole
* @since 4.0
*/
public class Server {
private int id;

View File

@ -20,7 +20,7 @@ package org.jclouds.rackspace.cloudservers.domain;
import java.util.List;
import com.google.inject.internal.Lists;
import com.google.common.collect.Lists;
/**
* A shared IP group is a collection of servers that can share IPs with other members of the group.

View File

@ -32,8 +32,8 @@ import org.jclouds.rackspace.cloudservers.domain.Addresses;
import org.jclouds.rest.binders.BindToJsonPayload;
import com.google.common.collect.ImmutableMap;
import com.google.inject.internal.Lists;
import com.google.inject.internal.Maps;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
/**
*

View File

@ -26,7 +26,7 @@ import org.jclouds.http.HttpRequest;
import org.jclouds.rest.binders.BindToJsonPayload;
import com.google.common.collect.ImmutableMap;
import com.google.inject.internal.Maps;
import com.google.common.collect.Maps;
/**
*

View File

@ -32,11 +32,11 @@ import org.jclouds.rackspace.cloudservers.domain.Addresses;
import org.jclouds.rackspace.config.RackspaceParserModule;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableList;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import com.google.inject.internal.ImmutableList;
/**
* Tests behavior of {@code ParseAddressesFromJsonResponse}

View File

@ -31,11 +31,11 @@ import org.jclouds.json.config.GsonModule;
import org.jclouds.rackspace.config.RackspaceParserModule;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableList;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import com.google.inject.internal.ImmutableList;
/**
* Tests behavior of {@code ParseInetAddressListFromJsonResponse}

View File

@ -27,7 +27,7 @@ import org.jclouds.slicehost.domain.Slice;
import org.jclouds.slicehost.domain.Slice.Status;
import org.xml.sax.SAXException;
import com.google.inject.internal.Sets;
import com.google.common.collect.Sets;
/**
* @author Adrian Cole

View File

@ -75,8 +75,8 @@ import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.base.Throwables;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.inject.Provides;
import com.google.inject.internal.Maps;
/**
* Configures the VCloud authentication service connection, including logging

View File

@ -42,13 +42,13 @@ import org.testng.annotations.Test;
import com.google.common.base.CaseFormat;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import com.google.inject.internal.ImmutableMap;
/**
* Tests behavior of {@code VCloudClient}

View File

@ -31,12 +31,12 @@ import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import com.google.inject.internal.ImmutableMap;
/**
* Tests behavior of {@code HostingDotComVCloudComputeClient}

View File

@ -49,8 +49,8 @@ import org.jclouds.vcloud.terremark.domain.Protocol;
import org.jclouds.vcloud.terremark.domain.PublicIpAddress;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.inject.internal.ImmutableSet;
/**
* @author Adrian Cole

View File

@ -42,11 +42,11 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Provides;
import com.google.inject.internal.Iterables;
/**
* Tests behavior of {@code VAppHandler}