Package org.jclouds.aws.s3

Examples of org.jclouds.aws.s3.S3Client


                        String.class, PutBucketOptions[].class), Lists.<Object> newArrayList(null, "bucket"))).build();
   }

   @Test
   void testBucketAlreadyOwnedByYouIsOk() throws Exception {
      S3Client client = createMock(S3Client.class);
      replay(client);

      Exception e = getErrorWithCode("BucketAlreadyOwnedByYou");
      assertFalse(new FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExists(client).setContext(
            putBucket).createOrPropagate(e));
View Full Code Here


      verify(client);
   }

   @Test
   void testOperationAbortedIsOkWhenBucketExists() throws Exception {
      S3Client client = createMock(S3Client.class);
      expect(client.bucketExists("bucket")).andReturn(true);
      replay(client);
      Exception e = getErrorWithCode("OperationAborted");
      assertFalse(new FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExists(client).setContext(
            putBucket).createOrPropagate(e));
      verify(client);
View Full Code Here

      verify(client);
   }

   @Test(expectedExceptions = Exception.class)
   void testOperationAbortedNotOkWhenBucketDoesntExist() throws Exception {
      S3Client client = createMock(S3Client.class);
      expect(client.bucketExists("bucket")).andReturn(false);
      replay(client);
      Exception e = getErrorWithCode("OperationAborted");
      new FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExists(client).setContext(putBucket)
            .createOrPropagate(e);
   }
View Full Code Here

            .createOrPropagate(e);
   }

   @Test(expectedExceptions = IllegalStateException.class)
   void testIllegalStateIsNotOk() throws Exception {
      S3Client client = createMock(S3Client.class);
      replay(client);

      Exception e = new IllegalStateException();
      new FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExists(client).createOrPropagate(e);
   }
View Full Code Here

      new FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExists(client).createOrPropagate(e);
   }

   @Test(expectedExceptions = AWSResponseException.class)
   void testBlahIsNotOk() throws Exception {
      S3Client client = createMock(S3Client.class);
      replay(client);
      Exception e = getErrorWithCode("blah");
      new FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExists(client).createOrPropagate(e);
   }
View Full Code Here

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

         S3Client s3Client = view.unwrapApi(S3Client.class);
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

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

      } finally {
View Full Code Here

TOP

Related Classes of org.jclouds.aws.s3.S3Client

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.