Merge pull request #111 from jsonking/master

Fix tests for swift content type errors.
This commit is contained in:
Adrian Cole 2011-10-22 01:50:51 -07:00
commit f2b46e1e5f
2 changed files with 8 additions and 5 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
@ -36,11 +38,12 @@ public class SwiftBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
// not supported in swift
}
// not supported in swift
@Override
protected void checkContentDisposition(Blob blob, String contentDisposition) {
assert blob.getPayload().getContentMetadata().getContentDisposition() == null;
assert blob.getMetadata().getContentMetadata().getContentDisposition() == null;
// This works for Swift Server 1.4.4/SWauth 1.0.3 but was null in previous versions.
// TODO: Better testing for the different versions.
super.checkContentDisposition(blob,contentDisposition);
}
// not supported in swift