You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ab...@apache.org on 2013/05/12 16:42:56 UTC
[11/18] JCLOUDS-25. Removing sandbox-*.
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/domain/ListDomainsResponse.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/domain/ListDomainsResponse.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/domain/ListDomainsResponse.java
deleted file mode 100644
index 3639e42..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/domain/ListDomainsResponse.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.domain;
-
-import java.util.Set;
-
-/**
- *
- * @author Adrian Cole
- * @author Luís A. Bastião Silva <ba...@ua.pt>
- * @see <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html" />
- */
-public interface ListDomainsResponse extends Set<String> {
-
- /**
- * An opaque token indicating that there are more than MaxNumberOfDomains domains still
- * available.
- */
- String getNextToken();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/options/ListDomainsOptions.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/options/ListDomainsOptions.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/options/ListDomainsOptions.java
deleted file mode 100644
index 7d02ac5..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/options/ListDomainsOptions.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.options;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Contains options supported in the Form API for the ListDomains operation. <h2>
- * Usage</h2> The recommended way to instantiate a ListDomainsOptions object is to statically import
- * ListDomainsOptions.Builder.* and invoke a static creation method followed by an instance mutator
- * (if needed):
- * <p/>
- * <code>
- * import static org.jclouds.simpledb.options.ListDomainsOptions.Builder.*
- * <p/>
- * SimpleDBClient connection = // get connection
- * Set<String> domains = connection.listDomainsInRegion(maxNumberOfDomains(1));
- * <code>
- *
- * @author Adrian Cole
- * @author Luís A. Bastião Silva <ba...@ua.pt>
- * @see <a href=
- * "http://docs.amazonwebservices.com/AmazonSimpleDB/2009-04-15/DeveloperGuide/SDB_API_ListDomains.html"
- * />
- */
-public class ListDomainsOptions extends BaseHttpRequestOptions {
-
- /**
- * The maximum number of domain names you want returned.
- *
- * @param maxNumberOfDomains
- * Maximum 100
- */
- public ListDomainsOptions maxNumberOfDomains(int maxNumberOfDomains) {
- checkArgument(maxNumberOfDomains > 0 && maxNumberOfDomains <= 100, "must be between 1-100");
- formParameters.put("MaxNumberOfDomains", maxNumberOfDomains + "");
- return this;
- }
-
- public String getMaxNumberOfDomains() {
- return getFirstFormOrNull("MaxNumberOfDomains");
- }
-
- /**
- *
- * @param nextToken
- * tells Amazon SimpleDB where to start the next list of domain names.
- */
- public ListDomainsOptions nextToken(String nextToken) {
- checkNotNull(nextToken, "nextToken");
- formParameters.put("NextToken", nextToken);
- return this;
- }
-
- /**
- *
- * @return String that tells Amazon SimpleDB where to start the next list of domain names.
- */
- public String getNextToken() {
- return getFirstFormOrNull("NextToken");
- }
-
- public static class Builder {
-
- /**
- * @see ListDomainsOptions#nextToken
- */
- public static ListDomainsOptions nextToken(String nextToken) {
- ListDomainsOptions options = new ListDomainsOptions();
- return options.nextToken(nextToken);
- }
-
- /**
- * @see ListDomainsOptions#maxNumberOfDomains
- */
- public static ListDomainsOptions maxNumberOfDomains(int maxNumberOfDomains) {
- ListDomainsOptions options = new ListDomainsOptions();
- return options.maxNumberOfDomains(maxNumberOfDomains);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/package-info.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/package-info.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/package-info.java
deleted file mode 100644
index e08a24b..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/package-info.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.
- */
-/**
- *
- * @see <a href="http://docs.amazonwebservices.com/AmazonSimpleDB/2009-04-15/DeveloperGuide/index.html"/>
- * @author Adrian Cole
- * @author Luís A. Bastião Silva <ba...@ua.pt>
- */
-package org.jclouds.simpledb;
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/SimpleDBParameters.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/SimpleDBParameters.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/SimpleDBParameters.java
deleted file mode 100644
index d66f5d0..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/SimpleDBParameters.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.reference;
-
-/**
- * Configuration properties and constants used in SimpleDB connections.
- *
- * @see <a href="http://docs.amazonwebservices.com/AWSSimpleDomainService/2009-02-01/APIReference/Query_QueryParams.html"
- * />
- * @author Adrian Cole
- * @author Luís A. Bastião Silva <ba...@ua.pt>
- */
-public interface SimpleDBParameters {
-
- /**
- * The action to perform. For example: CreateDomain.
- */
- public static final String ACTION = "Action";
-
- /**
- * The API version to use, as specified in the WSDL. For example: 2009-02-01.
- */
- public static final String VERSION = "Version";
-
- /**
- * Your Access Key ID. For example: 0AS7253JW73RRM652K02. For more information, see Your AWS
- * Identifiers in the Amazon SimpleDB Developer Guide.
- */
- public static final String AWS_ACCESS_KEY_ID = "AWSAccessKeyId";
-
- /**
- * The date and time the request is signed, in the format YYYY-MM-DDThh:mm:ssZ, as specified in
- * the ISO 8601 standard. Query requests must include either Timestamp or Expires, but not both.
- *
- */
- public static final String TIMESTAMP = "Timestamp";
-
- /**
- * The date and time at which the signature included in the request expires, in the format
- * YYYY-MM-DDThh:mm:ssZ, as specified in the ISO 8601 standard. Query requests must include
- * either Timestamp or Expires, but not both.
- */
- public static final String EXPIRES = "Expires";
- /**
- * A request signature (for information, see Request Authentication in the Amazon SimpleDB Developer
- * Guide). For example: Qnpl4Qk/7tINHzfXCiT7VbBatDA=.
- */
- public static final String SIGNATURE = "Signature";
- /**
- *Required when you use signature version 2 with Query requests. For more information, see Query
- * Request Authentication in the Amazon SimpleDB Developer Guide.
- */
- public static final String SIGNATURE_METHOD = "SignatureMethod";
- /**
- * For more information, see Query Request Authentication in the Amazon SimpleDB Developer Guide.
- */
- public static final String SIGNATURE_VERSION = "SignatureVersion";
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/package-info.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/package-info.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/package-info.java
deleted file mode 100644
index 51d91c2..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/reference/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.
- */
-/**
- * This package contains properties and reference data used in SimpleDB.
- * @author Adrian Cole
- */
-package org.jclouds.simpledb.reference;
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ItemsHandler.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ItemsHandler.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ItemsHandler.java
deleted file mode 100644
index aba7373..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ItemsHandler.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.xml;
-
-import java.util.Map;
-
-import org.jclouds.date.DateService;
-import org.jclouds.http.functions.ParseSax;
-import org.jclouds.simpledb.domain.AttributePair;
-import org.jclouds.simpledb.domain.Item;
-import org.xml.sax.Attributes;
-
-import com.google.common.collect.LinkedHashMultimap;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Multimap;
-import com.google.inject.Inject;
-
-/**
- *
- * @author Luís A. Bastião Silva <ba...@ua.pt>
- */
-public class ItemsHandler extends
- ParseSax.HandlerWithResult<Map<String, Item>> {
- private StringBuilder currentText = new StringBuilder();
-
- private Map<String, Item> items = Maps.newConcurrentMap();
- private Multimap<String, AttributePair> attributes = LinkedHashMultimap.create();
- private String attributeName;
- private String attributeValue = "";
- private String itemName;
-
- private boolean inside = false;
-
- protected final DateService dateService;
-
- @Inject
- public ItemsHandler(DateService dateService) {
- this.dateService = dateService;
- }
-
- public Map<String, Item> getResult() {
- return items;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- {
- if (qName.equals("Attribute")) {
- inside = true;
- }
- }
-
- public void endElement(String uri, String name, String qName)
- {
- if (qName.equals("Attribute"))
- {
- inside = false;
-
-
- System.out.println("AttributeName: " + attributeName);
- System.out.println("AttributeValue: " + attributeValue);
- }
- else if(qName.equals("Name")) {
- if (inside)
- attributeName = currentText.toString().trim();
- else
- itemName = currentText.toString().trim();
-
- } else if (qName.equals("Value"))
- {
- attributeValue = currentText.toString().trim();
-
- attributes.put(attributeName,new AttributePair(attributeName,
- attributeValue, false));
- }
- else if (qName.equals("Item"))
- {
- System.out.println("ItemName: " + itemName);
-
- Item item = new Item(attributes);
- items.put(itemName, item);
- attributes = LinkedHashMultimap.create();
- this.attributeName = null;
- this.attributeValue = null;
- this.itemName = null;
- inside = false;
- }
- currentText = new StringBuilder();
- }
-
- public void characters(char ch[], int start, int length) {
- currentText.append(ch, start, length);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ListDomainsResponseHandler.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ListDomainsResponseHandler.java b/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ListDomainsResponseHandler.java
deleted file mode 100644
index 772a54e..0000000
--- a/sandbox-apis/simpledb/src/main/java/org/jclouds/simpledb/xml/ListDomainsResponseHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.xml;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.jclouds.simpledb.domain.ListDomainsResponse;
-import org.jclouds.http.functions.ParseSax;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-
-/**
- * Parses the following XML document:
- * <p/>
- * ListDomainsResponse
- *
- * @author Adrian Cole
- * @author Luís A. Bastião Silva <ba...@ua.pt>
- * @see <a href=
- * "http://docs.amazonwebservices.com/AmazonSimpleDB/2009-04-15/DeveloperGuide/SDB_API_ListDomains.htm l"
- * />
- */
-public class ListDomainsResponseHandler extends ParseSax.HandlerWithResult<ListDomainsResponse> {
- private StringBuilder currentText = new StringBuilder();
-
- private Set<String> domains = Sets.newLinkedHashSet();
- private String nextToken;
-
- @Override
- public ListDomainsResponse getResult() {
- return new ListDomainsResponseImpl(domains, nextToken);
- }
-
- public static class ListDomainsResponseImpl extends LinkedHashSet<String> implements ListDomainsResponse {
-
- private static final long serialVersionUID = 1L;
- private final String nextToken;
-
- public ListDomainsResponseImpl(Iterable<String> domains, String nextToken) {
- Iterables.addAll(this, domains);
- this.nextToken = nextToken;
- }
-
- @Override
- public String getNextToken() {
- return nextToken;
- }
-
- }
-
- public void endElement(String uri, String name, String qName) {
- if (qName.equals("DomainName")) {
- domains.add(currentText.toString().trim());
- } else if (qName.equals("NextToken")) {
- if (!currentText.toString().equals(""))
- this.nextToken = currentText.toString().trim();
- }
- currentText = new StringBuilder();
- }
-
- public void characters(char ch[], int start, int length) {
- currentText.append(ch, start, length);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java
----------------------------------------------------------------------
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
deleted file mode 100644
index 8cf7eec..0000000
--- a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBAsyncClientTest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Properties;
-
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.RequiresHttp;
-import org.jclouds.http.functions.ParseSax;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.RestClientTest;
-import org.jclouds.rest.RestContextFactory;
-import org.jclouds.rest.RestContextSpec;
-import org.jclouds.rest.internal.RestAnnotationProcessor;
-import org.jclouds.simpledb.config.SimpleDBRestClientModule;
-import org.jclouds.simpledb.options.ListDomainsOptions;
-import org.jclouds.simpledb.xml.ListDomainsResponseHandler;
-import org.testng.annotations.Test;
-
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-
-/**
- * Tests behavior of {@code SimpleDBAsyncClient}
- *
- * @author Adrian Cole
- */
-// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
-@Test(groups = "unit", testName = "SimpleDBAsyncClientTest")
-public class SimpleDBAsyncClientTest extends RestClientTest<SimpleDBAsyncClient> {
-
- protected String provider = "simpledb";
-
- @RequiresHttp
- @ConfiguresRestClient
- private static final class TestSimpleDBRestClientModule extends SimpleDBRestClientModule {
- }
-
- public void testListDomainsInRegion() throws SecurityException, NoSuchMethodException, IOException {
- Method method = SimpleDBAsyncClient.class.getMethod("listDomainsInRegion", String.class,
- ListDomainsOptions[].class);
- HttpRequest request = processor.createRequest(method);
-
- assertRequestLineEquals(request, "POST https://sdb.amazonaws.com/ HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "Host: sdb.amazonaws.com\n");
- assertPayloadEquals(request, "Version=2009-04-15&Action=ListDomains", "application/x-www-form-urlencoded", false);
-
- assertResponseParserClassEquals(method, request, ParseSax.class);
- assertSaxResponseParserClassEquals(method, ListDomainsResponseHandler.class);
- assertExceptionParserClassEquals(method, null);
-
- checkFilters(request);
- }
-
- public void testCreateDomainInRegion() throws SecurityException, NoSuchMethodException, IOException {
- Method method = SimpleDBAsyncClient.class.getMethod("createDomainInRegion", String.class, String.class);
- HttpRequest request = processor.createRequest(method, null, "domainName");
-
- assertRequestLineEquals(request, "POST https://sdb.amazonaws.com/ HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "Host: sdb.amazonaws.com\n");
- assertPayloadEquals(request, "Version=2009-04-15&Action=CreateDomain&DomainName=domainName",
- "application/x-www-form-urlencoded", false);
-
- assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertExceptionParserClassEquals(method, null);
-
- checkFilters(request);
- }
-
- // TODO fix this test as it has the wrong arg type
- @Test(enabled = false)
- public void testPutAttributes() throws SecurityException, NoSuchMethodException, IOException {
- Method method = SimpleDBAsyncClient.class.getMethod("putAttributes", String.class, String.class, Map.class);
- HttpRequest request = processor.createRequest(method, null, "domainName");
-
- assertRequestLineEquals(request, "POST https://sdb.amazonaws.com/ HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "Host: sdb.amazonaws.com\n");
- assertPayloadEquals(request, "Version=2009-04-15&Action=PutAttributes&DomainName=domainName&ItemName=itemName"
- + "&Attribute.1.Name=name" + "&Attribute.1.Value=fuzzy" + "&Attribute.1.Replace=true",
- "application/x-www-form-urlencoded", false);
-
- assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertExceptionParserClassEquals(method, null);
-
- checkFilters(request);
- }
-
- @Override
- protected void checkFilters(HttpRequest request) {
- assertEquals(request.getFilters().size(), 1);
- assertEquals(request.getFilters().get(0).getClass(), FormSigner.class);
- }
-
- @Override
- protected TypeLiteral<RestAnnotationProcessor<SimpleDBAsyncClient>> createTypeLiteral() {
- return new TypeLiteral<RestAnnotationProcessor<SimpleDBAsyncClient>>() {
- };
- }
-
- @Override
- protected Module createModule() {
- return new TestSimpleDBRestClientModule();
- }
-
- @Override
- public RestContextSpec<?, ?> createContextSpec() {
- // TODO take this out, when the service is registered in jclouds-core/rest.properties
- Properties restProperties = new Properties();
- restProperties.setProperty(provider + ".contextbuilder", SimpleDBContextBuilder.class.getName());
- restProperties.setProperty(provider + ".propertiesbuilder", SimpleDBPropertiesBuilder.class.getName());
- return new RestContextFactory(restProperties).createContextSpec(provider, "foo", "bar", getProperties());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java b/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java
deleted file mode 100644
index dc60197..0000000
--- a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/SimpleDBClientLiveTest.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Properties;
-import java.util.Set;
-import java.util.SortedSet;
-
-import org.jclouds.Constants;
-import org.jclouds.logging.log4j.config.Log4JLoggingModule;
-import org.jclouds.rest.RestContext;
-import org.jclouds.rest.RestContextFactory;
-import org.jclouds.simpledb.domain.ListDomainsResponse;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeGroups;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import com.google.inject.Module;
-
-/**
- * Tests behavior of {@code SimpleDBClient}
- *
- * @author Adrian Cole
- */
-@Test(groups = "live", sequential = true)
-public class SimpleDBClientLiveTest {
-
- protected SimpleDBClient client;
-
- private RestContext<SimpleDBClient, SimpleDBAsyncClient> context;
-
- protected Set<String> domains = Sets.newHashSet();
- protected String provider = "simpledb";
- protected String identity;
- protected String credential;
- protected String endpoint;
- protected String apiVersion;
-
- protected void setupCredentials() {
- identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity");
- credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider
- + ".credential");
- endpoint = System.getProperty("test." + provider + ".endpoint");
- apiVersion = System.getProperty("test." + provider + ".api-version");
- }
-
- protected Properties setupProperties() {
- Properties overrides = new Properties();
- overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
- overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
- overrides.setProperty(provider + ".identity", identity);
- if (credential != null)
- overrides.setProperty(provider + ".credential", credential);
- if (endpoint != null)
- overrides.setProperty(provider + ".endpoint", endpoint);
- if (apiVersion != null)
- overrides.setProperty(provider + ".api-version", apiVersion);
- return overrides;
- }
-
- @BeforeGroups(groups = { "live" })
- public void setupClient() {
- setupCredentials();
- Properties overrides = setupProperties();
- context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()),
- overrides);
- this.client = context.getApi();
- }
-
- @Test
- protected void testListDomains() throws InterruptedException {
- listDomainInRegion(null);
- }
-
- protected void listDomainInRegion(String region) throws InterruptedException {
- SortedSet<String> 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";
-
- protected String createDomainInRegion(String region, String domainName) throws InterruptedException {
- try {
- SortedSet<String> 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) {
-
- }
- 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;
- }
-
- @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);
- assert domains.contains(domain) : domain + " not in " + domains;
- }
- });
- }
-
- private static final int INCONSISTENCY_WINDOW = 10000;
-
- /**
- * Due to eventual consistency, container commands may not return correctly immediately. Hence,
- * we will try up to the inconsistency window to see if the assertion completes.
- */
- protected static void assertEventually(Runnable assertion) throws InterruptedException {
- long start = System.currentTimeMillis();
- AssertionError error = null;
- for (int i = 0; i < 30; i++) {
- try {
- assertion.run();
- if (i > 0)
- System.err.printf("%d attempts and %dms asserting %s%n", i + 1, System.currentTimeMillis() - start,
- assertion.getClass().getSimpleName());
- return;
- } catch (AssertionError e) {
- error = e;
- }
- Thread.sleep(INCONSISTENCY_WINDOW / 30);
- }
- if (error != null)
- throw error;
- }
-
- @AfterTest
- public void shutdown() {
- context.close();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/options/ListDomainsOptionsTest.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/options/ListDomainsOptionsTest.java b/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/options/ListDomainsOptionsTest.java
deleted file mode 100644
index 880b929..0000000
--- a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/options/ListDomainsOptionsTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.options;
-
-import static org.jclouds.simpledb.options.ListDomainsOptions.Builder.maxNumberOfDomains;
-import static org.jclouds.simpledb.options.ListDomainsOptions.Builder.nextToken;
-import static org.testng.Assert.assertEquals;
-
-import java.util.Collections;
-
-import org.jclouds.http.options.HttpRequestOptions;
-import org.testng.annotations.Test;
-
-/**
- * Tests possible uses of ListDomainsOptions and ListDomainsOptions.Builder.*
- *
- * @author Adrian Cole
- */
-public class ListDomainsOptionsTest {
-
- @Test
- public void testAssignability() {
- assert HttpRequestOptions.class.isAssignableFrom(ListDomainsOptions.class);
- assert !String.class.isAssignableFrom(ListDomainsOptions.class);
- }
-
- @Test
- public void testNextToken() {
- ListDomainsOptions options = new ListDomainsOptions();
- options.nextToken("test");
- assertEquals(options.buildFormParameters().get("NextToken"), Collections.singletonList("test"));
- }
-
- @Test
- public void testNullNextToken() {
- ListDomainsOptions options = new ListDomainsOptions();
- assertEquals(options.buildFormParameters().get("NextToken"), Collections.EMPTY_LIST);
- }
-
- @Test
- public void testNextTokenStatic() {
- ListDomainsOptions options = nextToken("test");
- assertEquals(options.buildFormParameters().get("NextToken"), Collections.singletonList("test"));
- }
-
- public void testInvalidMaxNumberOfDomainsZero() {
- maxNumberOfDomains(0);
- }
-
- public void testInvalidMaxNumberOfDomainsOver100() {
- maxNumberOfDomains(101);
- }
-
- @Test
- public void testMaxNumberOfDomains() {
- ListDomainsOptions options = new ListDomainsOptions();
- options.maxNumberOfDomains(1);
- assertEquals(options.buildFormParameters().get("MaxNumberOfDomains"), Collections.singletonList("1"));
- }
-
- @Test
- public void testNullMaxNumberOfDomains() {
- ListDomainsOptions options = new ListDomainsOptions();
- assertEquals(options.buildFormParameters().get("MaxNumberOfDomains"), Collections.EMPTY_LIST);
- }
-
- @Test
- public void testMaxNumberOfDomainsStatic() {
- ListDomainsOptions options = maxNumberOfDomains(1);
- assertEquals(options.buildFormParameters().get("MaxNumberOfDomains"), Collections.singletonList("1"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/xml/ListDomainsResponseHandlerTest.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/xml/ListDomainsResponseHandlerTest.java b/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/xml/ListDomainsResponseHandlerTest.java
deleted file mode 100644
index 94424d3..0000000
--- a/sandbox-apis/simpledb/src/test/java/org/jclouds/simpledb/xml/ListDomainsResponseHandlerTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.xml;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.InputStream;
-
-import org.jclouds.http.functions.BaseHandlerTest;
-import org.jclouds.simpledb.domain.ListDomainsResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Tests behavior of {@code ListDomainsResponseHandler}
- *
- * @author Adrian Cole
- */
-// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
-@Test(groups = "unit", testName = "ListDomainsResponseHandlerTest")
-public class ListDomainsResponseHandlerTest extends BaseHandlerTest {
-
- public void test() {
- InputStream is = getClass().getResourceAsStream("/list_domains.xml");
-
- ListDomainsResponse result = factory.create(injector.getInstance(ListDomainsResponseHandler.class)).parse(is);
-
- assertEquals(
- result,
- new ListDomainsResponseHandler.ListDomainsResponseImpl(ImmutableSet.of("Domain1-200706011651",
- "Domain2-200706011652"), "TWV0ZXJpbmdUZXN0RG9tYWluMS0yMDA3MDYwMTE2NTY"));
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/test/resources/list_domains.xml
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/test/resources/list_domains.xml b/sandbox-apis/simpledb/src/test/resources/list_domains.xml
deleted file mode 100644
index bd5595c..0000000
--- a/sandbox-apis/simpledb/src/test/resources/list_domains.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<ListDomainsResponse>
- <ListDomainsResult>
- <DomainName>Domain1-200706011651</DomainName>
- <DomainName>Domain2-200706011652</DomainName>
- <NextToken>TWV0ZXJpbmdUZXN0RG9tYWluMS0yMDA3MDYwMTE2NTY=</NextToken>
- </ListDomainsResult>
- <ResponseMetadata>
- <RequestId>eb13162f-1b95-4511-8b12-489b86acfd28</RequestId>
- <BoxUsage>0.0000219907</BoxUsage>
- </ResponseMetadata>
-</ListDomainsResponse>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/simpledb/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/sandbox-apis/simpledb/src/test/resources/log4j.xml b/sandbox-apis/simpledb/src/test/resources/log4j.xml
deleted file mode 100644
index bca086b..0000000
--- a/sandbox-apis/simpledb/src/test/resources/log4j.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
- <!--
- For more configuration infromation and examples see the Apache
- Log4j website: http://logging.apache.org/log4j/
- -->
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
- debug="false">
-
- <!-- A time/date based rolling appender -->
- <appender name="WIREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-wire.log" />
- <param name="Append" value="true" />
-
- <!-- Rollover at midnight each day -->
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
-
- <param name="Threshold" value="TRACE" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
-
- <!--
- The full pattern: Date MS Priority [Category]
- (Thread:NDC) Message\n <param name="ConversionPattern"
- value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- -->
- </layout>
- </appender>
-
- <!-- A time/date based rolling appender -->
- <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds.log" />
- <param name="Append" value="true" />
-
- <!-- Rollover at midnight each day -->
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
-
- <param name="Threshold" value="TRACE" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
-
- <!--
- The full pattern: Date MS Priority [Category]
- (Thread:NDC) Message\n <param name="ConversionPattern"
- value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- -->
- </layout>
- </appender>
-
- <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="FILE" />
- </appender>
-
- <appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="WIREFILE" />
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jclouds">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNC" />
- </category>
-
- <category name="jclouds.headers">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCWIRE" />
- </category>
-
- <category name="jclouds.wire">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCWIRE" />
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <priority value="WARN" />
- </root>
-
-</log4j:configuration>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-drivers/asynchttpclient/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox-drivers/asynchttpclient/pom.xml b/sandbox-drivers/asynchttpclient/pom.xml
deleted file mode 100644
index db2faa9..0000000
--- a/sandbox-drivers/asynchttpclient/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to jclouds, Inc. (jclouds) under one or more
- contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. jclouds licenses this file
- to you 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>1.5.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-asynchttpclient</artifactId>
- <name>jclouds Ning Http Client</name>
- <description>Ning Http client</description>
- <packaging>bundle</packaging>
-
- <properties>
- <jclouds.osgi.export>org.jclouds.http.ning*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
- </properties>
- <!-- bootstrapping: need to fetch the project POM -->
- <repositories>
- <repository>
- <id>jclouds-sona-snapshots-nexus</id>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.ning</groupId>
- <artifactId>async-http-client</artifactId>
- <version>1.7.4</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-security</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/NingHttpCommandExecutorService.java
----------------------------------------------------------------------
diff --git a/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/NingHttpCommandExecutorService.java b/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/NingHttpCommandExecutorService.java
deleted file mode 100644
index de50d57..0000000
--- a/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/NingHttpCommandExecutorService.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.http.ning;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Throwables.propagate;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-import javax.inject.Singleton;
-import javax.ws.rs.core.HttpHeaders;
-
-import org.jclouds.JcloudsVersion;
-import org.jclouds.crypto.CryptoStreams;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpCommandExecutorService;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpRequestFilter;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.handlers.DelegatingErrorHandler;
-import org.jclouds.http.handlers.DelegatingRetryHandler;
-import org.jclouds.http.internal.BaseHttpCommandExecutorService;
-import org.jclouds.io.Payload;
-import org.jclouds.io.Payloads;
-import org.jclouds.io.payloads.FilePayload;
-import org.jclouds.rest.internal.RestAnnotationProcessor;
-
-import com.google.common.base.Function;
-import com.google.common.base.Throwables;
-import com.google.common.collect.LinkedHashMultimap;
-import com.google.common.collect.Multimap;
-import com.google.common.io.Closeables;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.inject.Inject;
-import com.ning.http.client.AsyncHttpClient;
-import com.ning.http.client.Request;
-import com.ning.http.client.RequestBuilder;
-import com.ning.http.client.Response;
-import com.ning.http.client.generators.InputStreamBodyGenerator;
-
-/**
- * Todo Write me
- *
- * @author Sam Tunnicliffe
- * @author Adrian Cole
- */
-public class NingHttpCommandExecutorService implements HttpCommandExecutorService {
-
- //TODO: get async version from maven or something
- public static final String USER_AGENT = String.format("jclouds/%s async-http-client/%s", JcloudsVersion.get(), "1.7.4");
-
- private final AsyncHttpClient client;
- private final ConvertToNingRequest convertToNingRequest;
- private final ConvertToJCloudsResponse convertToJCloudsResponse;
- private final DelegatingRetryHandler retryHandler;
- private final DelegatingErrorHandler errorHandler;
-
- @Inject
- public NingHttpCommandExecutorService(AsyncHttpClient client, ConvertToNingRequest convertToNingRequest,
- ConvertToJCloudsResponse convertToJCloudsResponse, DelegatingRetryHandler retryHandler,
- DelegatingErrorHandler errorHandler) {
- this.client = client;
- this.convertToNingRequest = convertToNingRequest;
- this.convertToJCloudsResponse = convertToJCloudsResponse;
- this.retryHandler = retryHandler;
- this.errorHandler = errorHandler;
- }
-
- @Override
- public ListenableFuture<HttpResponse> submit(HttpCommand command) {
- try {
- for (;;) {
- Future<Response> responseF = client.executeRequest(convertToNingRequest.apply(command.getCurrentRequest()));
- final HttpResponse httpResponse = convertToJCloudsResponse.apply(responseF.get());
- int statusCode = httpResponse.getStatusCode();
- if (statusCode >= 300) {
- if (retryHandler.shouldRetryRequest(command, httpResponse)) {
- continue;
- } else {
- errorHandler.handleError(command, httpResponse);
- return Futures.immediateFuture(httpResponse);
- }
- } else {
- return Futures.immediateFuture(httpResponse);
- }
- }
-
- } catch (IOException e) {
- throw Throwables.propagate(e);
- } catch (InterruptedException e) {
- throw Throwables.propagate(e);
- } catch (ExecutionException e) {
- throw Throwables.propagate(e);
- }
- }
-
- @Singleton
- public static class ConvertToNingRequest implements Function<HttpRequest, Request> {
-
- public Request apply(HttpRequest request) {
-
- for (HttpRequestFilter filter : request.getFilters()) {
- request = filter.filter(request);
- }
-
- RequestBuilder builder = new RequestBuilder(request.getMethod());
- builder.setUrl(request.getEndpoint().toASCIIString());
- Payload payload = request.getPayload();
- if (payload != null) {
- boolean chunked = "chunked".equals(request.getFirstHeaderOrNull("Transfer-Encoding"));
-
- if (request.getPayload().getContentMetadata().getContentMD5() != null)
- builder.addHeader("Content-MD5", CryptoStreams.base64(request.getPayload().getContentMetadata()
- .getContentMD5()));
- if (request.getPayload().getContentMetadata().getContentType() != null)
- builder.addHeader(HttpHeaders.CONTENT_TYPE, request.getPayload().getContentMetadata().getContentType());
- if (request.getPayload().getContentMetadata().getContentLanguage() != null)
- builder.addHeader(HttpHeaders.CONTENT_LANGUAGE, request.getPayload().getContentMetadata()
- .getContentLanguage());
- if (request.getPayload().getContentMetadata().getContentEncoding() != null)
- builder.addHeader(HttpHeaders.CONTENT_ENCODING, request.getPayload().getContentMetadata()
- .getContentEncoding());
- if (request.getPayload().getContentMetadata().getContentDisposition() != null)
- builder.addHeader("Content-Disposition", request.getPayload().getContentMetadata()
- .getContentDisposition());
- if (!chunked) {
- Long length = checkNotNull(request.getPayload().getContentMetadata().getContentLength(),
- "payload.getContentLength");
- builder.addHeader(HttpHeaders.CONTENT_LENGTH, length.toString());
- }
- setPayload(builder, payload);
- } else {
- builder.addHeader(HttpHeaders.CONTENT_LENGTH, "0");
- }
-
- builder.addHeader(HttpHeaders.USER_AGENT, USER_AGENT);
- for (String header : request.getHeaders().keySet()) {
- for (String value : request.getHeaders().get(header)) {
- builder.addHeader(header, value);
- }
- }
-
- return builder.build();
- }
-
- void setPayload(RequestBuilder requestBuilder, Payload payload) {
- if (payload instanceof FilePayload) {
- requestBuilder.setBody(((FilePayload) payload).getRawContent());
- } else {
- requestBuilder.setBody(new InputStreamBodyGenerator(payload.getInput()));
- }
- }
- }
-
- @Singleton
- public static class ConvertToJCloudsResponse implements Function<Response, HttpResponse> {
-
- public HttpResponse apply(Response nativeResponse) {
-
- InputStream in = null;
- try {
- in = BaseHttpCommandExecutorService.consumeOnClose(nativeResponse.getResponseBodyAsStream());
- } catch (IOException e) {
- Closeables.closeQuietly(in);
- throw propagate(e);
- }
-
- Payload payload = in != null ? Payloads.newInputStreamPayload(in) : null;
- Multimap<String, String> headers = LinkedHashMultimap.create();
- for (Entry<String, List<String>> header : nativeResponse.getHeaders()) {
- headers.putAll(header.getKey(), header.getValue());
- }
- if (payload != null)
- payload.getContentMetadata().setPropertiesFromHttpHeaders(headers);
- return new HttpResponse(nativeResponse.getStatusCode(), nativeResponse.getStatusText(), payload,
- RestAnnotationProcessor.filterOutContentHeaders(headers));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/config/NingHttpCommandExecutorServiceModule.java
----------------------------------------------------------------------
diff --git a/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/config/NingHttpCommandExecutorServiceModule.java b/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/config/NingHttpCommandExecutorServiceModule.java
deleted file mode 100644
index 520cf35..0000000
--- a/sandbox-drivers/asynchttpclient/src/main/java/org/jclouds/http/ning/config/NingHttpCommandExecutorServiceModule.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.http.ning.config;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpCommandExecutorService;
-import org.jclouds.http.TransformingHttpCommandExecutorService;
-import org.jclouds.http.TransformingHttpCommandExecutorServiceImpl;
-import org.jclouds.http.config.ConfiguresHttpCommandExecutorService;
-import org.jclouds.http.ning.NingHttpCommandExecutorService;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-import com.google.inject.Scopes;
-import com.ning.http.client.AsyncHttpClient;
-import com.ning.http.client.AsyncHttpClientConfig;
-
-/**
- * Configures {@link NingHttpCommandExecutorService}.
- *
- * Note that this uses threads
- *
- * @author Sam Tunnicliffe
- * @author Adrian Cole
- */
-@ConfiguresHttpCommandExecutorService
-public class NingHttpCommandExecutorServiceModule extends AbstractModule {
-
- @Override
- protected void configure() {
- bindClient();
- }
-
- @Singleton
- @Provides
- AsyncHttpClient provideNingClient() {
- AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().setFollowRedirects(true)
- .build();
- return new AsyncHttpClient(config);
- }
-
- protected void bindClient() {
- bind(HttpCommandExecutorService.class).to(NingHttpCommandExecutorService.class).in(
- Scopes.SINGLETON);
-
- bind(TransformingHttpCommandExecutorService.class).to(
- TransformingHttpCommandExecutorServiceImpl.class).in(Scopes.SINGLETON);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-drivers/asynchttpclient/src/test/java/org/jclouds/http/ning/NingHttpCommandExecutorServiceTest.java
----------------------------------------------------------------------
diff --git a/sandbox-drivers/asynchttpclient/src/test/java/org/jclouds/http/ning/NingHttpCommandExecutorServiceTest.java b/sandbox-drivers/asynchttpclient/src/test/java/org/jclouds/http/ning/NingHttpCommandExecutorServiceTest.java
deleted file mode 100644
index 51d9be9..0000000
--- a/sandbox-drivers/asynchttpclient/src/test/java/org/jclouds/http/ning/NingHttpCommandExecutorServiceTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.http.ning;
-
-import static org.jclouds.Constants.PROPERTY_CONNECTION_TIMEOUT;
-import static org.jclouds.Constants.PROPERTY_IO_WORKER_THREADS;
-import static org.jclouds.Constants.PROPERTY_MAX_CONNECTIONS_PER_CONTEXT;
-import static org.jclouds.Constants.PROPERTY_MAX_CONNECTIONS_PER_HOST;
-import static org.jclouds.Constants.PROPERTY_SO_TIMEOUT;
-import static org.jclouds.Constants.PROPERTY_USER_THREADS;
-
-import java.util.Properties;
-
-import org.jclouds.http.BaseHttpCommandExecutorServiceIntegrationTest;
-import org.jclouds.http.ning.config.NingHttpCommandExecutorServiceModule;
-import org.testng.annotations.Test;
-
-import com.google.inject.Module;
-
-/**
- * Tests the functionality of the {@link ApacheHCHttpCommandExecutorService}
- *
- * @author Adrian Cole
- */
-@Test(testName = "NingHttpCommandExecutorServiceTest")
-public class NingHttpCommandExecutorServiceTest extends BaseHttpCommandExecutorServiceIntegrationTest {
- static {
- System.setProperty("http.conn-manager.timeout", 1000 + "");
- }
-
- protected Module createConnectionModule() {
- return new NingHttpCommandExecutorServiceModule();
- }
-
- protected void addConnectionProperties(Properties props) {
- props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 20 + "");
- props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 0 + "");
- props.setProperty(PROPERTY_CONNECTION_TIMEOUT, 100 + "");
- props.setProperty(PROPERTY_SO_TIMEOUT, 100 + "");
- props.setProperty(PROPERTY_IO_WORKER_THREADS, 3 + "");
- props.setProperty(PROPERTY_USER_THREADS, 0 + "");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-drivers/asynchttpclient/src/test/resources/test.jks
----------------------------------------------------------------------
diff --git a/sandbox-drivers/asynchttpclient/src/test/resources/test.jks b/sandbox-drivers/asynchttpclient/src/test/resources/test.jks
deleted file mode 100644
index e641fb5..0000000
Binary files a/sandbox-drivers/asynchttpclient/src/test/resources/test.jks and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/pom.xml b/sandbox-providers/aws-simpledb/pom.xml
deleted file mode 100644
index 401013b..0000000
--- a/sandbox-providers/aws-simpledb/pom.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to jclouds, Inc. (jclouds) under one or more
- contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. jclouds licenses this file
- to you 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>1.5.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.jclouds.provider</groupId>
- <artifactId>aws-simpledb</artifactId>
- <name>jclouds Amazon SimpleDB provider</name>
- <description>SimpleDB implementation targeted to Amazon Web Services</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.aws-simpledb.endpoint>https://sdb.amazonaws.com</test.aws-simpledb.endpoint>
- <test.aws-simpledb.api-version>2009-04-15</test.aws-simpledb.api-version>
- <test.aws-simpledb.build-version></test.aws-simpledb.build-version>
- <test.aws-simpledb.identity>${test.aws.identity}</test.aws-simpledb.identity>
- <test.aws-simpledb.credential>${test.aws.credential}</test.aws-simpledb.credential>
-
- <jclouds.osgi.export>org.jclouds.aws.simpledb*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>simpledb</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>simpledb</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.aws-simpledb.endpoint>${test.aws-simpledb.endpoint}</test.aws-simpledb.endpoint>
- <test.aws-simpledb.api-version>${test.aws-simpledb.api-version}</test.aws-simpledb.api-version>
- <test.aws-simpledb.build-version>${test.aws-simpledb.build-version}</test.aws-simpledb.build-version>
- <test.aws-simpledb.identity>${test.aws-simpledb.identity}</test.aws-simpledb.identity>
- <test.aws-simpledb.credential>${test.aws-simpledb.credential}</test.aws-simpledb.credential>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
-
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBPropertiesBuilder.java
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBPropertiesBuilder.java b/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBPropertiesBuilder.java
deleted file mode 100644
index 6d03226..0000000
--- a/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBPropertiesBuilder.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.aws.simpledb;
-
-import static org.jclouds.Constants.PROPERTY_ENDPOINT;
-import static org.jclouds.aws.domain.Region.AP_NORTHEAST_1;
-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.SA_EAST_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.domain.Region.US_WEST_2;
-import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG;
-import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION;
-
-import java.util.Properties;
-
-import org.jclouds.aws.domain.Region;
-
-/**
- * Builds properties used in SimpleDB Clients
- *
- * @author Adrian Cole
- */
-public class AWSSimpleDBPropertiesBuilder extends org.jclouds.simpledb.SimpleDBPropertiesBuilder {
-
- @Override
- protected Properties defaultProperties() {
- Properties properties = super.defaultProperties();
- properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
- properties.putAll(Region.regionProperties());
-
- properties.setProperty(PROPERTY_ENDPOINT, "https://sdb.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + US_EAST_1 + ".endpoint", "https://sdb.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + US_WEST_1 + ".endpoint",
- "https://sdb.us-west-1.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + US_WEST_2 + ".endpoint",
- "https://sdb.us-west-2.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + SA_EAST_1 + ".endpoint",
- "https://sdb.sa-east-1.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + EU_WEST_1 + ".endpoint",
- "https://sdb.eu-west-1.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + AP_SOUTHEAST_1 + ".endpoint",
- "https://sdb.ap-southeast-1.amazonaws.com");
- properties.setProperty(PROPERTY_REGION + "." + AP_NORTHEAST_1 + ".endpoint",
- "https://sdb.ap-northeast-1.amazonaws.com");
- return properties;
- }
-
- public AWSSimpleDBPropertiesBuilder() {
- super();
- }
-
- public AWSSimpleDBPropertiesBuilder(Properties properties) {
- super(properties);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderMetadata.java
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderMetadata.java b/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderMetadata.java
deleted file mode 100644
index a8b2dfc..0000000
--- a/sandbox-providers/aws-simpledb/src/main/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderMetadata.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.aws.simpledb;
-
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.providers.BaseProviderMetadata;
-import org.jclouds.providers.ProviderMetadata;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Implementation of @ link org.jclouds.types.ProviderMetadata} for Amazon's SimpleDB provider.
- *
- * @author Adrian Cole
- */
-public class AWSSimpleDBProviderMetadata extends BaseProviderMetadata {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getId() {
- return "aws-simpledb";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getType() {
- return ProviderMetadata.TABLE_TYPE;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getName() {
- return "Amazon SimpleDB";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getIdentityName() {
- return "Access Key ID";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getCredentialName() {
- return "Secret Access Key";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public URI getHomepage() {
- return URI.create("http://aws.amazon.com/simpledb");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public URI getConsole() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public URI getApiDocumentation() {
- return URI.create("http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Set<String> getLinkedServices() {
- return ImmutableSet.of("aws-s3", "aws-ec2", "aws-elb", "aws-simpledb");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Set<String> getIso3166Codes() {
- return ImmutableSet.of("US-VA", "US-CA", "US-OR", "BR-SP", "IE", "SG", "JP-13");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/sandbox-providers/aws-simpledb/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
deleted file mode 100644
index 2e3fd4f..0000000
--- a/sandbox-providers/aws-simpledb/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.aws.simpledb.AWSSimpleDBProviderMetadata
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBAsyncClientTest.java
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBAsyncClientTest.java b/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBAsyncClientTest.java
deleted file mode 100644
index fc80d04..0000000
--- a/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBAsyncClientTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.aws.simpledb;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Properties;
-
-import org.jclouds.aws.domain.Region;
-import org.jclouds.rest.RestContextFactory;
-import org.jclouds.rest.RestContextSpec;
-import org.jclouds.simpledb.SimpleDBAsyncClient;
-import org.jclouds.simpledb.SimpleDBAsyncClientTest;
-import org.testng.annotations.Test;
-
-/**
- * Tests behavior of {@code SimpleDBAsyncClient}
- *
- * @author Adrian Cole
- */
-// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
-@Test(groups = "unit", testName = "aws.SimpleDBAsyncClientTest")
-public class AWSSimpleDBAsyncClientTest extends SimpleDBAsyncClientTest {
-
- public AWSSimpleDBAsyncClientTest() {
- this.provider = "aws-simpledb";
- }
-
- @Override
- protected Properties getProperties() {
- return RestContextFactory.getPropertiesFromResource("/rest.properties");
- }
-
- public void testAllRegions() throws SecurityException, NoSuchMethodException, IOException {
- Method method = SimpleDBAsyncClient.class.getMethod("createDomainInRegion", String.class, String.class);
- for (String region : Region.DEFAULT_REGIONS) {
- processor.createRequest(method, region, "domainName");
- }
- }
-
- @Override
- public RestContextSpec<?, ?> createContextSpec() {
- return new RestContextFactory().createContextSpec(provider, "foo", "bar", getProperties());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBClientLiveTest.java
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBClientLiveTest.java b/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBClientLiveTest.java
deleted file mode 100644
index e9f3e81..0000000
--- a/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBClientLiveTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.aws.simpledb;
-
-import org.jclouds.aws.domain.Region;
-import org.jclouds.simpledb.SimpleDBClientLiveTest;
-import org.testng.annotations.Test;
-
-/**
- * Tests behavior of {@code SimpleDBClient}
- *
- * @author Adrian Cole
- */
-@Test(groups = "live", sequential = true, testName = "AWSSimpleDBClientLiveTest")
-public class AWSSimpleDBClientLiveTest extends SimpleDBClientLiveTest {
- public AWSSimpleDBClientLiveTest(){
- provider = "aws-simpledb";
- }
- @Test
- void testListDomainsInRegion() throws InterruptedException {
- for (String region : Region.DEFAULT_REGIONS) {
- listDomainInRegion(region);
- }
- }
-
- @Test
- void testCreateDomainInRegions() throws InterruptedException {
- String domainName = PREFIX + "1";
- for (String region : Region.DEFAULT_REGIONS) {
- domainName = createDomainInRegion(region, domainName);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderTest.java
----------------------------------------------------------------------
diff --git a/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderTest.java b/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderTest.java
deleted file mode 100644
index 0ebab75..0000000
--- a/sandbox-providers/aws-simpledb/src/test/java/org/jclouds/aws/simpledb/AWSSimpleDBProviderTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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.aws.simpledb;
-
-import org.jclouds.providers.BaseProviderMetadataTest;
-import org.jclouds.providers.ProviderMetadata;
-import org.testng.annotations.Test;
-
-/**
- * The AWSSimpleDBProviderTest tests the org.jclouds.providers.AWSSimpleDBProvider class.
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "AWSSimpleDBProviderTest")
-public class AWSSimpleDBProviderTest extends BaseProviderMetadataTest {
-
- public AWSSimpleDBProviderTest() {
- super(new AWSSimpleDBProviderMetadata(), ProviderMetadata.TABLE_TYPE);
- }
-}
\ No newline at end of file