diff --git a/all/pom.xml b/all/pom.xml
index 51f0aab3ea..d95e9bb766 100644
--- a/all/pom.xml
+++ b/all/pom.xml
@@ -39,5 +39,10 @@
jclouds-allblobstore
${project.version}
+
+ org.jclouds.provider
+ aws-simpledb
+ ${project.version}
+
diff --git a/apis/simpledb/src/main/java/org/jclouds/simpledb/SimpleDBPropertiesBuilder.java b/apis/simpledb/src/main/java/org/jclouds/simpledb/SimpleDBPropertiesBuilder.java
index 1daf492d9f..2b3b52405e 100644
--- a/apis/simpledb/src/main/java/org/jclouds/simpledb/SimpleDBPropertiesBuilder.java
+++ b/apis/simpledb/src/main/java/org/jclouds/simpledb/SimpleDBPropertiesBuilder.java
@@ -21,29 +21,19 @@ package org.jclouds.simpledb;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
-import static org.jclouds.aws.domain.Region.AP_SOUTHEAST_1;
-import static org.jclouds.aws.domain.Region.EU_WEST_1;
-import static org.jclouds.aws.domain.Region.US_EAST_1;
-import static org.jclouds.aws.domain.Region.US_WEST_1;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
-import static org.jclouds.aws.reference.AWSConstants.PROPERTY_REGIONS;
import java.util.Properties;
-import java.util.Set;
import org.jclouds.PropertiesBuilder;
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableSet;
-
/**
* Builds properties used in SimpleDB Clients
*
* @author Adrian Cole
*/
public class SimpleDBPropertiesBuilder extends PropertiesBuilder {
- public static Set DEFAULT_REGIONS = ImmutableSet.of(EU_WEST_1, US_EAST_1, US_WEST_1, AP_SOUTHEAST_1);
@Override
protected Properties defaultProperties() {
@@ -51,12 +41,7 @@ public class SimpleDBPropertiesBuilder extends PropertiesBuilder {
properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
properties.setProperty(PROPERTY_HEADER_TAG, "amz");
properties.setProperty(PROPERTY_API_VERSION, SimpleDBAsyncClient.VERSION);
- properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(DEFAULT_REGIONS));
properties.setProperty(PROPERTY_ENDPOINT, "https://sdb.amazonaws.com");
- properties.setProperty(PROPERTY_ENDPOINT + "." + US_EAST_1, "https://sdb.amazonaws.com");
- properties.setProperty(PROPERTY_ENDPOINT + "." + US_WEST_1, "https://sdb.us-west-1.amazonaws.com");
- properties.setProperty(PROPERTY_ENDPOINT + "." + EU_WEST_1, "https://sdb.eu-west-1.amazonaws.com");
- properties.setProperty(PROPERTY_ENDPOINT + "." + AP_SOUTHEAST_1, "https://sdb.ap-southeast-1.amazonaws.com");
return properties;
}
diff --git a/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java b/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java
index 6ba7737bea..e35113614c 100644
--- a/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java
+++ b/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java
@@ -19,7 +19,6 @@
package org.jclouds.simpledb;
-import static org.jclouds.simpledb.SimpleDBPropertiesBuilder.DEFAULT_REGIONS;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
@@ -96,15 +95,6 @@ public class SimpleDBAsyncClientTest extends RestClientTest
checkFilters(request);
}
- // TODO fix this test as it has the wrong arg count
- @Test(enabled = false)
- public void testAllRegions() throws SecurityException, NoSuchMethodException, IOException {
- Method method = SimpleDBAsyncClient.class.getMethod("putAttributes", String.class, String.class);
- for (String region : DEFAULT_REGIONS) {
- processor.createRequest(method, region, "domainName");
- }
- }
-
// TODO fix this test as it has the wrong arg type
@Test(enabled = false)
public void testPutAttributes() throws SecurityException, NoSuchMethodException, IOException {
diff --git a/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java b/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java
index 7f4abd1490..0860fb915d 100644
--- a/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java
+++ b/apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java
@@ -20,7 +20,6 @@
package org.jclouds.simpledb;
import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.simpledb.SimpleDBPropertiesBuilder.DEFAULT_REGIONS;
import static org.testng.Assert.assertNotNull;
import java.util.Properties;
@@ -28,7 +27,6 @@ import java.util.Set;
import java.util.SortedSet;
import org.jclouds.Constants;
-import org.jclouds.aws.domain.Region;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
@@ -38,7 +36,6 @@ 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;
@@ -50,11 +47,11 @@ import com.google.inject.Module;
@Test(groups = "live", sequential = true)
public class SimpleDBClientLiveTest {
- private SimpleDBClient client;
+ protected SimpleDBClient client;
private RestContext context;
- private Set domains = Sets.newHashSet();
+ protected Set domains = Sets.newHashSet();
protected String provider = "simpledb";
protected String identity;
protected String credential;
@@ -93,47 +90,49 @@ public class SimpleDBClientLiveTest {
}
@Test
- void testListDomainsInRegion() throws InterruptedException {
- for (String region : Lists.newArrayList(null, Region.EU_WEST_1, Region.US_EAST_1, Region.US_WEST_1,
- Region.AP_SOUTHEAST_1)) {
- SortedSet allResults = Sets.newTreeSet(client.listDomainsInRegion(region));
- assertNotNull(allResults);
- if (allResults.size() >= 1) {
- String domain = allResults.last();
- assertDomainInList(region, domain);
- }
+ protected void testListDomains() throws InterruptedException {
+ listDomainInRegion(null);
+ }
+
+ protected void listDomainInRegion(String region) throws InterruptedException {
+ SortedSet allResults = Sets.newTreeSet(client.listDomainsInRegion(region));
+ assertNotNull(allResults);
+ if (allResults.size() >= 1) {
+ String domain = allResults.last();
+ assertDomainInList(region, domain);
}
}
public static final String PREFIX = System.getProperty("user.name") + "-simpledb";
- @Test
- void testCreateDomain() throws InterruptedException {
- String domainName = PREFIX + "1";
-
- for (String region : DEFAULT_REGIONS) {
- try {
- SortedSet result = Sets.newTreeSet(client.listDomainsInRegion(region));
- if (result.size() >= 1) {
- client.deleteDomainInRegion(region, result.last());
- domainName += 1;// cannot recreate a domain within 60 seconds
- }
- } catch (Exception e) {
-
+ protected String createDomainInRegion(String region, String domainName) throws InterruptedException {
+ try {
+ SortedSet result = Sets.newTreeSet(client.listDomainsInRegion(region));
+ if (result.size() >= 1) {
+ client.deleteDomainInRegion(region, result.last());
+ domainName += 1;// cannot recreate a domain within 60 seconds
}
- client.createDomainInRegion(region, domainName);
+ } catch (Exception e) {
- // TODO get the domain metadata and ensure the region is correct
-
- // if (region != null)
- // assertEquals(domain.getRegion(), region);
- // assertEquals(domain.getName(), domainName);
- assertDomainInList(region, domainName);
- domains.add(domainName);
}
+ client.createDomainInRegion(region, domainName);
+
+ // TODO get the domain metadata and ensure the region is correct
+
+ // if (region != null)
+ // assertEquals(domain.getRegion(), region);
+ // assertEquals(domain.getName(), domainName);
+ assertDomainInList(region, domainName);
+ domains.add(domainName);
+ return domainName;
}
- private void assertDomainInList(final String region, final String domain) throws InterruptedException {
+ @Test
+ protected void testCreateDomain() throws InterruptedException {
+ createDomainInRegion(null, PREFIX + "1");
+ }
+
+ protected void assertDomainInList(final String region, final String domain) throws InterruptedException {
assertEventually(new Runnable() {
public void run() {
ListDomainsResponse domains = client.listDomainsInRegion(region);
diff --git a/apis/simpledb/src/test/java/org/jclouds/simpledb/config/SimpleDBRestClientModuleTest.java b/apis/simpledb/src/test/java/org/jclouds/simpledb/config/SimpleDBRestClientModuleTest.java
deleted file mode 100644
index a760fb75ec..0000000000
--- a/apis/simpledb/src/test/java/org/jclouds/simpledb/config/SimpleDBRestClientModuleTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- * Copyright (C) 2010 Cloud Conscious, LLC.
- *
- * ====================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ====================================================================
- */
-
-package org.jclouds.simpledb.config;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-import java.util.Map;
-
-import org.jclouds.aws.domain.Region;
-import org.jclouds.aws.handlers.AWSClientErrorRetryHandler;
-import org.jclouds.aws.handlers.AWSRedirectionRetryHandler;
-import org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent;
-import org.jclouds.http.handlers.DelegatingErrorHandler;
-import org.jclouds.http.handlers.DelegatingRetryHandler;
-import org.jclouds.logging.config.NullLoggingModule;
-import org.jclouds.rest.BaseRestClientTest.MockModule;
-import org.jclouds.rest.RestContextFactory;
-import org.testng.annotations.Test;
-
-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;
-
-/**
- * @author Adrian Cole
- */
-@Test(groups = "unit")
-public class SimpleDBRestClientModuleTest {
-
- Injector createInjector() {
- return new RestContextFactory().createContextBuilder("simpledb", "uid", "key",
- ImmutableSet. of(new MockModule(), new NullLoggingModule())).buildInjector();
- }
-
- @Test
- void testServerErrorHandler() {
- DelegatingErrorHandler handler = createInjector().getInstance(DelegatingErrorHandler.class);
- assertEquals(handler.getServerErrorHandler().getClass(), ParseAWSErrorFromXmlContent.class);
- }
-
- @Test
- void testRegions() {
- Map regionMap = createInjector().getInstance(
- new Key