Issue 440: added provider module for googlestorage

This commit is contained in:
Adrian Cole 2011-01-04 23:41:38 +01:00
parent 7b3c1982cf
commit a6145cfae9
17 changed files with 647 additions and 124 deletions

View File

@ -39,6 +39,11 @@
<artifactId>aws-s3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>googlestorage</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-azure</artifactId>

View File

@ -82,6 +82,8 @@ import com.google.inject.Module;
@Test(groups = "unit", testName = "S3AsyncClientTest")
public class S3AsyncClientTest extends BaseS3AsyncClientTest {
protected String url = "s3.amazonaws.com";
public void testAllRegions() throws SecurityException, NoSuchMethodException, IOException {
Method method = S3AsyncClient.class.getMethod("putBucketInRegion", String.class, String.class,
Array.newInstance(PutBucketOptions.class, 0).getClass());
@ -94,16 +96,16 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("getBucketLocation", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/?location HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/?location HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
request = filter.filter(request);
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/?location HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
"Authorization: AWS identity:2fFTeYJTDwiJmaAkKj732RjNbOg=\nDate: 2009-11-08T15:54:08.897Z\nHost: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/?location HTTP/1.1");
assertNonPayloadHeadersEqual(request,
"Authorization: AWS identity:2fFTeYJTDwiJmaAkKj732RjNbOg=\nDate: 2009-11-08T15:54:08.897Z\nHost: bucket."
+ url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -117,8 +119,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("getBucketPayer", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/?requestPayment HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/?requestPayment HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -132,12 +134,10 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("setBucketPayer", String.class, Payer.class);
HttpRequest request = processor.createRequest(method, "bucket", Payer.BUCKET_OWNER);
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/?requestPayment HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertPayloadEquals(
request,
"<RequestPaymentConfiguration xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Payer>BucketOwner</Payer></RequestPaymentConfiguration>",
"text/xml", false);
assertRequestLineEquals(request, "PUT https://bucket." + url + "/?requestPayment HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, "<RequestPaymentConfiguration xmlns=\"http://" + url
+ "/doc/2006-03-01/\"><Payer>BucketOwner</Payer></RequestPaymentConfiguration>", "text/xml", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -150,12 +150,10 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("setBucketPayer", String.class, Payer.class);
HttpRequest request = processor.createRequest(method, "bucket", Payer.REQUESTER);
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/?requestPayment HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertPayloadEquals(
request,
"<RequestPaymentConfiguration xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Payer>Requester</Payer></RequestPaymentConfiguration>",
"text/xml", false);
assertRequestLineEquals(request, "PUT https://bucket." + url + "/?requestPayment HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, "<RequestPaymentConfiguration xmlns=\"http://" + url
+ "/doc/2006-03-01/\"><Payer>Requester</Payer></RequestPaymentConfiguration>", "text/xml", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -169,8 +167,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Array.newInstance(ListBucketOptions.class, 0).getClass());
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -184,8 +182,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("bucketExists", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "HEAD https://bucket.s3.amazonaws.com/?max-keys=0 HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "HEAD https://bucket." + url + "/?max-keys=0 HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@ -211,9 +209,9 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
HttpRequest request = processor.createRequest(method, "sourceBucket", "sourceObject", "destinationbucket",
"destinationObject");
assertRequestLineEquals(request, "PUT https://destinationbucket.s3.amazonaws.com/destinationObject HTTP/1.1");
assertNonPayloadHeadersEqual(request,
"Host: destinationbucket.s3.amazonaws.com\nx-amz-copy-source: /sourceBucket/sourceObject\n");
assertRequestLineEquals(request, "PUT https://destinationbucket." + url + "/destinationObject HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: destinationbucket." + url
+ "\nx-amz-copy-source: /sourceBucket/sourceObject\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -227,8 +225,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("deleteBucketIfEmpty", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "DELETE https://bucket.s3.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "DELETE https://bucket." + url + "/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@ -242,8 +240,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("deleteObject", String.class, String.class);
HttpRequest request = processor.createRequest(method, "bucket", "object");
assertRequestLineEquals(request, "DELETE https://bucket.s3.amazonaws.com/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "DELETE https://bucket." + url + "/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -258,8 +256,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("getBucketACL", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -274,8 +272,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("getObject", String.class, String.class, GetOptions[].class);
HttpRequest request = processor.createRequest(method, "bucket", "object");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseObjectFromHeadersAndHttpContent.class);
@ -290,8 +288,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("getObjectACL", String.class, String.class);
HttpRequest request = processor.createRequest(method, "bucket", "object");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/object?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/object?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -306,8 +304,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("objectExists", String.class, String.class);
HttpRequest request = processor.createRequest(method, "bucket", "object");
assertRequestLineEquals(request, "HEAD https://bucket.s3.amazonaws.com/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "HEAD https://bucket." + url + "/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@ -322,8 +320,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("headObject", String.class, String.class);
HttpRequest request = processor.createRequest(method, "bucket", "object");
assertRequestLineEquals(request, "HEAD https://bucket.s3.amazonaws.com/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "HEAD https://bucket." + url + "/object HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseObjectMetadataFromHeaders.class);
@ -337,8 +335,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("listOwnedBuckets");
HttpRequest request = processor.createRequest(method);
assertRequestLineEquals(request, "GET https://s3.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://" + url + "/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: " + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -358,11 +356,13 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
HttpRequest request = processor.createRequest(method, "bucket",
AccessControlList.fromCannedAccessPolicy(CannedAccessPolicy.PRIVATE, "1234"));
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "PUT https://bucket." + url + "/?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(
request,
"<AccessControlPolicy xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Owner><ID>1234</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1234</ID></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>",
"<AccessControlPolicy xmlns=\"http://"
+ url
+ "/doc/2006-03-01/\"><Owner><ID>1234</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1234</ID></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>",
"text/xml", false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@ -378,8 +378,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Array.newInstance(PutBucketOptions.class, 0).getClass());
HttpRequest request = processor.createRequest(method, (String) null, "bucket");
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "PUT https://bucket." + url + "/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@ -395,8 +395,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Array.newInstance(PutBucketOptions.class, 0).getClass());
HttpRequest request = processor.createRequest(method, "EU", "bucket");
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "PUT https://bucket." + url + "/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request,
"<CreateBucketConfiguration><LocationConstraint>EU</LocationConstraint></CreateBucketConfiguration>",
"text/xml", false);
@ -416,8 +416,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
HttpRequest request = processor.createRequest(method, "bucket",
blobToS3Object.apply(BindBlobToMultipartFormTest.TEST_BLOB));
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/hello HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "PUT https://bucket." + url + "/hello HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, "hello", "text/plain", false);
assertResponseParserClassEquals(method, request, ParseETagHeader.class);
@ -433,11 +433,13 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
HttpRequest request = processor.createRequest(method, "bucket", "key",
AccessControlList.fromCannedAccessPolicy(CannedAccessPolicy.PRIVATE, "1234"));
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/key?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "PUT https://bucket." + url + "/key?acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(
request,
"<AccessControlPolicy xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Owner><ID>1234</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1234</ID></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>",
"<AccessControlPolicy xmlns=\"http://"
+ url
+ "/doc/2006-03-01/\"><Owner><ID>1234</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1234</ID></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>",
"text/xml", false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@ -451,8 +453,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("getBucketLogging", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "GET https://bucket.s3.amazonaws.com/?logging HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "GET https://bucket." + url + "/?logging HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -466,10 +468,10 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
Method method = S3AsyncClient.class.getMethod("disableBucketLogging", String.class);
HttpRequest request = processor.createRequest(method, "bucket");
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/?logging HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertPayloadEquals(request, "<BucketLoggingStatus xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"/>",
"text/xml", false);
assertRequestLineEquals(request, "PUT https://bucket." + url + "/?logging HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, "<BucketLoggingStatus xmlns=\"http://" + url + "/doc/2006-03-01/\"/>", "text/xml",
false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -487,8 +489,8 @@ public class S3AsyncClientTest extends BaseS3AsyncClientTest {
new BucketLogging("mylogs", "access_log-", ImmutableSet.<Grant> of(new Grant(new EmailAddressGrantee(
"adrian@jclouds.org"), Permission.FULL_CONTROL))));
assertRequestLineEquals(request, "PUT https://bucket.s3.amazonaws.com/?logging HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket.s3.amazonaws.com\n");
assertRequestLineEquals(request, "PUT https://bucket." + url + "/?logging HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
assertPayloadEquals(request, Strings2.toStringAndClose(getClass().getResourceAsStream("/bucket_logging.xml")),
"text/xml", false);

View File

@ -81,58 +81,6 @@
</layout>
</appender>
<!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-compute.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="SSHFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-ssh.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="ASYNCCOMPUTE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="COMPUTEFILE" />
</appender>
<appender name="ASYNCSSH" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="SSHFILE" />
</appender>
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
@ -158,22 +106,15 @@
<appender-ref ref="ASYNCWIRE" />
</category>
<category name="jclouds.ssh">
<priority value="DEBUG" />
<appender-ref ref="ASYNCSSH" />
</category>
<category name="jclouds.wire">
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
<category name="jclouds.blobstore">
<priority value="DEBUG" />
<appender-ref ref="ASYNCBLOBSTORE" />
</category>
<category name="jclouds.compute">
<priority value="TRACE" />
<appender-ref ref="ASYNCCOMPUTE" />
</category>
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
@ -182,4 +123,4 @@
<priority value="WARN" />
</root>
</log4j:configuration>
</log4j:configuration>

View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
====================================================================
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.
====================================================================
-->
<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.provider</groupId>
<artifactId>jclouds-providers-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>googlestorage</artifactId>
<name>jclouds Google Storage for Developers provider</name>
<description>Simple Storage Service (S3) implementation targeted to Google Storage for Developers</description>
<properties>
<test.initializer>org.jclouds.googlestorage.blobstore.GoogleStorageTestInitializer</test.initializer>
<test.googlestorage.endpoint>https://commondatastorage.googleapis.com</test.googlestorage.endpoint>
<test.googlestorage.apiversion>2006-03-01</test.googlestorage.apiversion>
<test.googlestorage.identity>${test.googlestorage.identity}</test.googlestorage.identity>
<test.googlestorage.credential>${test.googlestorage.credential}</test.googlestorage.credential>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>s3</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>s3</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</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</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>
<systemProperties>
<property>
<name>test.googlestorage.endpoint</name>
<value>${test.googlestorage.endpoint}</value>
</property>
<property>
<name>test.googlestorage.apiversion</name>
<value>${test.googlestorage.apiversion}</value>
</property>
<property>
<name>test.googlestorage.identity</name>
<value>${test.googlestorage.identity}</value>
</property>
<property>
<name>test.googlestorage.credential</name>
<value>${test.googlestorage.credential}</value>
</property>
<property>
<name>test.initializer</name>
<value>${test.initializer}</value>
</property>
<property>
<name>jclouds.blobstore.httpstream.url</name>
<value>${jclouds.blobstore.httpstream.url}</value>
</property>
<property>
<name>jclouds.blobstore.httpstream.md5</name>
<value>${jclouds.blobstore.httpstream.md5}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,52 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties;
import org.jclouds.s3.S3PropertiesBuilder;
/**
* Builds properties used in Google Storage
*
* @author Adrian Cole
*/
public class GoogleStoragePropertiesBuilder extends S3PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_AUTH_TAG, "GOOG1");
properties.setProperty(PROPERTY_HEADER_TAG, "goog");
properties.setProperty(PROPERTY_REGIONS, "GoogleStorage");
properties.setProperty(PROPERTY_ENDPOINT, "https://commondatastorage.googleapis.com");
properties.setProperty(PROPERTY_ENDPOINT + ".GoogleStorage", "https://commondatastorage.googleapis.com");
return properties;
}
public GoogleStoragePropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,37 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(enabled = false, groups = "unit", testName = "GoogleStorageAsyncClientTest")
public class GoogleStorageAsyncClientTestDisabled extends org.jclouds.s3.S3AsyncClientTest {
public GoogleStorageAsyncClientTestDisabled() {
this.provider = "googlestorage";
this.url = "commondatastorage.googleapis.com";
}
// TODO parameterize this test so that it can pass
}

View File

@ -0,0 +1,33 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage;
import org.jclouds.s3.S3ClientLiveTest;
import org.testng.annotations.Test;
/**
* Tests behavior of {@code S3Client}
*
* @author Adrian Cole
*/
@Test(groups = "live", sequential = true, testName = "GoogleStorageClientLiveTest")
public class GoogleStorageClientLiveTest extends S3ClientLiveTest {
}

View File

@ -0,0 +1,40 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageBlobIntegrationLiveTest")
public class GoogleStorageBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
@Override
@Test(expectedExceptions = IllegalArgumentException.class)
public void testPutObjectStream() throws InterruptedException, IOException, ExecutionException {
super.testPutObjectStream();
}
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseBlobLiveTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageBlobLiveTest")
public class GoogleStorageBlobLiveTest extends BaseBlobLiveTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageBlobMapIntegrationLiveTest")
public class GoogleStorageBlobMapIntegrationLiveTest extends BaseBlobMapIntegrationTest {
}

View File

@ -0,0 +1,32 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseBlobSignerLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageBlobSignerLiveTest")
public class GoogleStorageBlobSignerLiveTest extends BaseBlobSignerLiveTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageContainerIntegrationLiveTest")
public class GoogleStorageContainerIntegrationLiveTest extends BaseContainerIntegrationTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseContainerLiveTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageContainerLiveTest")
public class GoogleStorageContainerLiveTest extends BaseContainerLiveTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageInputStreamMapIntegrationLiveTest")
public class GoogleStorageInputStreamMapIntegrationLiveTest extends BaseInputStreamMapIntegrationTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseServiceIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "GoogleStorageServiceIntegrationLiveTest")
public class GoogleStorageServiceIntegrationLiveTest extends BaseServiceIntegrationTest {
}

View File

@ -0,0 +1,51 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.googlestorage.blobstore;
import java.io.IOException;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.blobstore.BlobStoreContextFactory;
import org.jclouds.blobstore.integration.TransientBlobStoreTestInitializer;
import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
*
* @author Adrian Cole
*/
public class GoogleStorageTestInitializer extends TransientBlobStoreTestInitializer {
public GoogleStorageTestInitializer() {
provider = "googlestorage";
BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true;
}
@Override
protected BlobStoreContext createLiveContext(Module configurationModule, String endpoint, String apiversion,
String app, String identity, String credential) throws IOException {
return new BlobStoreContextFactory().createContext(provider, ImmutableSet.of(configurationModule,
new Log4JLoggingModule()), setupProperties(endpoint, apiversion, identity, credential));
}
}

View File

@ -39,5 +39,6 @@
<module>aws-simpledb</module>
<module>aws-elb</module>
<module>aws-s3</module>
<module>googlestorage</module>
</modules>
</project>