mirror of https://github.com/apache/jclouds.git
made sure MD5 are sent during testing
git-svn-id: http://jclouds.googlecode.com/svn/trunk@2013 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
f285e85ae7
commit
6336fa1823
|
@ -78,7 +78,7 @@ public class BaseBlobMapIntegrationTest<S> extends BaseMapIntegrationTest<S, Blo
|
|||
String bucketName = getContainerName();
|
||||
try {
|
||||
Map<String, Blob> 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<S> extends BaseMapIntegrationTest<S, Blo
|
|||
String bucketName = getContainerName();
|
||||
try {
|
||||
Map<String, Blob> 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<S> extends BaseMapIntegrationTest<S, Blo
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void putString(Map<String, Blob> map, String key, String value) {
|
||||
protected void putStringWithMD5(Map<String, Blob> map, String key, String value) {
|
||||
Blob object = newBlob(key);
|
||||
object.setData(value);
|
||||
object.generateMD5();
|
||||
map.put(key, object);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public class BaseInputStreamMapIntegrationTest<S> extends BaseMapIntegrationTest
|
|||
String bucketName = getContainerName();
|
||||
try {
|
||||
Map<String, InputStream> 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<S> extends BaseMapIntegrationTest
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void putString(Map<String, InputStream> map, String key, String value)
|
||||
protected void putStringWithMD5(Map<String, InputStream> map, String key, String value)
|
||||
throws InterruptedException, ExecutionException, TimeoutException {
|
||||
((InputStreamMap) map).putString(key, value);
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public abstract class BaseMapIntegrationTest<S, V> extends BaseBlobStoreIntegrat
|
|||
try {
|
||||
Map<String, V> 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<S, V> extends BaseBlobStoreIntegrat
|
|||
try {
|
||||
Map<String, V> 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<S, V> extends BaseBlobStoreIntegrat
|
|||
try {
|
||||
Map<String, V> 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<S, V> extends BaseBlobStoreIntegrat
|
|||
try {
|
||||
Map<String, V> 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<S, V> extends BaseBlobStoreIntegrat
|
|||
});
|
||||
}
|
||||
|
||||
abstract protected void putString(Map<String, V> map, String key, String value)
|
||||
abstract protected void putStringWithMD5(Map<String, V> map, String key, String value)
|
||||
throws InterruptedException, ExecutionException, TimeoutException;
|
||||
|
||||
protected void fourLeftRemovingOne(Map<String, V> map) throws InterruptedException,
|
||||
|
|
Loading…
Reference in New Issue