From 6336fa18234ed7bf004c98f8bee34e0eccfd105a Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Sat, 31 Oct 2009 00:46:55 +0000 Subject: [PATCH] made sure MD5 are sent during testing git-svn-id: http://jclouds.googlecode.com/svn/trunk@2013 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../internal/BaseBlobMapIntegrationTest.java | 8 +++++--- .../internal/BaseInputStreamMapIntegrationTest.java | 4 ++-- .../integration/internal/BaseMapIntegrationTest.java | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java index a6d560cf40..06f401dfb5 100755 --- a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java +++ b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java @@ -78,7 +78,7 @@ public class BaseBlobMapIntegrationTest extends BaseMapIntegrationTest map = createMap(context, bucketName); - putString(map, "one", "two"); + putStringWithMD5(map, "one", "two"); assertConsistencyAwareContentEquals(map, "one", "two"); // TODO track how often this occurs and potentially update map implementation assertConsistencyAwareRemoveEquals(map, "one", null); @@ -135,9 +135,10 @@ public class BaseBlobMapIntegrationTest extends BaseMapIntegrationTest map = createMap(context, bucketName); - putString(map, "one", "apple"); + putStringWithMD5(map, "one", "apple"); Blob object = newBlob("one"); object.setData("apple"); + object.generateMD5(); assertConsistencyAwareContainsValue(map, object); } finally { returnContainer(bucketName); @@ -200,9 +201,10 @@ public class BaseBlobMapIntegrationTest extends BaseMapIntegrationTest map, String key, String value) { + protected void putStringWithMD5(Map map, String key, String value) { Blob object = newBlob(key); object.setData(value); + object.generateMD5(); map.put(key, object); } diff --git a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java index 08dc50ade6..39d85a40ca 100755 --- a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java +++ b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java @@ -78,7 +78,7 @@ public class BaseInputStreamMapIntegrationTest extends BaseMapIntegrationTest String bucketName = getContainerName(); try { Map map = createMap(context, bucketName); - putString(map, "one", "two"); + putStringWithMD5(map, "one", "two"); InputStream old = map.remove("one"); assertEquals(Utils.toStringAndClose(old), "two"); old = map.remove("one"); @@ -309,7 +309,7 @@ public class BaseInputStreamMapIntegrationTest extends BaseMapIntegrationTest } @Override - protected void putString(Map map, String key, String value) + protected void putStringWithMD5(Map map, String key, String value) throws InterruptedException, ExecutionException, TimeoutException { ((InputStreamMap) map).putString(key, value); } diff --git a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java index 4fe3fe1740..cb8b71fb3b 100755 --- a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java +++ b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java @@ -106,7 +106,7 @@ public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegrat try { Map map = createMap(context, bucketName); assertConsistencyAwareMapSize(map, 0); - putString(map, "one", "apple"); + putStringWithMD5(map, "one", "apple"); assertConsistencyAwareMapSize(map, 1); map.clear(); assertConsistencyAwareMapSize(map, 0); @@ -125,7 +125,7 @@ public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegrat try { Map map = createMap(context, bucketName); assertConsistencyAwareKeySize(map, 0); - putString(map, "one", "two"); + putStringWithMD5(map, "one", "two"); assertConsistencyAwareKeySize(map, 1); assertConsistencyAwareKeySetEquals(map, ImmutableSet.of("one")); } finally { @@ -175,7 +175,7 @@ public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegrat try { Map map = createMap(context, bucketName); assertConsistencyAwareDoesntContainKey(map); - putString(map, "one", "apple"); + putStringWithMD5(map, "one", "apple"); assertConsistencyAwareContainsKey(map); } finally { returnContainer(bucketName); @@ -219,7 +219,7 @@ public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegrat try { Map map = createMap(context, bucketName); assertConsistencyAwareEmpty(map); - putString(map, "one", "apple"); + putStringWithMD5(map, "one", "apple"); assertConsistencyAwareNotEmpty(map); } finally { returnContainer(bucketName); @@ -243,7 +243,7 @@ public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegrat }); } - abstract protected void putString(Map map, String key, String value) + abstract protected void putStringWithMD5(Map map, String key, String value) throws InterruptedException, ExecutionException, TimeoutException; protected void fourLeftRemovingOne(Map map) throws InterruptedException,