Add directory specific live test to AWS-S3.

This patch adds a test to the AWS live test suite for making sure
that a directory is basically a blob with a trailing '/'.
This commit is contained in:
Shri Javadekar 2013-02-27 22:52:44 -08:00
parent 9dbaff2420
commit 32f8d8d3ca
1 changed files with 19 additions and 0 deletions

View File

@ -288,4 +288,23 @@ public class AWSS3ClientLiveTest extends S3ClientLiveTest {
} }
} }
public void testDirectoryEndingWithSlash() throws InterruptedException {
String containerName = getContainerName();
try {
BlobStore blobStore = view.getBlobStore();
blobStore.createDirectory(containerName, "someDir");
// According to the S3 documentation, a directory is nothing but a blob
// whose name ends with a '/'. So let's try to remove the blob we just
// created.
blobStore.removeBlob(containerName, "someDir/");
// The directory "someDir" shouldn't exist since we removed it. If this
// test succeeds, it confirms that a directory (or folder) is nothing
// but a blob with a name ending in '/'.
assertEquals(blobStore.directoryExists(containerName, "someDir"), false);
} finally {
returnContainer(containerName);
}
}
} }