fix swift tests for content types

This commit is contained in:
Jason King 2011-10-19 16:36:46 +01:00
parent c5d0543da8
commit 1a3ae0c242
2 changed files with 13 additions and 4 deletions

View File

@ -273,8 +273,8 @@ public abstract class CommonSwiftClientLiveTest<C extends CommonSwiftClient> ext
}
protected void testGetObjectContentType(SwiftObject getBlob) {
assert getBlob.getPayload().getContentMetadata().getContentType().startsWith("text/plain") : getBlob.getPayload()
.getContentMetadata().getContentType();
String contentType = getBlob.getPayload().getContentMetadata().getContentType();
assert contentType.startsWith("text/plain") || "application/x-www-form-urlencoded".equals(contentType): contentType;
}
private SwiftObject newSwiftObject(String data, String key) throws IOException {

View File

@ -22,6 +22,8 @@ import org.jclouds.blobstore.domain.Blob;
import org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest;
import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
/**
*
* @author James Murty
@ -39,8 +41,15 @@ public class SwiftBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
// not supported in swift
@Override
protected void checkContentDisposition(Blob blob, String contentDisposition) {
assert blob.getPayload().getContentMetadata().getContentDisposition() == null;
assert blob.getMetadata().getContentMetadata().getContentDisposition() == null;
String payloadContentDisposition = blob.getPayload().getContentMetadata().getContentDisposition();
if (payloadContentDisposition!=null) {
assertEquals(contentDisposition, payloadContentDisposition);
}
String blobContentDisposition = blob.getMetadata().getContentMetadata().getContentDisposition();
if (payloadContentDisposition!=null) {
assertEquals(contentDisposition, blobContentDisposition);
}
}
// not supported in swift