loosened testing

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2039 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-11-03 01:48:21 +00:00
parent 6b32efa17f
commit f3cd3f2db9
3 changed files with 6 additions and 5 deletions

View File

@ -23,6 +23,8 @@
*/ */
package org.jclouds.blobstore.functions; package org.jclouds.blobstore.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import javax.inject.Inject; import javax.inject.Inject;
@ -50,10 +52,10 @@ public class ReturnVoidOnNotFoundOr404 implements Function<Exception, Void> {
} }
private final ReturnTrueOn404 rto404; private final ReturnTrueOn404 rto404;
@Inject @Inject
private ReturnVoidOnNotFoundOr404(ReturnTrueOn404 rto404) { private ReturnVoidOnNotFoundOr404(ReturnTrueOn404 rto404) {
this.rto404 = rto404; this.rto404 = checkNotNull(rto404, "rto404");
} }
public Void apply(Exception from) { public Void apply(Exception from) {

View File

@ -400,9 +400,8 @@ public class BaseBlobIntegrationTest<S> extends BaseBlobStoreIntegrationTest<S>
} }
} }
protected void validateMetadata(BlobMetadata metadata) { protected void validateMetadata(BlobMetadata metadata) {
assertEquals(metadata.getContentType(), "text/plain"); assert metadata.getContentType().startsWith("text/plain") : metadata.getContentType();
assertEquals(metadata.getSize(), new Long(TEST_STRING.length())); assertEquals(metadata.getSize(), new Long(TEST_STRING.length()));
assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff"); assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff");
assertEquals(metadata.getContentMD5(), HttpUtils.md5(TEST_STRING.getBytes())); assertEquals(metadata.getContentMD5(), HttpUtils.md5(TEST_STRING.getBytes()));

View File

@ -411,7 +411,7 @@ public class BaseBlobStoreIntegrationTest<S> {
throws InterruptedException, ExecutionException, TimeoutException { throws InterruptedException, ExecutionException, TimeoutException {
if (context.getBlobStore().exists(name)) { if (context.getBlobStore().exists(name)) {
System.err.printf("*** deleting container %s...%n", name); System.err.printf("*** deleting container %s...%n", name);
context.getBlobStore().deleteContainer(name).get(30, TimeUnit.SECONDS); context.getBlobStore().deleteContainer(name).get(60, TimeUnit.SECONDS);
assertConsistencyAware(context, new Runnable() { assertConsistencyAware(context, new Runnable() {
public void run() { public void run() {
try { try {