diff --git a/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java b/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java index 0c211174dc..cbe7f07052 100644 --- a/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java +++ b/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java @@ -26,11 +26,13 @@ import java.net.URI; import java.util.Map; import java.util.Map.Entry; +import javax.annotation.Resource; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import org.jclouds.location.Region; +import org.jclouds.logging.Logger; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; @@ -53,6 +55,9 @@ public class ProvideRegionToURIViaProperties implements javax.inject.Provider constants; + @Resource + protected Logger logger = Logger.NULL; + @Inject protected ProvideRegionToURIViaProperties(Injector injector, @Named("CONSTANTS") Multimap constants) { this.injector = injector; @@ -77,8 +82,7 @@ public class ProvideRegionToURIViaProperties implements javax.inject.Provider { this.defaultProvider = checkNotNull(defaultProvider, "defaultProvider"); this.defaultUri = checkNotNull(defaultUri, "defaultUri"); this.regionToEndpoint = checkNotNull(regionToEndpoint, "regionToEndpoint"); - checkArgument(regionToEndpoint.size() > 0, "no region name to endpoint mappings configured!"); } @Override diff --git a/sandbox-apis/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java b/sandbox-apis/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java index 5222241964..4f82c47869 100644 --- a/sandbox-apis/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java +++ b/sandbox-apis/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java @@ -22,14 +22,11 @@ import static org.testng.Assert.assertEquals; import java.io.IOException; import java.lang.reflect.Method; -import java.net.URI; -import java.util.Map; import java.util.Properties; import javax.inject.Named; import org.jclouds.Constants; -import org.jclouds.aws.domain.Region; import org.jclouds.aws.filters.FormSigner; import org.jclouds.date.DateService; import org.jclouds.elb.config.ELBRestClientModule; @@ -49,7 +46,6 @@ import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404; import org.jclouds.rest.internal.RestAnnotationProcessor; import org.testng.annotations.Test; -import com.google.common.collect.ImmutableMap; import com.google.inject.Module; import com.google.inject.TypeLiteral; @@ -174,20 +170,6 @@ public class ELBAsyncClientTest extends RestClientTest { @Named(Constants.PROPERTY_SESSION_INTERVAL) int expiration) { return "2009-11-08T15:54:08.897Z"; } - - @Override - protected void bindRegionsToProvider() { - bindRegionsToProvider(Regions.class); - } - - static class Regions implements javax.inject.Provider> { - @Override - public Map get() { - return ImmutableMap. of(Region.EU_WEST_1, URI.create("https://elb.eu-west-1.amazonaws.com"), - Region.US_EAST_1, URI.create("https://elb.us-east-1.amazonaws.com"), Region.US_WEST_1, - URI.create("https://elb.us-west-1.amazonaws.com")); - } - } } @Override diff --git a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java b/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java index 9050f1be51..8cf7eec063 100644 --- a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java +++ b/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java @@ -22,11 +22,9 @@ import static org.testng.Assert.assertEquals; import java.io.IOException; import java.lang.reflect.Method; -import java.net.URI; import java.util.Map; import java.util.Properties; -import org.jclouds.aws.domain.Region; import org.jclouds.aws.filters.FormSigner; import org.jclouds.http.HttpRequest; import org.jclouds.http.RequiresHttp; @@ -42,7 +40,6 @@ import org.jclouds.simpledb.options.ListDomainsOptions; import org.jclouds.simpledb.xml.ListDomainsResponseHandler; import org.testng.annotations.Test; -import com.google.common.collect.ImmutableMap; import com.google.inject.Module; import com.google.inject.TypeLiteral; @@ -60,24 +57,6 @@ public class SimpleDBAsyncClientTest extends RestClientTest @RequiresHttp @ConfiguresRestClient private static final class TestSimpleDBRestClientModule extends SimpleDBRestClientModule { - @Override - protected void configure() { - super.configure(); - } - - @Override - protected void bindRegionsToProvider() { - bindRegionsToProvider(Regions.class); - } - - static class Regions implements javax.inject.Provider> { - @Override - public Map get() { - return ImmutableMap. of(Region.EU_WEST_1, URI.create("https://sdb.eu-west-1.amazonaws.com"), - Region.US_EAST_1, URI.create("https://sdb.us-east-1.amazonaws.com"), Region.US_WEST_1, - URI.create("https://sdb.us-west-1.amazonaws.com")); - } - } } public void testListDomainsInRegion() throws SecurityException, NoSuchMethodException, IOException { diff --git a/sandbox-apis/sqs/src/test/java/org/jclouds/sqs/SQSAsyncClientTest.java b/sandbox-apis/sqs/src/test/java/org/jclouds/sqs/SQSAsyncClientTest.java index 6ea5d1f49a..9659b63167 100644 --- a/sandbox-apis/sqs/src/test/java/org/jclouds/sqs/SQSAsyncClientTest.java +++ b/sandbox-apis/sqs/src/test/java/org/jclouds/sqs/SQSAsyncClientTest.java @@ -59,10 +59,6 @@ public class SQSAsyncClientTest extends RestClientTest { @RequiresHttp @ConfiguresRestClient private static final class TestSQSRestClientModule extends SQSRestClientModule { - @Override - protected void configure() { - super.configure(); - } @Override protected String provideTimeStamp(final DateService dateService, diff --git a/sandbox-providers/aws-elb/src/test/java/org/jclouds/aws/elb/ELBAsyncClientTest.java b/sandbox-providers/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBAsyncClientTest.java similarity index 88% rename from sandbox-providers/aws-elb/src/test/java/org/jclouds/aws/elb/ELBAsyncClientTest.java rename to sandbox-providers/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBAsyncClientTest.java index eaa56a2401..283c816719 100644 --- a/sandbox-providers/aws-elb/src/test/java/org/jclouds/aws/elb/ELBAsyncClientTest.java +++ b/sandbox-providers/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBAsyncClientTest.java @@ -23,6 +23,7 @@ import java.lang.reflect.Method; import org.jclouds.aws.domain.Region; import org.jclouds.elb.ELBAsyncClient; +import org.jclouds.elb.ELBAsyncClientTest; import org.testng.annotations.Test; /** @@ -31,10 +32,10 @@ import org.testng.annotations.Test; * @author Adrian Cole */ // NOTE:without testName, this will not call @Before* and fail w/NPE during surefire -@Test(groups = "unit", testName = "aws.ELBAsyncClientTest") -public class ELBAsyncClientTest extends org.jclouds.elb.ELBAsyncClientTest { +@Test(groups = "unit", testName = "AWSELBAsyncClientTest") +public class AWSELBAsyncClientTest extends ELBAsyncClientTest { - public ELBAsyncClientTest() { + public AWSELBAsyncClientTest() { this.provider = "aws-elb"; }