Package org.jclouds.s3.options

Examples of org.jclouds.s3.options.ListBucketOptionsTest


   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("greenqloud-storage")
         .name("GreenQloud Simple Storage Service (S3)")
         .apiMetadata(new S3ApiMetadata())
         .homepage(URI.create("http://www.greenqloud.com"))
         .console(URI.create("https://manage.greenqloud.com"))
         .linkedServices("greenqloud-compute", "greenqloud-storage")
         .iso3166Codes("IS-1")
         .endpoint("https://s.greenqloud.com")
View Full Code Here


*/
@Test(groups = "unit", testName = "GreenQloudStorageProviderTest")
public class GreenQloudStorageProviderTest extends BaseProviderMetadataTest {

   public GreenQloudStorageProviderTest() {
      super(new GreenQloudStorageProviderMetadata(), new S3ApiMetadata());
   }
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("greenqloud-storage")
         .name("GreenQloud Simple Storage Service (S3)")
         .apiMetadata(new S3ApiMetadata())
         .homepage(URI.create("http://www.greenqloud.com"))
         .console(URI.create("https://manage.greenqloud.com"))
         .linkedServices("greenqloud-compute", "greenqloud-storage")
         .iso3166Codes("IS-1")
         .endpoint("https://s.greenqloud.com")
View Full Code Here

*/
@Test(groups = "unit", testName = "GreenQloudStorageProviderTest")
public class GreenQloudStorageProviderTest extends BaseProviderMetadataTest {

   public GreenQloudStorageProviderTest() {
      super(new GreenQloudStorageProviderMetadata(), new S3ApiMetadata());
   }
View Full Code Here

                        CONSTANT_DATE).put("Authorization", "AWS identity:ZWVz2v/jGB+ZMmijoyfH9mFMPo0=").build())
               .build();

      HttpResponse success = HttpResponse.builder().statusCode(200).build();

      S3Client clientWhenBucketExists = requestsSendResponses(bucketFooExists, redirectResponse, bucketFooExistsNowUsesGET, success);
     
      assert clientWhenBucketExists.bucketExists("foo");

   }
View Full Code Here

         Blob blob = blobStore.blobBuilder(blobName).payload("something").build();
         blobStore.putBlob(containerName, blob,
            storageClass(StorageClass.REDUCED_REDUNDANCY));

         S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

         ObjectMetadata metadata = response.iterator().next();
         assertEquals(metadata.getStorageClass(), StorageClass.REDUCED_REDUNDANCY);

      } finally {
View Full Code Here

         Blob blob = blobStore.blobBuilder(blobName).payload("something").build();
         blobStore.putBlob(containerName, blob,
            storageClass(StorageClass.REDUCED_REDUNDANCY));

         S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

         ObjectMetadata metadata = response.iterator().next();
         assertEquals(metadata.getStorageClass(), StorageClass.REDUCED_REDUNDANCY);

      } finally {
View Full Code Here

    private S3BlobStore s3BlobStore;

    //TODO: does all of this behavior belong on AWSClient?

    public S3TestUtils(ConnectionCredentials connectionCredentials) {
        S3BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("aws-s3")
                .credentials(connectionCredentials.getIdentity(), connectionCredentials.getCredential())
                .modules(ImmutableSet.<Module>of(new SLF4JLoggingModule()))
                .buildView(S3BlobStoreContext.class);
        s3BlobStore = blobStoreContext.getBlobStore();
    }
View Full Code Here

   @Test
   public void testPutWithReducedRedundancy() {
      Injector injector = createInjector(Functions.forMap(ImmutableMap.<HttpRequest, HttpResponse>of()), createModule(), setupProperties());

      Blob blob = injector.getInstance(BlobBuilder.class).name("test").payload("content").build();
      BlobToObject blobToObject = injector.getInstance(BlobToObject.class);

      AWSS3Client client = requestsSendResponses(bucketLocationRequest, bucketLocationResponse,
         HttpRequest.builder()
                    .method("PUT")
                    .endpoint("https://test.s3-eu-west-1.amazonaws.com/test")
                    .addHeader("Expect", "100-continue")
                    .addHeader("x-amz-storage-class", "REDUCED_REDUNDANCY")
                    .addHeader("Host", "test.s3-eu-west-1.amazonaws.com")
                    .addHeader("Date", CONSTANT_DATE)
                    .addHeader("Authorization", "AWS identity:1mJrW85/mqZpYTFIK5Ebtt2MM6E=")
                    .payload("content").build(),
         HttpResponse.builder()
                     .statusCode(200)
                     .addHeader("x-amz-id-2", "w0rL+9fALQiCOToesVQefs8WalIgn+ZhMD7hHMKYud/xv7MyKkAWQOtFNEfK97Ri")
                     .addHeader("x-amz-request-id", "7A84C3CD4437A4C0")
                     .addHeader("Date", CONSTANT_DATE)
                     .addHeader("ETag", "437b930db84b8079c2dd804a71936b5f")
                     .addHeader("Server", "AmazonS3").build()
      );

      client.putObject("test", blobToObject.apply(blob),
         storageClass(StorageClass.REDUCED_REDUNDANCY));
   }
View Full Code Here

         keyToAcl.put(bucketName + "/" + object.getMetadata().getKey(), options.getAcl());
      return blobStore.putBlob(bucketName, object2Blob.apply(object));
   }

   protected AccessControlList getACLforS3Item(String bucketAndObjectKey) {
      AccessControlList acl = null;
      Object aclObj = keyToAcl.get(bucketAndObjectKey);
      if (aclObj instanceof AccessControlList) {
         acl = (AccessControlList) aclObj;
      } else if (aclObj instanceof CannedAccessPolicy) {
         acl = AccessControlList.fromCannedAccessPolicy((CannedAccessPolicy) aclObj, DEFAULT_OWNER_ID);
View Full Code Here

TOP

Related Classes of org.jclouds.s3.options.ListBucketOptionsTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.