fixed vfs snapshot repo and added test

This commit is contained in:
Adrian Cole 2010-04-05 15:57:19 -07:00
parent 6fa99d92a7
commit 9837bfd3ba
3 changed files with 20 additions and 2 deletions

View File

@ -53,11 +53,17 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest {
} }
@Test(groups = { "integration", "live" }) @Test(groups = { "integration", "live" })
public void testPutTwiceIsOk() throws InterruptedException { public void testPutTwiceIsOkAndDoesntOverwrite() throws InterruptedException {
String containerName = getContainerName(); String containerName = getContainerName();
try { try {
context.getBlobStore().createContainerInLocation("default", containerName); context.getBlobStore().createContainerInLocation("default", containerName);
Blob blob = context.getBlobStore().newBlob("hello");
blob.setPayload(TEST_STRING);
context.getBlobStore().putBlob(containerName, blob);
context.getBlobStore().createContainerInLocation("default", containerName); context.getBlobStore().createContainerInLocation("default", containerName);
assertEquals(context.getBlobStore().countBlobs(containerName), 1);
} finally { } finally {
returnContainer(containerName); returnContainer(containerName);
} }

View File

@ -105,6 +105,18 @@
<version>1.2.14</version> <version>1.2.14</version>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>apache.snapshots.https</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<build> <build>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>

View File

@ -73,7 +73,7 @@ public class BlobStoreFileNameParser extends URLFileNameParser {
FileType fileType = UriParser.normalisePath(name); FileType fileType = UriParser.normalisePath(name);
String path = name.toString(); String path = name.toString();
return new BlobStoreFileName(auth.getHostName(), creds.account, creds.key, path, fileType, return new BlobStoreFileName(auth.hostName, creds.account, creds.key, path, fileType,
container); container);
} }