mirror of
https://github.com/apache/jclouds.git
synced 2025-02-07 18:49:52 +00:00
Add test for aborting a single part MPU
Also tighten up checks to ensure there is no litter, mostly for transient and filesystem blobstores.
This commit is contained in:
parent
d14276d9a5
commit
222fb84f5c
@ -1290,6 +1290,33 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
|||||||
|
|
||||||
blobStore.abortMultipartUpload(mpu);
|
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);
|
blob = blobStore.getBlob(container, name);
|
||||||
assertThat(blob).isNull();
|
assertThat(blob).isNull();
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user