mirror of https://github.com/apache/jclouds.git
changed to Linked Lists so that unit tests are predictable across JDKs
git-svn-id: http://jclouds.googlecode.com/svn/trunk@2234 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
7f3e658953
commit
99ba4498ec
|
@ -37,7 +37,7 @@ import org.jclouds.blobstore.functions.CalculateSize;
|
||||||
import org.jclouds.blobstore.functions.GenerateMD5;
|
import org.jclouds.blobstore.functions.GenerateMD5;
|
||||||
import org.jclouds.blobstore.functions.GenerateMD5Result;
|
import org.jclouds.blobstore.functions.GenerateMD5Result;
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +54,7 @@ public class AtmosObjectImpl implements AtmosObject, Comparable<AtmosObject> {
|
||||||
private final SystemMetadata systemMetadata;
|
private final SystemMetadata systemMetadata;
|
||||||
private Object data;
|
private Object data;
|
||||||
|
|
||||||
private Multimap<String, String> allHeaders = HashMultimap.create();
|
private Multimap<String, String> allHeaders = LinkedHashMultimap.create();
|
||||||
|
|
||||||
public AtmosObjectImpl(GenerateMD5Result generateMD5Result, GenerateMD5 generateMD5,
|
public AtmosObjectImpl(GenerateMD5Result generateMD5Result, GenerateMD5 generateMD5,
|
||||||
CalculateSize calculateSize, MutableContentMetadata contentMetadata) {
|
CalculateSize calculateSize, MutableContentMetadata contentMetadata) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.jclouds.blobstore.functions.CalculateSize;
|
||||||
import org.jclouds.blobstore.functions.GenerateMD5;
|
import org.jclouds.blobstore.functions.GenerateMD5;
|
||||||
import org.jclouds.blobstore.functions.GenerateMD5Result;
|
import org.jclouds.blobstore.functions.GenerateMD5Result;
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,7 +51,7 @@ public class AzureBlobImpl implements AzureBlob, Comparable<AzureBlob> {
|
||||||
private final CalculateSize calculateSize;
|
private final CalculateSize calculateSize;
|
||||||
private final MutableBlobProperties properties;
|
private final MutableBlobProperties properties;
|
||||||
private Object data;
|
private Object data;
|
||||||
private Multimap<String, String> allHeaders = HashMultimap.create();
|
private Multimap<String, String> allHeaders = LinkedHashMultimap.create();
|
||||||
private Long contentLength;
|
private Long contentLength;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
@ -277,7 +277,7 @@ public class AzureBlobClientLiveTest {
|
||||||
assertEquals(metadata.getMetadata().get("metadata"), "metadata-value");
|
assertEquals(metadata.getMetadata().get("metadata"), "metadata-value");
|
||||||
|
|
||||||
// // Test POST to update object's metadata
|
// // Test POST to update object's metadata
|
||||||
// Multimap<String, String> userMetadata = HashMultimap.create();
|
// Multimap<String, String> userMetadata = LinkedHashMultimap.create();
|
||||||
// userMetadata.put("New-Metadata-1", "value-1");
|
// userMetadata.put("New-Metadata-1", "value-1");
|
||||||
// userMetadata.put("New-Metadata-2", "value-2");
|
// userMetadata.put("New-Metadata-2", "value-2");
|
||||||
// assertTrue(connection.setBlobProperties(privateContainer, object.getProperties().getName(),
|
// assertTrue(connection.setBlobProperties(privateContainer, object.getProperties().getName(),
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.jclouds.blobstore.functions.CalculateSize;
|
||||||
import org.jclouds.blobstore.functions.GenerateMD5;
|
import org.jclouds.blobstore.functions.GenerateMD5;
|
||||||
import org.jclouds.blobstore.functions.GenerateMD5Result;
|
import org.jclouds.blobstore.functions.GenerateMD5Result;
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class BlobImpl implements Blob, Comparable<Blob> {
|
||||||
private final CalculateSize calculateSize;
|
private final CalculateSize calculateSize;
|
||||||
private final MutableBlobMetadata metadata;
|
private final MutableBlobMetadata metadata;
|
||||||
private Object data;
|
private Object data;
|
||||||
private Multimap<String, String> allHeaders = HashMultimap.create();
|
private Multimap<String, String> allHeaders = LinkedHashMultimap.create();
|
||||||
private Long contentLength;
|
private Long contentLength;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.blobstore.functions.CalculateSize;
|
||||||
import org.jclouds.mezeo.pcs2.domain.MutableFileInfo;
|
import org.jclouds.mezeo.pcs2.domain.MutableFileInfo;
|
||||||
import org.jclouds.mezeo.pcs2.domain.PCSFile;
|
import org.jclouds.mezeo.pcs2.domain.PCSFile;
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +44,7 @@ public class PCSFileImpl implements PCSFile, Comparable<PCSFile> {
|
||||||
private final CalculateSize calculateSize;
|
private final CalculateSize calculateSize;
|
||||||
private final MutableFileInfo metadata;
|
private final MutableFileInfo metadata;
|
||||||
private Object data;
|
private Object data;
|
||||||
private Multimap<String, String> allHeaders = HashMultimap.create();
|
private Multimap<String, String> allHeaders = LinkedHashMultimap.create();
|
||||||
private Long contentLength;
|
private Long contentLength;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
@ -49,7 +49,6 @@ public class BindMetadataToQueryParams implements Binder {
|
||||||
for (Entry<String, String> entry : userMetadata.entrySet()) {
|
for (Entry<String, String> entry : userMetadata.entrySet()) {
|
||||||
metadata.add(String.format("%s:%s", entry.getKey().toLowerCase(), entry.getValue()));
|
metadata.add(String.format("%s:%s", entry.getKey().toLowerCase(), entry.getValue()));
|
||||||
}
|
}
|
||||||
((GeneratedHttpRequest) request).replaceQueryParam("metadata", metadata.toArray());
|
((GeneratedHttpRequest) request).addQueryParam("metadata", metadata.toArray(new String[] {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class AddSessionTokenToRequest implements HttpRequestFilter {
|
||||||
public void filter(HttpRequest request) throws HttpException {
|
public void filter(HttpRequest request) throws HttpException {
|
||||||
checkArgument(checkNotNull(request, "input") instanceof GeneratedHttpRequest<?>,
|
checkArgument(checkNotNull(request, "input") instanceof GeneratedHttpRequest<?>,
|
||||||
"this decorator is only valid for GeneratedHttpRequests!");
|
"this decorator is only valid for GeneratedHttpRequests!");
|
||||||
((GeneratedHttpRequest<?>) request).replaceQueryParam(SDNQueryParams.SESSIONTOKEN,
|
((GeneratedHttpRequest<?>) request).addQueryParam(SDNQueryParams.SESSIONTOKEN,
|
||||||
getSessionToken());
|
getSessionToken());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class BindMetadataToQueryParamsTest {
|
||||||
BindMetadataToQueryParams binder = new BindMetadataToQueryParams();
|
BindMetadataToQueryParams binder = new BindMetadataToQueryParams();
|
||||||
|
|
||||||
GeneratedHttpRequest<?> request = createMock(GeneratedHttpRequest.class);
|
GeneratedHttpRequest<?> request = createMock(GeneratedHttpRequest.class);
|
||||||
request.replaceQueryParam("metadata", "imagename:foo", "serverid:2");
|
request.addQueryParam("metadata", "imagename:foo", "serverid:2");
|
||||||
replay(request);
|
replay(request);
|
||||||
binder.bindToRequest(request, ImmutableMap.of("imageName", "foo", "serverId", "2"));
|
binder.bindToRequest(request, ImmutableMap.of("imageName", "foo", "serverId", "2"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.jclouds.blobstore.functions.GenerateMD5Result;
|
||||||
import org.jclouds.rackspace.cloudfiles.domain.CFObject;
|
import org.jclouds.rackspace.cloudfiles.domain.CFObject;
|
||||||
import org.jclouds.rackspace.cloudfiles.domain.MutableObjectInfoWithMetadata;
|
import org.jclouds.rackspace.cloudfiles.domain.MutableObjectInfoWithMetadata;
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,7 +51,7 @@ public class CFObjectImpl implements CFObject, Comparable<CFObject> {
|
||||||
private final CalculateSize calculateSize;
|
private final CalculateSize calculateSize;
|
||||||
private final MutableObjectInfoWithMetadata info;
|
private final MutableObjectInfoWithMetadata info;
|
||||||
private Object data;
|
private Object data;
|
||||||
private Multimap<String, String> allHeaders = HashMultimap.create();
|
private Multimap<String, String> allHeaders = LinkedHashMultimap.create();
|
||||||
private Long contentLength;
|
private Long contentLength;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
Loading…
Reference in New Issue