This is an automated email from the ASF dual-hosted git repository.

gaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds.git


The following commit(s) were added to refs/heads/master by this push:
     new 222fb84  Add test for aborting a single part MPU
222fb84 is described below

commit 222fb84f5c89cfec0cfa1d5743accb11294c2257
Author: Andrew Gaul <[email protected]>
AuthorDate: Wed Feb 6 17:11:57 2019 -0800

    Add test for aborting a single part MPU
    
    Also tighten up checks to ensure there is no litter, mostly for
    transient and filesystem blobstores.
---
 .../internal/BaseBlobIntegrationTest.java          | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git 
a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
 
b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
index f250a60..ef5bd7f 100644
--- 
a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
+++ 
b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
@@ -1290,6 +1290,33 @@ public class BaseBlobIntegrationTest extends 
BaseBlobStoreIntegrationTest {
 
          blobStore.abortMultipartUpload(mpu);
 
+         assertThat(blobStore.list(container)).isEmpty();
+
+         blob = blobStore.getBlob(container, name);
+         assertThat(blob).isNull();
+      } finally {
+         returnContainer(container);
+      }
+   }
+
+   @Test(groups = { "integration", "live" })
+   public void testMultipartUploadOnePartAbort() throws Exception {
+      BlobStore blobStore = view.getBlobStore();
+      String container = getContainerName();
+      try {
+         String name = "blob-name";
+         Blob blob = blobStore.blobBuilder(name).build();
+         MultipartUpload mpu = blobStore.initiateMultipartUpload(container, 
blob.getMetadata(), new PutOptions());
+
+         ByteSource byteSource = TestUtils.randomByteSource().slice(0, 1);
+         Payload payload = Payloads.newByteSourcePayload(byteSource);
+         payload.getContentMetadata().setContentLength(byteSource.size());
+         MultipartPart part = blobStore.uploadMultipartPart(mpu, 1, payload);
+
+         blobStore.abortMultipartUpload(mpu);
+
+         assertThat(blobStore.list(container)).isEmpty();
+
          blob = blobStore.getBlob(container, name);
          assertThat(blob).isNull();
       } finally {

Reply via email to