mirror of https://github.com/apache/jclouds.git
formatting
git-svn-id: http://jclouds.googlecode.com/svn/trunk@68 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
090a909be3
commit
86a2e33f7e
|
@ -111,7 +111,6 @@ public abstract class BaseHttpFutureCommandClientTest {
|
||||||
injector = Guice.createInjector(new AbstractModule() {
|
injector = Guice.createInjector(new AbstractModule() {
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
|
|
||||||
Names.bindProperties(binder(), properties);
|
Names.bindProperties(binder(), properties);
|
||||||
}
|
}
|
||||||
}, new HttpCommandsModule(), createClientModule(),
|
}, new HttpCommandsModule(), createClientModule(),
|
||||||
|
|
|
@ -78,9 +78,6 @@ public class S3IntegrationTest {
|
||||||
guiceLogger.setLevel(Level.ALL);
|
guiceLogger.setLevel(Level.ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected String bucketPrefix = System.getProperty("user.name")
|
|
||||||
+ "." + this.getClass().getName();
|
|
||||||
String badRequestWhenSourceIsDestBucketOnCopy400 = "<Error><Code>InvalidRequest</Code><Message>The Source and Destination may not be the same when the MetadataDirective is Copy.</Message><RequestId>54C77CAF4D42474B</RequestId><HostId>SJecknEUUUx88/65VAKbCdKSOCkpuVTeu7ZG9in9x9NTNglGnoxdbALCfS4k/DUZ</HostId></Error>";
|
String badRequestWhenSourceIsDestBucketOnCopy400 = "<Error><Code>InvalidRequest</Code><Message>The Source and Destination may not be the same when the MetadataDirective is Copy.</Message><RequestId>54C77CAF4D42474B</RequestId><HostId>SJecknEUUUx88/65VAKbCdKSOCkpuVTeu7ZG9in9x9NTNglGnoxdbALCfS4k/DUZ</HostId></Error>";
|
||||||
String noSuchSourceKeyOrBucketOnCopy404 = "<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>null</Key><RequestId>9CCDF1DACA78B36F</RequestId><HostId>63cqk9YsTFBVfBfks840JVGsepPEdQM42mU+r7HN35sF4Nk5xAcWDEUPaQpK2eFU</HostId></Error>";
|
String noSuchSourceKeyOrBucketOnCopy404 = "<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>null</Key><RequestId>9CCDF1DACA78B36F</RequestId><HostId>63cqk9YsTFBVfBfks840JVGsepPEdQM42mU+r7HN35sF4Nk5xAcWDEUPaQpK2eFU</HostId></Error>";
|
||||||
String noSuchDestinationBucketOnCopy404 = "<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><BucketName>copydestination</BucketName><RequestId>4F0CF319C5535975</RequestId><HostId>hdZyHOm7VK+JI2UCdye3d6TVkKhRBIoWflldXVDTKbgipYlamy8HgPBzHrUAVQNJ</HostId></Error>";
|
String noSuchDestinationBucketOnCopy404 = "<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><BucketName>copydestination</BucketName><RequestId>4F0CF319C5535975</RequestId><HostId>hdZyHOm7VK+JI2UCdye3d6TVkKhRBIoWflldXVDTKbgipYlamy8HgPBzHrUAVQNJ</HostId></Error>";
|
||||||
|
@ -94,15 +91,35 @@ public class S3IntegrationTest {
|
||||||
String amazonHadAnError = "<Error><Code>InternalError</Code><Message>We encountered an internal error. Please try again.</Message><RequestId>EF6FA7A639CAFF15</RequestId><HostId>tBkX23mIeq2riHsNw2YShupMlZ9+iy3V/uN+lRhqCR4qHTE07ujFeyAUPTowvuH/</HostId></Error>";
|
String amazonHadAnError = "<Error><Code>InternalError</Code><Message>We encountered an internal error. Please try again.</Message><RequestId>EF6FA7A639CAFF15</RequestId><HostId>tBkX23mIeq2riHsNw2YShupMlZ9+iy3V/uN+lRhqCR4qHTE07ujFeyAUPTowvuH/</HostId></Error>";
|
||||||
protected S3Connection client;
|
protected S3Connection client;
|
||||||
Injector i = null;
|
Injector i = null;
|
||||||
|
|
||||||
|
protected String bucketPrefix = System.getProperty("user.name") + "."
|
||||||
|
+ this.getClass().getName();
|
||||||
|
|
||||||
private static final String sysAWSAccessKeyId = System
|
private static final String sysAWSAccessKeyId = System
|
||||||
.getProperty("jclouds.aws.accesskeyid");
|
.getProperty("jclouds.aws.accesskeyid");
|
||||||
|
private static final String sysAWSSecretAccessKey = System
|
||||||
|
.getProperty("jclouds.aws.secretaccesskey");
|
||||||
|
|
||||||
protected Injector createInject(String AWSAccessKeyId, String AWSSecretAccessKey) {
|
@BeforeTest
|
||||||
|
@Parameters( { "jclouds.aws.accesskeyid", "jclouds.aws.secretaccesskey" })
|
||||||
|
protected void setUpClient(@Optional String AWSAccessKeyId,
|
||||||
|
@Optional String AWSSecretAccessKey) throws Exception {
|
||||||
|
i = createInject(AWSAccessKeyId != null ? AWSAccessKeyId
|
||||||
|
: sysAWSAccessKeyId,
|
||||||
|
AWSSecretAccessKey != null ? AWSSecretAccessKey
|
||||||
|
: sysAWSSecretAccessKey);
|
||||||
|
client = i.getInstance(LiveS3Connection.class);
|
||||||
|
deleteEverything();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Injector createInject(String AWSAccessKeyId,
|
||||||
|
String AWSSecretAccessKey) {
|
||||||
return S3ConnectionFactory.getInjector(buildS3Properties(
|
return S3ConnectionFactory.getInjector(buildS3Properties(
|
||||||
AWSAccessKeyId, AWSSecretAccessKey), createHttpModule());
|
AWSAccessKeyId, AWSSecretAccessKey), createHttpModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Properties buildS3Properties(String AWSAccessKeyId, String AWSSecretAccessKey) {
|
protected Properties buildS3Properties(String AWSAccessKeyId,
|
||||||
|
String AWSSecretAccessKey) {
|
||||||
Properties properties = new Properties(
|
Properties properties = new Properties(
|
||||||
S3ConnectionFactory.DEFAULT_PROPERTIES);
|
S3ConnectionFactory.DEFAULT_PROPERTIES);
|
||||||
properties.setProperty("jclouds.aws.accesskeyid", checkNotNull(
|
properties.setProperty("jclouds.aws.accesskeyid", checkNotNull(
|
||||||
|
@ -118,20 +135,6 @@ public class S3IntegrationTest {
|
||||||
return new JavaUrlHttpFutureCommandClientModule();
|
return new JavaUrlHttpFutureCommandClientModule();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String sysAWSSecretAccessKey = System
|
|
||||||
.getProperty("jclouds.aws.secretaccesskey");
|
|
||||||
|
|
||||||
@BeforeTest
|
|
||||||
@Parameters( { "jclouds.aws.accesskeyid", "jclouds.aws.secretaccesskey" })
|
|
||||||
protected void setUpClient(@Optional String AWSAccessKeyId, @Optional String AWSSecretAccessKey) throws Exception {
|
|
||||||
i = createInject(AWSAccessKeyId != null ? AWSAccessKeyId
|
|
||||||
: sysAWSAccessKeyId,
|
|
||||||
AWSSecretAccessKey != null ? AWSSecretAccessKey
|
|
||||||
: sysAWSSecretAccessKey);
|
|
||||||
client = i.getInstance(LiveS3Connection.class);
|
|
||||||
deleteEverything();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void deleteEverything() throws Exception {
|
protected void deleteEverything() throws Exception {
|
||||||
try {
|
try {
|
||||||
List<S3Bucket> buckets = client.getBuckets().get();
|
List<S3Bucket> buckets = client.getBuckets().get();
|
||||||
|
|
Loading…
Reference in New Issue