mirror of https://github.com/apache/jclouds.git
Enforce that all commas have trailing whitespace
This commit is contained in:
parent
aef9fc8d83
commit
2d88f5164e
|
@ -58,10 +58,10 @@ public class DirectoryEntryListToResourceMetadataList implements
|
|||
StorageType type = from.getType() == FileType.DIRECTORY ? StorageType.FOLDER : StorageType.BLOB;
|
||||
if (type == StorageType.FOLDER)
|
||||
return new StorageMetadataImpl(type, from.getObjectID(), from.getObjectName(), defaultLocation
|
||||
.get(), null, null, null, null, ImmutableMap.<String,String>of());
|
||||
.get(), null, null, null, null, ImmutableMap.<String, String>of());
|
||||
else
|
||||
return new BlobMetadataImpl(from.getObjectID(), from.getObjectName(), defaultLocation.get(),
|
||||
null, null, null, null, ImmutableMap.<String,String>of(), null,
|
||||
null, null, null, null, ImmutableMap.<String, String>of(), null,
|
||||
null, new BaseMutableContentMetadata());
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ObjectToBlobMetadata implements Function<AtmosObject, MutableBlobMe
|
|||
HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata());
|
||||
to.setName(objectName.apply(from));
|
||||
to.setUri(from.getContentMetadata().getUri());
|
||||
to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()),0));
|
||||
to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()), 0));
|
||||
if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ"))
|
||||
to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath()));
|
||||
if (from.getSystemMetadata().getType() == FileType.DIRECTORY) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ParseImageListFromJsonResponseTest {
|
|||
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
|
||||
}
|
||||
|
||||
},new GsonModule());
|
||||
}, new GsonModule());
|
||||
DateService dateService = i.getInstance(DateService.class);
|
||||
|
||||
public void testApplyInputStream() {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class CreateSharedIpGroupOptionsTest {
|
|||
private HttpRequest buildRequest(CreateSharedIpGroupOptions options) {
|
||||
injector.injectMembers(options);
|
||||
HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build();
|
||||
options.bindToRequest(request, ImmutableMap.<String,Object>of("name", "foo"));
|
||||
options.bindToRequest(request, ImmutableMap.<String, Object>of("name", "foo"));
|
||||
return request;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ import com.google.common.collect.Multimap;
|
|||
*/
|
||||
public class CloudStackSecurityGroupExtension implements SecurityGroupExtension {
|
||||
protected final CloudStackApi api;
|
||||
protected final Function<org.jclouds.cloudstack.domain.SecurityGroup,SecurityGroup> groupConverter;
|
||||
protected final Function<org.jclouds.cloudstack.domain.SecurityGroup, SecurityGroup> groupConverter;
|
||||
protected final LoadingCache<ZoneAndName, org.jclouds.cloudstack.domain.SecurityGroup> groupCreator;
|
||||
protected final GroupNamingConvention.Factory namingConvention;
|
||||
protected final Supplier<Set<? extends Location>> locations;
|
||||
|
@ -65,7 +65,7 @@ public class CloudStackSecurityGroupExtension implements SecurityGroupExtension
|
|||
|
||||
@Inject
|
||||
public CloudStackSecurityGroupExtension(CloudStackApi api,
|
||||
Function<org.jclouds.cloudstack.domain.SecurityGroup,SecurityGroup> groupConverter,
|
||||
Function<org.jclouds.cloudstack.domain.SecurityGroup, SecurityGroup> groupConverter,
|
||||
LoadingCache<ZoneAndName, org.jclouds.cloudstack.domain.SecurityGroup> groupCreator,
|
||||
GroupNamingConvention.Factory namingConvention,
|
||||
@Memoized Supplier<Set<? extends Location>> locations,
|
||||
|
|
|
@ -46,10 +46,10 @@ public class CloudStackSecurityGroupToSecurityGroup implements Function<org.jclo
|
|||
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
||||
protected Logger logger = Logger.NULL;
|
||||
|
||||
protected final Function<IngressRule,IpPermission> ruleToPermission;
|
||||
protected final Function<IngressRule, IpPermission> ruleToPermission;
|
||||
|
||||
@Inject
|
||||
public CloudStackSecurityGroupToSecurityGroup(Function<IngressRule,IpPermission> ruleToPermission) {
|
||||
public CloudStackSecurityGroupToSecurityGroup(Function<IngressRule, IpPermission> ruleToPermission) {
|
||||
this.ruleToPermission = ruleToPermission;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ public class ParseTypedAsyncJob implements Function<AsyncJob<Map<String, JsonBal
|
|||
if (toParse.getResult() != null) {
|
||||
if (toParse.getResult().size() == 1) {
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
Builder<?,Object> builder = AsyncJob.Builder.fromAsyncJobUntyped((AsyncJob) toParse);
|
||||
Builder<?, Object> builder = AsyncJob.Builder.fromAsyncJobUntyped((AsyncJob) toParse);
|
||||
if (toParse.getResult().containsKey("success")) {
|
||||
builder.result(null);
|
||||
} else {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class LoginWithPasswordCredentials extends CacheLoader<Credentials, Login
|
|||
// domain may be present
|
||||
if (username.indexOf('/') != -1) {
|
||||
// username may not end with slash!
|
||||
domain = username.substring(0,username.lastIndexOf('/'));
|
||||
domain = username.substring(0, username.lastIndexOf('/'));
|
||||
username = username.substring(username.lastIndexOf('/') + 1, username.length());
|
||||
}
|
||||
String hashedPassword = base16().lowerCase().encode(md5().hashString(input.credential, UTF_8).asBytes());
|
||||
|
|
|
@ -214,7 +214,7 @@ public class SecurityGroupPredicates {
|
|||
public static Predicate<IngressRule> ruleGroupMatches(final String protocol,
|
||||
final int startPort,
|
||||
final int endPort,
|
||||
final Multimap<String,String> accountGroupNames) {
|
||||
final Multimap<String, String> accountGroupNames) {
|
||||
checkNotNull(protocol, "protocol");
|
||||
checkNotNull(accountGroupNames, "accountGroupNames");
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ public class PasswordAuthenticationExpectTest extends BaseCloudStackExpectTest<A
|
|||
HttpResponse.builder()
|
||||
.statusCode(200)
|
||||
.payload(payloadFromResource("/listaccountsresponse.json"))
|
||||
.build()
|
||||
,logout, logoutResponse);
|
||||
.build(),
|
||||
logout, logoutResponse);
|
||||
|
||||
assertNotNull(client.listAccounts());
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.testng.Assert.assertTrue;
|
|||
@Test(singleThreaded = true, testName="OptionsConverterTest")
|
||||
public class OptionsConverterTest {
|
||||
|
||||
private static final Map<String,Network> EMPTY_NETWORKS_MAP = ImmutableMap.<String, Network>of();
|
||||
private static final Map<String, Network> EMPTY_NETWORKS_MAP = ImmutableMap.<String, Network>of();
|
||||
private static final String ZONE_ID = "2";
|
||||
private final NetworkService firewallServiceWithStaticNat
|
||||
= NetworkService.builder().name("Firewall").capabilities(ImmutableMap.of("StaticNat", "true")).build();
|
||||
|
|
|
@ -163,7 +163,7 @@ public class SnapshotApiTest extends BaseCloudStackApiTest<SnapshotApi> {
|
|||
Invokable<?, ?> method = method(SnapshotApi.class, "createSnapshotPolicy", SnapshotPolicySchedule.class, String.class, String.class, String.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(SnapshotPolicySchedules.monthly(5, 6, 7), 10, "UTC", 12));
|
||||
|
||||
assertRequestLineEquals(httpRequest,extractIso.getRequestLine());
|
||||
assertRequestLineEquals(httpRequest, extractIso.getRequestLine());
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ public class TemplateApiTest extends BaseCloudStackApiTest<TemplateApi> {
|
|||
Invokable<?, ?> method = method(TemplateApi.class, "copyTemplateToZone", String.class, String.class, String.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(17, 18, 19));
|
||||
|
||||
assertRequestLineEquals(httpRequest,copyTemplate.getRequestLine());
|
||||
assertRequestLineEquals(httpRequest, copyTemplate.getRequestLine());
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
||||
|
|
|
@ -99,12 +99,12 @@ public class SecurityGroupPredicatesTest {
|
|||
public void testRuleGroupMatches() {
|
||||
assertTrue(Iterables.any(group().getIngressRules(),
|
||||
ruleGroupMatches("tcp", 22, 22,
|
||||
ImmutableMultimap.<String,String>builder().put("adrian", "adriancole").build())));
|
||||
ImmutableMultimap.<String, String>builder().put("adrian", "adriancole").build())));
|
||||
assertFalse(Iterables.any(group().getIngressRules(),
|
||||
ruleGroupMatches("tcp", 22, 22,
|
||||
ImmutableMultimap.<String,String>builder().put("adrian", "somegroup").build())));
|
||||
ImmutableMultimap.<String, String>builder().put("adrian", "somegroup").build())));
|
||||
assertFalse(Iterables.any(group().getIngressRules(),
|
||||
ruleGroupMatches("tcp", 22, 22,
|
||||
ImmutableMultimap.<String,String>builder().put("someuser", "adriancole").build())));
|
||||
ImmutableMultimap.<String, String>builder().put("someuser", "adriancole").build())));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ public class GetMetricStatistics {
|
|||
* the {@code Builder}.
|
||||
*/
|
||||
public GetMetricStatistics build() {
|
||||
return new GetMetricStatistics(dimensions, endTime, metricName,namespace, period, startTime, statistics,
|
||||
return new GetMetricStatistics(dimensions, endTime, metricName, namespace, period, startTime, statistics,
|
||||
unit);
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ public class EC2ListNodesStrategy implements ListNodesStrategy {
|
|||
return concat(concat(reservations));
|
||||
}
|
||||
|
||||
protected Iterable<? extends RunningInstance> pollRunningInstancesByRegionsAndIds(final Multimap<String,String> idsByRegions) {
|
||||
protected Iterable<? extends RunningInstance> pollRunningInstancesByRegionsAndIds(final Multimap<String, String> idsByRegions) {
|
||||
Iterable<? extends Set<? extends Reservation<? extends RunningInstance>>> reservations
|
||||
= transform(idsByRegions.keySet(), instancesByIdInRegion(idsByRegions));
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class EC2ListNodesStrategy implements ListNodesStrategy {
|
|||
}
|
||||
|
||||
protected Function<String, Set<? extends Reservation<? extends RunningInstance>>>
|
||||
instancesByIdInRegion(final Multimap<String,String> idsByRegions) {
|
||||
instancesByIdInRegion(final Multimap<String, String> idsByRegions) {
|
||||
return new Function<String, Set<? extends Reservation<? extends RunningInstance>>>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,8 +30,8 @@ public class UserIdGroupPair implements Comparable<UserIdGroupPair> {
|
|||
private final String groupName;
|
||||
|
||||
public UserIdGroupPair(String userId, String groupName) {
|
||||
this.userId = checkNotNull(userId,"userId");
|
||||
this.groupName = checkNotNull(groupName,"groupName");
|
||||
this.userId = checkNotNull(userId, "userId");
|
||||
this.groupName = checkNotNull(groupName, "groupName");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public class CloudApplicationArchitecturesEC2ApiLiveTest extends BaseComputeServ
|
|||
Injector injector = view.utils().injector();
|
||||
client = injector.getInstance(EC2Api.class);
|
||||
sshFactory = injector.getInstance(SshClient.Factory.class);
|
||||
runningTester = retry(new InstanceStateRunning(client), 180, 5,SECONDS);
|
||||
runningTester = retry(new InstanceStateRunning(client), 180, 5, SECONDS);
|
||||
hasIpTester = retry(new InstanceHasIpAddress(client), 180, 5, SECONDS);
|
||||
SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
|
||||
socketTester = retry(socketOpen, 180, 1, SECONDS);
|
||||
|
|
|
@ -172,7 +172,7 @@ public class EC2TemplateBuilderTest {
|
|||
|
||||
// weird compilation error means have to declare extra generics for call to build() - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365818
|
||||
Supplier<LoadingCache<RegionAndName, ? extends Image>> imageCache = Suppliers.<LoadingCache<RegionAndName, ? extends Image>> ofInstance(
|
||||
CacheBuilder.newBuilder().<RegionAndName,Image>build(CacheLoader.from(Functions.forMap(imageMap))));
|
||||
CacheBuilder.newBuilder().<RegionAndName, Image>build(CacheLoader.from(Functions.forMap(imageMap))));
|
||||
|
||||
Template template = newTemplateBuilder(images, imageCache).imageId("us-east-1/cc-image").build();
|
||||
|
||||
|
@ -202,7 +202,7 @@ public class EC2TemplateBuilderTest {
|
|||
@SuppressWarnings("unchecked")
|
||||
ImmutableMap<RegionAndName, Image> imageMap = (ImmutableMap<RegionAndName, Image>) ImagesToRegionAndIdMap.imagesToMap(images.get());
|
||||
Supplier<LoadingCache<RegionAndName, ? extends Image>> imageCache = Suppliers.<LoadingCache<RegionAndName, ? extends Image>> ofInstance(
|
||||
CacheBuilder.newBuilder().<RegionAndName,Image>build(CacheLoader.from(Functions.forMap(imageMap))));
|
||||
CacheBuilder.newBuilder().<RegionAndName, Image>build(CacheLoader.from(Functions.forMap(imageMap))));
|
||||
|
||||
return newTemplateBuilder(images, imageCache);
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ public class EC2TemplateBuilderTest {
|
|||
Supplier<Set<? extends Hardware>> sizes = Suppliers.<Set<? extends Hardware>> ofInstance(ImmutableSet
|
||||
.<Hardware> of(t1_micro().build(), c1_medium().build(), c1_xlarge().build(), m1_large().build(),
|
||||
m1_small().build(), m1_xlarge().build(), m2_xlarge().build(), m2_2xlarge().build(),
|
||||
m2_4xlarge().build(),g2_2xlarge().build(),CC1_4XLARGE));
|
||||
m2_4xlarge().build(), g2_2xlarge().build(), CC1_4XLARGE));
|
||||
|
||||
return new EC2TemplateBuilderImpl(locations, images, sizes, Suppliers.ofInstance(location), optionsProvider,
|
||||
templateBuilderProvider, imageCache) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class CreateUniqueKeyPairTest {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
Names.bindProperties(binder(),new EC2ApiMetadata().getDefaultProperties());
|
||||
Names.bindProperties(binder(), new EC2ApiMetadata().getDefaultProperties());
|
||||
bind(new TypeLiteral<Supplier<String>>() {
|
||||
}).toInstance(Suppliers.ofInstance("1"));
|
||||
bind(EC2Api.class).toInstance(client);
|
||||
|
@ -99,7 +99,7 @@ public class CreateUniqueKeyPairTest {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
Names.bindProperties(binder(),new EC2ApiMetadata().getDefaultProperties());
|
||||
Names.bindProperties(binder(), new EC2ApiMetadata().getDefaultProperties());
|
||||
bind(new TypeLiteral<Supplier<String>>() {
|
||||
}).toInstance(uniqueIdSupplier);
|
||||
bind(EC2Api.class).toInstance(client);
|
||||
|
|
|
@ -284,7 +284,7 @@ public class RunningInstanceToNodeMetadataTest {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
Names.bindProperties(binder(),new EC2ApiMetadata().getDefaultProperties());
|
||||
Names.bindProperties(binder(), new EC2ApiMetadata().getDefaultProperties());
|
||||
}
|
||||
|
||||
}).getInstance(GroupNamingConvention.Factory.class);
|
||||
|
|
|
@ -87,7 +87,7 @@ public class WindowsApiTest extends BaseEC2ApiTest<WindowsApi> {
|
|||
.endpoint("https://ec2.us-east-1.amazonaws.com/")
|
||||
.addHeader("Host", "ec2.us-east-1.amazonaws.com")
|
||||
.addFormParam("Action", "BundleInstance")
|
||||
.addFormParam("InstanceId","i-e468cd8d")
|
||||
.addFormParam("InstanceId", "i-e468cd8d")
|
||||
.addFormParam("Signature", "9UbWwb%2BnO2vHn2O59K9FpmaK445RwX7vXsruHRznwik%3D")
|
||||
.addFormParam("SignatureMethod", "HmacSHA256")
|
||||
.addFormParam("SignatureVersion", "2")
|
||||
|
|
|
@ -99,7 +99,7 @@ public class DescribeInstancesResponseHandlerTest extends BaseEC2HandlerTest {
|
|||
.availabilityZone("us-east-1b").virtualizationType("paravirtual").privateDnsName(
|
||||
"10-251-50-132.ec2.internal")// product codes
|
||||
// ImmutableSet.of("774F4FF8")
|
||||
.tags(ImmutableMap.of("Name","ec2-o", "Empty",""))
|
||||
.tags(ImmutableMap.of("Name", "ec2-o", "Empty", ""))
|
||||
.ramdiskId("ari-badbad00").rootDeviceType(RootDeviceType.INSTANCE_STORE).build(),
|
||||
RunningInstance.builder().region(defaultRegion).groupName("default").amiLaunchIndex("23")
|
||||
.dnsName("ec2-72-44-33-6.compute-1.amazonaws.com").imageId("ami-6ea54007").instanceId(
|
||||
|
|
|
@ -43,7 +43,7 @@ import com.google.common.collect.Iterables;
|
|||
*/
|
||||
@Test(groups = "live", testName = "VolumeApiLiveTest", singleThreaded = true)
|
||||
public class VolumeAndSnapshotApiLiveTest extends BaseCinderApiLiveTest {
|
||||
private static final String name = System.getProperty("user.name").replace('.','-').toLowerCase();
|
||||
private static final String name = System.getProperty("user.name").replace('.', '-').toLowerCase();
|
||||
|
||||
private String zone;
|
||||
|
||||
|
|
|
@ -45,10 +45,10 @@ public class NovaSecurityGroupToSecurityGroup implements Function<org.jclouds.op
|
|||
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
||||
protected Logger logger = Logger.NULL;
|
||||
|
||||
protected Function<SecurityGroupRule,IpPermission> ruleToPermission;
|
||||
protected Function<SecurityGroupRule, IpPermission> ruleToPermission;
|
||||
|
||||
@Inject
|
||||
public NovaSecurityGroupToSecurityGroup(Function<SecurityGroupRule,IpPermission> ruleToPermission) {
|
||||
public NovaSecurityGroupToSecurityGroup(Function<SecurityGroupRule, IpPermission> ruleToPermission) {
|
||||
this.ruleToPermission = ruleToPermission;
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ public class HostAggregate {
|
|||
this.state = checkNotNull(state, "state");
|
||||
this.created = checkNotNull(created, "created");
|
||||
this.updated = Optional.fromNullable(updated);
|
||||
this.metadata = metadata == null ? ImmutableMap.<String,String>of() : ImmutableMap.copyOf(metadata);
|
||||
this.metadata = metadata == null ? ImmutableMap.<String, String>of() : ImmutableMap.copyOf(metadata);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -28,18 +28,18 @@ import java.util.Map;
|
|||
/**
|
||||
* @author Leander Beernaert
|
||||
*/
|
||||
public class ParseDiagnostics implements Function<HttpResponse, Optional <Map<String,String>>> {
|
||||
public class ParseDiagnostics implements Function<HttpResponse, Optional <Map<String, String>>> {
|
||||
|
||||
|
||||
private final ParseJson<Optional <Map<String,String>>> parser;
|
||||
private final ParseJson<Optional <Map<String, String>>> parser;
|
||||
|
||||
@Inject
|
||||
public ParseDiagnostics(ParseJson<Optional <Map<String,String>>> parser) {
|
||||
public ParseDiagnostics(ParseJson<Optional <Map<String, String>>> parser) {
|
||||
this.parser = parser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional <Map<String,String>> apply(HttpResponse response) {
|
||||
public Optional <Map<String, String>> apply(HttpResponse response) {
|
||||
checkNotNull(response, "response");
|
||||
return parser.apply(response);
|
||||
}
|
||||
|
|
|
@ -72,11 +72,11 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"networks\": [{\"uuid\": \"4ebd35cf-bfe7-4d93-b0d8-eb468ce2245a\"}]}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"networks\": [{\"uuid\": \"4ebd35cf-bfe7-4d93-b0d8-eb468ce2245a\"}]}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_networks_response.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_networks_response.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
@ -107,11 +107,11 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"OS-DCF:diskConfig\":\"AUTO\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"OS-DCF:diskConfig\":\"AUTO\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_disk_config_auto.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_disk_config_auto.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
@ -142,11 +142,11 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"config_drive\":\"true\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"config_drive\":\"true\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_config_drive.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_config_drive.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
@ -176,11 +176,11 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"networks\":[{\"uuid\":\"12345\", \"port\":\"67890\", \"fixed_ip\":\"192.168.0.1\"},{\"uuid\":\"54321\", \"port\":\"09876\", \"fixed_ip\":\"192.168.0.2\"},{\"uuid\":\"non-nova-uuid\"}]}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"networks\":[{\"uuid\":\"12345\", \"port\":\"67890\", \"fixed_ip\":\"192.168.0.1\"},{\"uuid\":\"54321\", \"port\":\"09876\", \"fixed_ip\":\"192.168.0.2\"},{\"uuid\":\"non-nova-uuid\"}]}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_nova_networks.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_nova_networks.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
@ -223,11 +223,11 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"security_groups\":[{\"name\":\"group1\"}, {\"name\":\"group2\"}]}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"security_groups\":[{\"name\":\"group1\"}, {\"name\":\"group2\"}]}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
@ -264,12 +264,12 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"key_name\":\"foo\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"key_name\":\"foo\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_no_adminpass.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_no_adminpass.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
@ -314,11 +314,11 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_no_adminpass.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_no_adminpass.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
|
||||
.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess)
|
||||
|
|
|
@ -65,7 +65,7 @@ public class NovaSecurityGroupToSecurityGroupTest {
|
|||
ZoneAndName.fromZoneAndName("az-1.region-a.geo-1", "some-other-group"), new SecurityGroupInZone(securityGroupWithCidr(), "az-1.region-a.geo-1"));
|
||||
|
||||
// weird compilation error means have to declare extra generics for call to build() - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365818
|
||||
private static final Supplier <LoadingCache<ZoneAndName, SecurityGroupInZone>> groupCache = Suppliers.<LoadingCache<ZoneAndName,SecurityGroupInZone>> ofInstance(
|
||||
private static final Supplier <LoadingCache<ZoneAndName, SecurityGroupInZone>> groupCache = Suppliers.<LoadingCache<ZoneAndName, SecurityGroupInZone>> ofInstance(
|
||||
CacheBuilder.newBuilder().<ZoneAndName, SecurityGroupInZone>build(CacheLoader.from(Functions.forMap(groupMap))));
|
||||
|
||||
public static final SecurityGroupRuleToIpPermission ruleConverter = new SecurityGroupRuleToIpPermission(returnSecurityGroupExistsInZone, locationIndex,
|
||||
|
|
|
@ -274,7 +274,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
api.attachVolumeToServerAsDevice("1", "instance-1","/dev/vdc");
|
||||
api.attachVolumeToServerAsDevice("1", "instance-1", "/dev/vdc");
|
||||
}
|
||||
|
||||
public void testDetachVolume() {
|
||||
|
|
|
@ -130,7 +130,7 @@ public class VolumeAttachmentApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeAttachmentExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
api.attachVolumeToServerAsDevice("1", "instance-1","/dev/vdc");
|
||||
api.attachVolumeToServerAsDevice("1", "instance-1", "/dev/vdc");
|
||||
}
|
||||
|
||||
public void testDetachVolume() {
|
||||
|
|
|
@ -170,7 +170,7 @@ public class ImageApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/images/" + imageId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(200)
|
||||
|
@ -196,7 +196,7 @@ public class ImageApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/images/" +imageId + "/metadata")
|
||||
.addHeader("Accept", "*/*")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
@ -225,7 +225,7 @@ public class ImageApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/images/" + imageId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(200)
|
||||
|
@ -251,7 +251,7 @@ public class ImageApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + imageId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(404)
|
||||
|
|
|
@ -127,12 +127,12 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
|
||||
responseWithKeystoneAccess, createServer, createServerResponse);
|
||||
|
@ -149,12 +149,12 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"availability_zone\":\"nova\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"availability_zone\":\"nova\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_in_zone.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_in_zone.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
|
||||
responseWithKeystoneAccess, createServer, createServerResponse);
|
||||
|
@ -174,12 +174,12 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"security_groups\":[{\"name\":\"group1\"},{\"name\":\"group2\"}]}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"security_groups\":[{\"name\":\"group1\"},{\"name\":\"group2\"}]}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
|
||||
|
@ -199,12 +199,12 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"networks\":[{\"uuid\":\"b3856ac0-f481-11e2-b778-0800200c9a66\"},{\"uuid\":\"bf0f0f90-f481-11e2-b778-0800200c9a66\"}]}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"networks\":[{\"uuid\":\"b3856ac0-f481-11e2-b778-0800200c9a66\"},{\"uuid\":\"bf0f0f90-f481-11e2-b778-0800200c9a66\"}]}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
|
||||
|
@ -224,12 +224,12 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"OS-DCF:diskConfig\":\"AUTO\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"OS-DCF:diskConfig\":\"AUTO\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_disk_config_auto.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_disk_config_auto.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(
|
||||
|
@ -250,12 +250,12 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"OS-DCF:diskConfig\":\"MANUAL\"}}","application/json"))
|
||||
"{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"OS-DCF:diskConfig\":\"MANUAL\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
|
||||
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/new_server_disk_config_manual.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/new_server_disk_config_manual.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(
|
||||
|
@ -276,7 +276,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.addHeader("Accept", "*/*")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType(
|
||||
"{\"rebuild\":{\"adminPass\":\"password\",\"imageRef\":\"1234\",\"name\":\"newName\",\"accessIPv4\":\"1.1.1.1\",\"accessIPv6\":\"fe80::100\"}}","application/json"))
|
||||
"{\"rebuild\":{\"adminPass\":\"password\",\"imageRef\":\"1234\",\"name\":\"newName\",\"accessIPv4\":\"1.1.1.1\",\"accessIPv6\":\"fe80::100\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse rebuildServerResponse = HttpResponse.builder().statusCode(202).build();
|
||||
|
@ -492,7 +492,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(200)
|
||||
|
@ -518,7 +518,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "*/*")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 1\",\"Image Version\":\"2.1\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
@ -547,7 +547,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(200)
|
||||
|
@ -573,7 +573,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(404)
|
||||
|
@ -624,7 +624,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(404)
|
||||
|
@ -654,7 +654,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(200)
|
||||
|
@ -680,7 +680,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/" + serverId + "/metadata")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("X-Auth-Token", authToken)
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}","application/json"))
|
||||
.payload(payloadFromStringWithContentType("{\"metadata\":{\"Server Label\":\"Web Head 2\",\"Server Description\":\"Simple Server\"}}", "application/json"))
|
||||
.build();
|
||||
|
||||
HttpResponse setMetadataResponse = HttpResponse.builder().statusCode(404)
|
||||
|
@ -752,7 +752,7 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
|
|||
|
||||
|
||||
HttpResponse serverDiagnosticsResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
|
||||
.payload(payloadFromResourceWithContentType("/server_diagnostics.json","application/json; charset=UTF-8")).build();
|
||||
.payload(payloadFromResourceWithContentType("/server_diagnostics.json", "application/json; charset=UTF-8")).build();
|
||||
|
||||
NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
|
||||
responseWithKeystoneAccess, getDiagnostics, serverDiagnosticsResponse);
|
||||
|
|
|
@ -69,7 +69,7 @@ public class CreateSecurityGroupIfNeededTest extends BaseNovaApiExpectTest {
|
|||
|
||||
int ruleId = 10331;
|
||||
|
||||
for (int port : ImmutableList.of(22,8080)) {
|
||||
for (int port : ImmutableList.of(22, 8080)) {
|
||||
|
||||
HttpRequest createCidrRule = HttpRequest.builder().method("POST").endpoint(
|
||||
URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-group-rules")).headers(
|
||||
|
|
|
@ -47,7 +47,7 @@ import com.google.common.base.Throwables;
|
|||
*/
|
||||
@Test(groups = "live")
|
||||
public class BaseNovaApiLiveTest extends BaseApiLiveTest<NovaApi> {
|
||||
protected String hostName = System.getProperty("user.name").replace('.','-').toLowerCase();
|
||||
protected String hostName = System.getProperty("user.name").replace('.', '-').toLowerCase();
|
||||
|
||||
public BaseNovaApiLiveTest() {
|
||||
provider = "openstack-nova";
|
||||
|
|
|
@ -31,27 +31,27 @@ import com.google.common.collect.ImmutableMap;
|
|||
*
|
||||
* @author Leander Beernaert
|
||||
*/
|
||||
public class ParseServerDiagnostics extends BaseItemParserTest<Optional<Map<String,String>>> {
|
||||
public class ParseServerDiagnostics extends BaseItemParserTest<Optional<Map<String, String>>> {
|
||||
|
||||
|
||||
@Override
|
||||
public Optional<Map<String,String>> expected() {
|
||||
return Optional.<Map<String,String>>of(
|
||||
new ImmutableMap.Builder<String,String>()
|
||||
public Optional<Map<String, String>> expected() {
|
||||
return Optional.<Map<String, String>>of(
|
||||
new ImmutableMap.Builder<String, String>()
|
||||
.put("vnet0_tx_errors", "0")
|
||||
.put("vda_read","77364736")
|
||||
.put("vda_write","415446016")
|
||||
.put("vnet0_tx_packets","9701")
|
||||
.put("vda_write_req","47278")
|
||||
.put("cpu0_time","143150000000")
|
||||
.put("vnet0_tx","1691221")
|
||||
.put("vnet0_rx_drop","0")
|
||||
.put("vda_errors","-1")
|
||||
.put("vnet0_rx_errors","0")
|
||||
.put("memory","524288")
|
||||
.put("vnet0_rx_packets","11271")
|
||||
.put("vda_read_req","9551")
|
||||
.put("vnet0_rx","1805288")
|
||||
.put("vnet0_tx_drop","0").build());
|
||||
.put("vda_read", "77364736")
|
||||
.put("vda_write", "415446016")
|
||||
.put("vnet0_tx_packets", "9701")
|
||||
.put("vda_write_req", "47278")
|
||||
.put("cpu0_time", "143150000000")
|
||||
.put("vnet0_tx", "1691221")
|
||||
.put("vnet0_rx_drop", "0")
|
||||
.put("vda_errors", "-1")
|
||||
.put("vnet0_rx_errors", "0")
|
||||
.put("memory", "524288")
|
||||
.put("vnet0_rx_packets", "11271")
|
||||
.put("vda_read_req", "9551")
|
||||
.put("vnet0_rx", "1805288")
|
||||
.put("vnet0_tx_drop", "0").build());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,9 @@ public class BindGrantUserToJson implements MapBinder {
|
|||
databases = (List<String>) postParams.get("databases");
|
||||
}
|
||||
|
||||
List<Map<String,String>> databaseList = Lists.newArrayList();
|
||||
List<Map<String, String>> databaseList = Lists.newArrayList();
|
||||
for(String databaseName : databases) {
|
||||
Map<String,String> singleDatabase = Maps.newHashMap();
|
||||
Map<String, String> singleDatabase = Maps.newHashMap();
|
||||
singleDatabase.put("name", databaseName);
|
||||
databaseList.add(singleDatabase);
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ public class User implements Comparable<User>{
|
|||
private final String name;
|
||||
private final String password;
|
||||
private final String host;
|
||||
private final List<Map<String,String>> databases;
|
||||
private final List<Map<String, String>> databases;
|
||||
|
||||
@ConstructorProperties({
|
||||
"name", "password", "host", "databases"
|
||||
})
|
||||
protected User(String name, String password, String host, List<Map<String,String>> databases) {
|
||||
protected User(String name, String password, String host, List<Map<String, String>> databases) {
|
||||
this.name = checkNotNull(name, "name required");
|
||||
this.password = password;
|
||||
this.host = host;
|
||||
|
@ -64,11 +64,11 @@ public class User implements Comparable<User>{
|
|||
this.databases = Lists.newArrayList();
|
||||
}
|
||||
else {
|
||||
// Using List<Map<String,String>> as the internal representation makes it easy to serialize properly
|
||||
// Using List<Map<String, String>> as the internal representation makes it easy to serialize properly
|
||||
// with less code; this code is to present databases as List<String> to the user.
|
||||
List<Map<String,String>> databaseList = Lists.newArrayList();
|
||||
List<Map<String, String>> databaseList = Lists.newArrayList();
|
||||
for(String databaseName : databases) {
|
||||
Map<String,String> singleDatabase = Maps.newHashMap();
|
||||
Map<String, String> singleDatabase = Maps.newHashMap();
|
||||
singleDatabase.put("name", databaseName);
|
||||
databaseList.add(singleDatabase);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class User implements Comparable<User>{
|
|||
*/
|
||||
public List<String> getDatabases() {
|
||||
List<String> databaseList = Lists.newArrayList();
|
||||
for(Map<String,String> database : this.databases) {
|
||||
for(Map<String, String> database : this.databases) {
|
||||
databaseList.add(database.get("name"));
|
||||
}
|
||||
return ImmutableList.copyOf(databaseList);
|
||||
|
|
|
@ -39,7 +39,7 @@ import com.google.common.collect.Maps;
|
|||
public class DatabaseApiLiveTest extends BaseTroveApiLiveTest {
|
||||
|
||||
// zone to instance
|
||||
private static Map<String,List<Instance>> instancesToDelete = Maps.newHashMap();
|
||||
private static Map<String, List<Instance>> instancesToDelete = Maps.newHashMap();
|
||||
// not deleting databases. they will be deleted when instances are deleted
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,7 +47,7 @@ public class FlavorApiExpectTest extends BaseTroveApiExpectTest {
|
|||
).getFlavorApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Flavor> flavors = api.list().toSet();
|
||||
assertEquals(flavors.size(),6);
|
||||
assertEquals(flavors.size(), 6);
|
||||
assertEquals(flavors.iterator().next().getRam(), 512);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class InstanceApiExpectTest extends BaseTroveApiExpectTest {
|
|||
).getInstanceApiForZone("RegionOne");
|
||||
|
||||
Instance instance = api.create("1", 2, "json_rack_instance");
|
||||
assertEquals(instance.getSize(),2);
|
||||
assertEquals(instance.getSize(), 2);
|
||||
assertEquals(instance.getName(), "json_rack_instance");
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ public class InstanceApiExpectTest extends BaseTroveApiExpectTest {
|
|||
).getInstanceApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Instance> instances = api.list().toSet();
|
||||
assertEquals(instances.size(),2);
|
||||
assertEquals(instances.size(), 2);
|
||||
assertEquals(instances.iterator().next().getSize(), 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ import com.google.common.collect.Maps;
|
|||
@Test(groups = "live", testName = "InstanceApiLiveTest")
|
||||
public class InstanceApiLiveTest extends BaseTroveApiLiveTest {
|
||||
|
||||
private static Map<String,List<Instance>> created = Maps.newHashMap();
|
||||
private static Map<String, List<Instance>> created = Maps.newHashMap();
|
||||
|
||||
@Override
|
||||
@BeforeClass(groups = { "integration", "live" })
|
||||
|
|
|
@ -48,7 +48,7 @@ import com.google.common.collect.Maps;
|
|||
public class UserApiLiveTest extends BaseTroveApiLiveTest {
|
||||
|
||||
// zone to instance
|
||||
private static Map<String,List<Instance>> instancesToDelete = Maps.newHashMap();
|
||||
private static Map<String, List<Instance>> instancesToDelete = Maps.newHashMap();
|
||||
// not deleting users. they will be deleted when instances are deleted
|
||||
|
||||
@Override
|
||||
|
|
|
@ -61,7 +61,7 @@ public class TroveUtilsExpectTest extends BaseTroveApiExpectTest {
|
|||
|
||||
TroveUtils utils = new TroveUtils(api);
|
||||
Instance instance = utils.getWorkingInstance("RegionOne", "json_rack_instance", "1", 2);
|
||||
assertEquals(instance.getSize(),2);
|
||||
assertEquals(instance.getSize(), 2);
|
||||
assertEquals(instance.getName(), "json_rack_instance");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class ObjectToBlobMetadata implements Function<ObjectMetadata, MutableBlo
|
|||
|
||||
@Inject
|
||||
public ObjectToBlobMetadata(IfDirectoryReturnNameStrategy ifDirectoryReturnName,
|
||||
LoadingCache<String, AccessControlList> bucketAcls,Function<String, Location> locationOfBucket) {
|
||||
LoadingCache<String, AccessControlList> bucketAcls, Function<String, Location> locationOfBucket) {
|
||||
this.ifDirectoryReturnName = ifDirectoryReturnName;
|
||||
this.bucketAcls = bucketAcls;
|
||||
this.locationOfBucket = locationOfBucket;
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BatchResponseHandler<V> extends ParseSax.HandlerForGeneratedRequest
|
|||
private final ParseSax.HandlerForGeneratedRequestWithResult<Map.Entry<String, V>> resultHandler;
|
||||
private final BatchErrorHandler errorHandler;
|
||||
|
||||
private ImmutableMap.Builder<String, V> results = ImmutableMap.<String,V> builder();
|
||||
private ImmutableMap.Builder<String, V> results = ImmutableMap.<String, V> builder();
|
||||
private Builder<BatchError> errors = ImmutableSet.<BatchError> builder();
|
||||
|
||||
private boolean inResult;
|
||||
|
|
|
@ -47,8 +47,8 @@ public class ChangeMessageVisibilityBatchResponseTest extends BaseHandlerTest {
|
|||
|
||||
public BatchResult<String> expected() {
|
||||
return BatchResult.<String> builder()
|
||||
.put("change_visibility_msg_2","change_visibility_msg_2")
|
||||
.put("change_visibility_msg_3","change_visibility_msg_3")
|
||||
.put("change_visibility_msg_2", "change_visibility_msg_2")
|
||||
.put("change_visibility_msg_3", "change_visibility_msg_3")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ public class DeleteMessageBatchResponseTest extends BaseHandlerTest {
|
|||
|
||||
public BatchResult<String> expected() {
|
||||
return BatchResult.<String> builder()
|
||||
.put("msg1","msg1")
|
||||
.put("msg2","msg2")
|
||||
.put("msg1", "msg1")
|
||||
.put("msg2", "msg2")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class GetQueueAttributesResponseTest extends BaseHandlerTest {
|
|||
.put("ApproximateNumberOfMessagesDelayed", "0")
|
||||
.put("CreatedTimestamp", "1347566436")
|
||||
.put("LastModifiedTimestamp", "1347566436")
|
||||
.put("VisibilityTimeout","30")
|
||||
.put("VisibilityTimeout", "30")
|
||||
.put("MaximumMessageSize", "65536")
|
||||
.put("MessageRetentionPeriod", "345600")
|
||||
.put("DelaySeconds", "0")
|
||||
|
|
|
@ -92,7 +92,7 @@ public class SwiftBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
|
|||
protected void checkContentDisposition(Blob blob, String contentDisposition) {
|
||||
// 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);
|
||||
super.checkContentDisposition(blob, contentDisposition);
|
||||
}
|
||||
|
||||
// not supported in swift
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SwiftContainerIntegrationLiveTest extends BaseContainerIntegrationT
|
|||
assertEquals(containerMetadata.getMetadata().get("key2"), "value2");
|
||||
assertEquals(containerMetadata.getMetadata().get("key3"), "value3");
|
||||
|
||||
assertTrue(swift.deleteContainerMetadata(containerName, ImmutableList.<String> of("key2","key3")));
|
||||
assertTrue(swift.deleteContainerMetadata(containerName, ImmutableList.<String> of("key2", "key3")));
|
||||
|
||||
containerMetadata = swift.getContainerMetadata(containerName);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class KeystoneStorageEndpointModuleTest {
|
|||
expect(mockSupplier.get())
|
||||
.andReturn(endpoints)
|
||||
.anyTimes();
|
||||
expect(mockFactory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE,apiVersion))
|
||||
expect(mockFactory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, apiVersion))
|
||||
.andReturn(mockSupplier)
|
||||
.anyTimes();
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class KeystoneStorageEndpointModuleTest {
|
|||
public void testEmptyRegion() {
|
||||
final KeystoneStorageEndpointModule moduleToTest = new KeystoneStorageEndpointModule();
|
||||
|
||||
// Test with an empty Region - just ensure we get either a region 1,2 or 3
|
||||
// Test with an empty Region - just ensure we get either a region 1, 2 or 3
|
||||
// URI
|
||||
Supplier<URI> resultingSupplier = moduleToTest.provideStorageUrl(mockFactory, apiVersion, "");
|
||||
assertNotNull(resultingSupplier);
|
||||
|
|
|
@ -157,7 +157,7 @@ public class StubSwiftAsyncClient implements CommonSwiftAsyncClient {
|
|||
return immediateFuture(Sets.newHashSet(Iterables.transform(listing,
|
||||
new Function<StorageMetadata, ContainerMetadata>() {
|
||||
public ContainerMetadata apply(StorageMetadata md) {
|
||||
return ContainerMetadata.builder().name(md.getName()).count(-1).bytes(-1).metadata(new HashMap<String,String>()).build();
|
||||
return ContainerMetadata.builder().name(md.getName()).count(-1).bytes(-1).metadata(new HashMap<String, String>()).build();
|
||||
}
|
||||
})));
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class VCloudComputeServiceAdapterTest extends BaseVCloudComputeServiceExp
|
|||
|
||||
Iterable<VAppTemplate> hardwareProfiles = adapter.listHardwareProfiles();
|
||||
|
||||
Iterable<URI> hardwareProfileRefs = Iterables.transform(ImmutableList.copyOf(hardwareProfiles), new Function<VAppTemplate,URI>() {
|
||||
Iterable<URI> hardwareProfileRefs = Iterables.transform(ImmutableList.copyOf(hardwareProfiles), new Function<VAppTemplate, URI>() {
|
||||
@Override public URI apply(VAppTemplate input) {
|
||||
return input.getHref();
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class CatalogItemHandlerTest {
|
|||
URI.create("https://myvdc.carrenza.net/api/v1.0/catalogItem/ecd4d3a0-0d12-4195-a6d2-14cdf9f925a3"),
|
||||
null, new ReferenceTypeImpl("ubuntu10.10x64", "application/vnd.vmware.vcloud.vAppTemplate+xml",
|
||||
URI.create("https://myvdc.carrenza.net/api/v1.0/vAppTemplate/vappTemplate-123766ea-2b55-482c-8adf-735ab1952834")),
|
||||
ImmutableSortedMap.<String,String>of()));
|
||||
ImmutableSortedMap.<String, String>of()));
|
||||
}
|
||||
|
||||
public void testApplyInputStreamWithNamespaceUsingDefault() {
|
||||
|
@ -81,6 +81,6 @@ public class CatalogItemHandlerTest {
|
|||
URI.create("https://myvdc.carrenza.net/api/v1.0/catalogItem/ecd4d3a0-0d12-4195-a6d2-14cdf9f925a3"),
|
||||
null, new ReferenceTypeImpl("ubuntu10.10x64", "application/vnd.vmware.vcloud.vAppTemplate+xml",
|
||||
URI.create("https://myvdc.carrenza.net/api/v1.0/vAppTemplate/vappTemplate-123766ea-2b55-482c-8adf-735ab1952834")),
|
||||
ImmutableSortedMap.<String,String>of()));
|
||||
ImmutableSortedMap.<String, String>of()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class BindMapToHeadersWithPrefix implements Binder {
|
|||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <R extends HttpRequest> R bindToRequest(R request, Object input) {
|
||||
checkArgument(checkNotNull(input, "input") instanceof Map<?,?>, "this binder is only valid for Maps!");
|
||||
checkArgument(checkNotNull(input, "input") instanceof Map<?, ?>, "this binder is only valid for Maps!");
|
||||
checkNotNull(request, "request");
|
||||
|
||||
Map<String, String> userMetadata = Maps2.transformKeys((Map<String, String>) input, FN);
|
||||
|
|
|
@ -91,11 +91,11 @@ public class BlobToHttpGetOptionsTest {
|
|||
@Test
|
||||
public void testRanges() {
|
||||
org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions();
|
||||
in.range(0,1024);
|
||||
in.range(0, 1024);
|
||||
in.startAt(2048);
|
||||
|
||||
GetOptions expected = new GetOptions();
|
||||
expected.range(0,1024);
|
||||
expected.range(0, 1024);
|
||||
expected.startAt(2048);
|
||||
|
||||
assertEquals(fn.apply(in), expected);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Link {
|
|||
return new Link(relation, null, href);
|
||||
}
|
||||
|
||||
public static Link create(Relation relation,String type, URI href) {
|
||||
public static Link create(Relation relation, String type, URI href) {
|
||||
return new Link(relation, type, href);
|
||||
}
|
||||
|
||||
|
|
|
@ -495,13 +495,13 @@ public class TemplateBuilderImpl implements TemplateBuilder {
|
|||
.compare(left.getName(), right.getName(), Ordering.<String> natural().nullsLast())
|
||||
.compare(left.getVersion(), right.getVersion(), Ordering.<String> natural().nullsLast())
|
||||
.compare(left.getDescription(), right.getDescription(), Ordering.<String> natural().nullsLast())
|
||||
.compare(left.getOperatingSystem().getName(), right.getOperatingSystem().getName(),//
|
||||
.compare(left.getOperatingSystem().getName(), right.getOperatingSystem().getName(),
|
||||
Ordering.<String> natural().nullsLast())
|
||||
.compare(left.getOperatingSystem().getVersion(), right.getOperatingSystem().getVersion(),//
|
||||
.compare(left.getOperatingSystem().getVersion(), right.getOperatingSystem().getVersion(),
|
||||
Ordering.<String> natural().nullsLast())
|
||||
.compare(left.getOperatingSystem().getDescription(), right.getOperatingSystem().getDescription(),//
|
||||
.compare(left.getOperatingSystem().getDescription(), right.getOperatingSystem().getDescription(),
|
||||
Ordering.<String> natural().nullsLast())
|
||||
.compare(left.getOperatingSystem().getArch(), right.getOperatingSystem().getArch(),//
|
||||
.compare(left.getOperatingSystem().getArch(), right.getOperatingSystem().getArch(),
|
||||
Ordering.<String> natural().nullsLast()).result();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -353,7 +353,7 @@ public class ContextBuilder {
|
|||
private Properties currentStateToUnexpandedProperties() {
|
||||
Properties defaults = new Properties();
|
||||
defaults.putAll(apiMetadata.getDefaultProperties());
|
||||
defaults.setProperty(PROPERTY_PROVIDER,providerId);
|
||||
defaults.setProperty(PROPERTY_PROVIDER, providerId);
|
||||
if (providerMetadata.isPresent()) {
|
||||
defaults.putAll(providerMetadata.get().getDefaultProperties());
|
||||
defaults.setProperty(PROPERTY_ISO3166_CODES, Joiner.on(',').join(providerMetadata.get().getIso3166Codes()));
|
||||
|
@ -409,7 +409,7 @@ public class ContextBuilder {
|
|||
for (String key : keys) {
|
||||
try {
|
||||
String scopedProperty = ImmutableList.copyOf(Splitter.on('.').split(key)).get(1);
|
||||
mutable.setProperty(key, searchPropertiesForProviderScopedProperty(mutable, providerId,scopedProperty));
|
||||
mutable.setProperty(key, searchPropertiesForProviderScopedProperty(mutable, providerId, scopedProperty));
|
||||
} catch (NoSuchElementException e) {
|
||||
if (!optionalKeys.contains(key))
|
||||
throw e;
|
||||
|
|
|
@ -174,7 +174,7 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
|
|||
Payload payload = request.getPayload();
|
||||
if (payload != null) {
|
||||
MutableContentMetadata md = payload.getContentMetadata();
|
||||
for (Map.Entry<String,String> entry : contentMetadataCodec.toHeaders(md).entries()) {
|
||||
for (Map.Entry<String, String> entry : contentMetadataCodec.toHeaders(md).entries()) {
|
||||
connection.setRequestProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (chunked) {
|
||||
|
|
|
@ -72,7 +72,7 @@ public class BindMapToStringPayloadTest {
|
|||
.method("POST").endpoint("http://localhost").build();
|
||||
|
||||
GeneratedHttpRequest newRequest = binder()
|
||||
.bindToRequest(request, ImmutableMap.<String,Object>of("adminPass", "foo"));
|
||||
.bindToRequest(request, ImmutableMap.<String, Object>of("adminPass", "foo"));
|
||||
|
||||
assertEquals(newRequest.getRequestLine(), request.getRequestLine());
|
||||
assertEquals(newRequest.getPayload().getRawContent(), "{\"changePassword\":{\"adminPass\":\"foo\"}}");
|
||||
|
@ -84,7 +84,7 @@ public class BindMapToStringPayloadTest {
|
|||
GeneratedHttpRequest request = GeneratedHttpRequest.builder()
|
||||
.invocation(Invocation.create(noPayload, ImmutableList.<Object> of("robot")))
|
||||
.method("POST").endpoint("http://localhost").build();
|
||||
binder().bindToRequest(request, ImmutableMap.<String,Object>of("fooble", "robot"));
|
||||
binder().bindToRequest(request, ImmutableMap.<String, Object>of("fooble", "robot"));
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = IllegalArgumentException.class)
|
||||
|
|
|
@ -1119,7 +1119,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
|||
ImmutableList.<Object> of("foobledata")));
|
||||
assertRequestLineEquals(httpRequest, "POST http://localhost:9999 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "");
|
||||
assertPayloadEquals(httpRequest,//
|
||||
assertPayloadEquals(httpRequest,
|
||||
"----JCLOUDS--\r\n" + //
|
||||
"Content-Disposition: form-data; name=\"fooble\"\r\n" + //
|
||||
"\r\n" + //
|
||||
|
@ -1140,7 +1140,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
|||
ImmutableList.<Object> of("name", "foobledata")));
|
||||
assertRequestLineEquals(httpRequest, "POST http://localhost:9999 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "");
|
||||
assertPayloadEquals(httpRequest,//
|
||||
assertPayloadEquals(httpRequest,
|
||||
"----JCLOUDS--\r\n" + //
|
||||
"Content-Disposition: form-data; name=\"name\"\r\n" + //
|
||||
"\r\n" + //
|
||||
|
@ -1170,7 +1170,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
|||
ImmutableList.<Object> of("name", file)));
|
||||
assertRequestLineEquals(httpRequest, "POST http://localhost:9999 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "");
|
||||
assertPayloadEquals(httpRequest,//
|
||||
assertPayloadEquals(httpRequest,
|
||||
"----JCLOUDS--\r\n" + //
|
||||
"Content-Disposition: form-data; name=\"name\"\r\n" + //
|
||||
"\r\n" + //
|
||||
|
@ -1189,7 +1189,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
|||
ImmutableList.<Object> of("name", "goo".getBytes())));
|
||||
assertRequestLineEquals(httpRequest, "POST http://localhost:9999 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "");
|
||||
assertPayloadEquals(httpRequest,//
|
||||
assertPayloadEquals(httpRequest,
|
||||
"----JCLOUDS--\r\n" + //
|
||||
"Content-Disposition: form-data; name=\"name\"\r\n" + //
|
||||
"\r\n" + //
|
||||
|
@ -1213,7 +1213,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
|||
ImmutableList.<Object> of("name", file)));
|
||||
assertRequestLineEquals(httpRequest, "POST http://localhost:9999 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "");
|
||||
assertPayloadEquals(httpRequest,//
|
||||
assertPayloadEquals(httpRequest,
|
||||
"----JCLOUDS--\r\n" + //
|
||||
"Content-Disposition: form-data; name=\"name\"\r\n" + //
|
||||
"\r\n" + //
|
||||
|
|
|
@ -159,7 +159,7 @@ public class ApacheHCUtils {
|
|||
// TODO Reproducing old behaviour exactly; ignoring Content-Type, Content-Length and Content-MD5
|
||||
Set<String> desiredHeaders = ImmutableSet.of("Content-Disposition", "Content-Encoding", "Content-Language", "Expires");
|
||||
MutableContentMetadata md = payload.getContentMetadata();
|
||||
for (Map.Entry<String,String> entry : contentMetadataCodec.toHeaders(md).entries()) {
|
||||
for (Map.Entry<String, String> entry : contentMetadataCodec.toHeaders(md).entries()) {
|
||||
if (desiredHeaders.contains(entry.getKey())) {
|
||||
apacheRequest.addHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class AWSCloudWatchProviderMetadata extends BaseProviderMetadata {
|
|||
.endpoint("https://monitoring.us-east-1.amazonaws.com")
|
||||
.homepage(URI.create("http://aws.amazon.com/cloudwatch"))
|
||||
.console(URI.create("https://console.aws.amazon.com/cloudwatch/home"))
|
||||
.linkedServices("aws-ec2","aws-elb", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.linkedServices("aws-ec2", "aws-elb", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.iso3166Codes("US-VA", "US-CA", "BR-SP", "US-OR", "IE", "SG", "AU-NSW", "JP-13")
|
||||
.apiMetadata(
|
||||
new CloudWatchApiMetadata().toBuilder()
|
||||
|
|
|
@ -83,7 +83,7 @@ public class AWSEC2ProviderMetadata extends BaseProviderMetadata {
|
|||
.homepage(URI.create("http://aws.amazon.com/ec2"))
|
||||
.console(URI.create("https://console.aws.amazon.com/ec2/home"))
|
||||
.defaultProperties(AWSEC2ProviderMetadata.defaultProperties())
|
||||
.linkedServices("aws-ec2","aws-elb", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.linkedServices("aws-ec2", "aws-elb", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.iso3166Codes("US-VA", "US-CA", "US-OR", "BR-SP", "IE", "SG", "AU-NSW", "JP-13");
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.rest.Binder;
|
|||
public class BindTagFiltersToIndexedFormParams implements Binder {
|
||||
@Override
|
||||
public <R extends HttpRequest> R bindToRequest(R request, Object input) {
|
||||
checkArgument(checkNotNull(input, "input") instanceof Map<?,?>, "this binder is only valid for Map<?, Iterable<?>>");
|
||||
checkArgument(checkNotNull(input, "input") instanceof Map<?, ?>, "this binder is only valid for Map<?, Iterable<?>>");
|
||||
return AWSUtils.indexMapOfIterableToFormValuesWithPrefix(request, "Filter", "Name", "Value", input);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public class AWSEC2ListNodesStrategy extends EC2ListNodesStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<? extends RunningInstance> pollRunningInstancesByRegionsAndIds(final Multimap<String,String> idsByRegions) {
|
||||
protected Iterable<? extends RunningInstance> pollRunningInstancesByRegionsAndIds(final Multimap<String, String> idsByRegions) {
|
||||
Iterable<? extends AWSRunningInstance> spots = filter(transform(concat(transform(idsByRegions.keySet(),
|
||||
spotInstancesByIdInRegion(idsByRegions))),
|
||||
|
||||
|
@ -93,7 +93,7 @@ public class AWSEC2ListNodesStrategy extends EC2ListNodesStrategy {
|
|||
};
|
||||
}
|
||||
|
||||
protected Function<String, Set<SpotInstanceRequest>> spotInstancesByIdInRegion(final Multimap<String,String> idsByRegions) {
|
||||
protected Function<String, Set<SpotInstanceRequest>> spotInstancesByIdInRegion(final Multimap<String, String> idsByRegions) {
|
||||
return new Function<String, Set<SpotInstanceRequest>>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -106,7 +106,7 @@ public class AWSRunningInstanceToNodeMetadataTest {
|
|||
.tag("Name", "foo")
|
||||
.tag("Empty", "")
|
||||
.hypervisor(Hypervisor.XEN)
|
||||
.build(),//
|
||||
.build(),
|
||||
new AWSRunningInstance.Builder()
|
||||
.region(defaultRegion)
|
||||
.instanceId("i-931444f2")
|
||||
|
@ -206,7 +206,7 @@ public class AWSRunningInstanceToNodeMetadataTest {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
Names.bindProperties(binder(),new AWSEC2ApiMetadata().getDefaultProperties());
|
||||
Names.bindProperties(binder(), new AWSEC2ApiMetadata().getDefaultProperties());
|
||||
}
|
||||
|
||||
}).getInstance(GroupNamingConvention.Factory.class);
|
||||
|
|
|
@ -62,7 +62,7 @@ public class DescribeSecurityGroupsResponseTest extends BaseEC2HandlerTest {
|
|||
// .vpcId("vpc-99999999")
|
||||
.ipPermission(IpPermission.builder()
|
||||
.ipProtocol(IpProtocol.ALL)
|
||||
.tenantIdGroupNamePair("123123123123","sg-11111111").build())
|
||||
.tenantIdGroupNamePair("123123123123", "sg-11111111").build())
|
||||
// .ipPermissionEgress(IpPermission.builder()
|
||||
// .ipProtocol(IpProtocol.ALL)
|
||||
// .ipRange("0.0.0.0/0").build())
|
||||
|
|
|
@ -86,7 +86,7 @@ public class AWSS3ProviderMetadata extends BaseProviderMetadata {
|
|||
.apiMetadata(new AWSS3ApiMetadata())
|
||||
.homepage(URI.create("http://aws.amazon.com/s3"))
|
||||
.console(URI.create("https://console.aws.amazon.com/s3/home"))
|
||||
.linkedServices("aws-ec2","aws-elb", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.linkedServices("aws-ec2", "aws-elb", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.iso3166Codes("US", "US-CA", "US-OR", "BR-SP", "IE", "SG", "AU-NSW", "JP-13")
|
||||
.defaultProperties(AWSS3ProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
|
|||
PutOptions nonMultipartOptions = PutOptions.Builder.multipart(false);
|
||||
ListenableFuture<String> futureETag = ablobstore.putBlob(container, blob, nonMultipartOptions);
|
||||
return maxTime != null ?
|
||||
futureETag.get(maxTime,TimeUnit.SECONDS) : futureETag.get();
|
||||
futureETag.get(maxTime, TimeUnit.SECONDS) : futureETag.get();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -89,7 +89,7 @@ public class AWSSQSProviderMetadata extends BaseProviderMetadata {
|
|||
.endpoint("https://sqs.us-east-1.amazonaws.com")
|
||||
.homepage(URI.create("http://aws.amazon.com/sqs"))
|
||||
.console(URI.create("https://console.aws.amazon.com/ec2/home"))
|
||||
.linkedServices("aws-ec2", "aws-rds", "aws-sqs", "aws-elb", "aws-iam","aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.linkedServices("aws-ec2", "aws-rds", "aws-sqs", "aws-elb", "aws-iam", "aws-cloudwatch", "aws-s3", "aws-simpledb")
|
||||
.iso3166Codes("US-VA", "US-CA", "BR-SP", "US-OR", "IE", "SG", "AU-NSW", "JP-13")
|
||||
.apiMetadata(new SQSApiMetadata())
|
||||
.defaultProperties(AWSSQSProviderMetadata.defaultProperties());
|
||||
|
|
|
@ -60,7 +60,7 @@ public class AzureBlobProviderMetadata extends BaseProviderMetadata {
|
|||
.homepage(URI.create("http://www.microsoft.com/windowsazure/storage/"))
|
||||
.console(URI.create("https://windows.azure.com/default.aspx"))
|
||||
.linkedServices("azureblob", "azurequeue", "azuretable")
|
||||
.iso3166Codes("US-TX","US-IL","IE-D","SG","NL-NH","HK")
|
||||
.iso3166Codes("US-TX", "US-IL", "IE-D", "SG", "NL-NH", "HK")
|
||||
.defaultProperties(AzureBlobProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ContainerPropertiesImpl implements ContainerProperties {
|
|||
private final String eTag;
|
||||
private final Map<String, String> metadata = Maps.newLinkedHashMap();
|
||||
|
||||
public ContainerPropertiesImpl(URI url, Date lastModified, String eTag,Map<String, String> metadata) {
|
||||
public ContainerPropertiesImpl(URI url, Date lastModified, String eTag, Map<String, String> metadata) {
|
||||
this.url = checkNotNull(url, "url");
|
||||
this.name = checkNotNull(url.getPath(), "url.getPath()").replaceFirst("/", "");
|
||||
this.lastModified = checkNotNull(lastModified, "lastModified");
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ContainerNameValidator extends DnsNameValidator {
|
|||
|
||||
@Inject
|
||||
ContainerNameValidator() {
|
||||
super(3,63);
|
||||
super(3, 63);
|
||||
}
|
||||
|
||||
public void validate(String containerName) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class AzureBlobBlockUploadStrategyTest {
|
|||
expect(client.putBlockList(eq(container), eq(blobName), anyObject(List.class))).andReturn("Fake ETAG");
|
||||
|
||||
AzureBlobBlockUploadStrategy strat = new AzureBlobBlockUploadStrategy(client, slicer);
|
||||
replay(slicer,client);
|
||||
replay(slicer, client);
|
||||
String etag = strat.execute(container, blob);
|
||||
assertEquals(etag, "Fake ETAG");
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class CloudFilesUSProviderMetadata extends BaseProviderMetadata {
|
|||
.homepage(URI.create("http://www.rackspace.com/cloud/cloud_hosting_products/files"))
|
||||
.console(URI.create("https://manage.rackspacecloud.com"))
|
||||
.linkedServices("cloudfiles-us", "cloudservers-us", "cloudloadbalancers-us")
|
||||
.iso3166Codes("US-IL","US-TX", "AU-NSW");
|
||||
.iso3166Codes("US-IL", "US-TX", "AU-NSW");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -69,7 +69,7 @@ public class GleSYSProviderMetadata extends BaseProviderMetadata {
|
|||
.apiMetadata(new GleSYSApiMetadata())
|
||||
.homepage(URI.create("http://www.glesys.com"))
|
||||
.console(URI.create("https://customer.glesys.com/cloud.php"))
|
||||
.iso3166Codes("NL-NH","SE-N","US-NY","SE-AB")
|
||||
.iso3166Codes("NL-NH", "SE-N", "US-NY", "SE-AB")
|
||||
.endpoint("https://api.glesys.com")
|
||||
.defaultProperties(GleSYSProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter<Server
|
|||
* @return a generated random password string
|
||||
*/
|
||||
private String getRandomPassword() {
|
||||
return UUID.randomUUID().toString().replace("-","");
|
||||
return UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ServerApiLiveTest extends BaseGleSYSApiWithAServerLiveTest {
|
|||
|
||||
@Test
|
||||
public void testAllowedArguments() throws Exception {
|
||||
Map<String,AllowedArgumentsForCreateServer> templates = serverApi.getAllowedArgumentsForCreateByPlatform();
|
||||
Map<String, AllowedArgumentsForCreateServer> templates = serverApi.getAllowedArgumentsForCreateByPlatform();
|
||||
|
||||
assertTrue(templates.containsKey("OpenVZ"));
|
||||
assertTrue(templates.containsKey("Xen"));
|
||||
|
|
|
@ -34,7 +34,7 @@ import com.google.common.base.Predicate;
|
|||
*/
|
||||
@Test(groups = "live")
|
||||
public class BaseGleSYSApiLiveTest extends BaseApiLiveTest<GleSYSApi> {
|
||||
protected String hostName = System.getProperty("user.name").replace('.','-').toLowerCase();
|
||||
protected String hostName = System.getProperty("user.name").replace('.', '-').toLowerCase();
|
||||
|
||||
public BaseGleSYSApiLiveTest() {
|
||||
provider = "glesys";
|
||||
|
|
|
@ -89,7 +89,7 @@ public class BaseGleSYSApiWithAServerLiveTest extends BaseGleSYSApiLiveTest {
|
|||
ServerDetails testServer = serverApi.createWithHostnameAndRootPassword(
|
||||
ServerSpec.builder().datacenter("Falkenberg").platform("OpenVZ").templateName("Ubuntu 10.04 LTS 32-bit")
|
||||
.diskSizeGB(5).memorySizeMB(512).cpuCores(1).transferGB(50).build(), hostName, UUID.randomUUID()
|
||||
.toString().replace("-",""));
|
||||
.toString().replace("-", ""));
|
||||
|
||||
assertNotNull(testServer.getId());
|
||||
assertEquals(testServer.getHostname(), hostName);
|
||||
|
|
|
@ -91,7 +91,7 @@ public class SoftLayerProviderMetadata extends BaseProviderMetadata {
|
|||
.apiMetadata(new SoftLayerApiMetadata())
|
||||
.homepage(URI.create("http://www.softlayer.com"))
|
||||
.console(URI.create("https://manage.softlayer.com"))
|
||||
.iso3166Codes("SG","US-CA","US-TX","US-VA","US-WA","US-TX", "NL")
|
||||
.iso3166Codes("SG", "US-CA", "US-TX", "US-VA", "US-WA", "US-TX", "NL")
|
||||
.endpoint("https://api.softlayer.com/rest")
|
||||
.defaultProperties(SoftLayerProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.common.collect.Iterables;
|
|||
/**
|
||||
* Converts an Datacenter into a Location.
|
||||
*/
|
||||
public class DatacenterToLocation implements Function<Datacenter,Location> {
|
||||
public class DatacenterToLocation implements Function<Datacenter, Location> {
|
||||
private final JustProvider provider;
|
||||
|
||||
// allow us to lazy discover the provider of a resource
|
||||
|
|
|
@ -79,12 +79,12 @@ public class ProductOrderToJsonTest {
|
|||
.location("loc456")
|
||||
.quantity(99)
|
||||
.useHourlyPricing(true)
|
||||
.prices(ImmutableSet.of(price1,price2))
|
||||
.prices(ImmutableSet.of(price1, price2))
|
||||
.virtualGuests(guest)
|
||||
.build();
|
||||
|
||||
String expected = String.format(FORMAT.replaceAll("'","\""),
|
||||
123,"loc456",100,101,"myhost","mydomain",99,true);
|
||||
String expected = String.format(FORMAT.replaceAll("'", "\""),
|
||||
123, "loc456", 100, 101, "myhost", "mydomain", 99, true);
|
||||
|
||||
HttpRequest req = binder.bindToRequest(request, order);
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ public class ProductItemToImageTest {
|
|||
OperatingSystem os = i.getOperatingSystem();
|
||||
assertNotNull(os);
|
||||
assertEquals(OsFamily.UBUNTU, os.getFamily());
|
||||
assertEquals("10.04",os.getVersion());
|
||||
assertEquals("10.04", os.getVersion());
|
||||
assertTrue(os.is64Bit());
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ public class ProductItemToImageTest {
|
|||
OperatingSystem os = i.getOperatingSystem();
|
||||
assertNotNull(os);
|
||||
assertEquals(OsFamily.UBUNTU, os.getFamily());
|
||||
assertEquals("10.04",os.getVersion());
|
||||
assertEquals("10.04", os.getVersion());
|
||||
assertFalse(os.is64Bit());
|
||||
}
|
||||
|
||||
|
@ -190,15 +190,15 @@ public class ProductItemToImageTest {
|
|||
public void testId() {
|
||||
ProductItemPrice price = ProductItemPrice.builder().id(1234).build();
|
||||
ProductItem item = ProductItem.builder().prices(price).build();
|
||||
assertEquals("1234",imageId().apply(item));
|
||||
assertEquals("1234", imageId().apply(item));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIdManyPrices() {
|
||||
ProductItemPrice price1 = ProductItemPrice.builder().id(1234).build();
|
||||
ProductItemPrice price2 = ProductItemPrice.builder().id(5678).build();
|
||||
ProductItem item = ProductItem.builder().prices(ImmutableSet.of(price1,price2)).build();
|
||||
assertEquals("1234",imageId().apply(item));
|
||||
ProductItem item = ProductItem.builder().prices(ImmutableSet.of(price1, price2)).build();
|
||||
assertEquals("1234", imageId().apply(item));
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = NoSuchElementException.class)
|
||||
|
@ -214,27 +214,27 @@ public class ProductItemToImageTest {
|
|||
|
||||
@Test
|
||||
public void testOsFamily() {
|
||||
assertEquals(OsFamily.UBUNTU,osFamily().apply("Ubuntu Linux os"));
|
||||
assertEquals(OsFamily.UBUNTU, osFamily().apply("Ubuntu Linux os"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOsFamilyUnrecognized() {
|
||||
assertEquals(OsFamily.UNRECOGNIZED,osFamily().apply("not a known operating system"));
|
||||
assertEquals(OsFamily.UNRECOGNIZED, osFamily().apply("not a known operating system"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOsFamilyNull() {
|
||||
assertEquals(OsFamily.UNRECOGNIZED,osFamily().apply(null));
|
||||
assertEquals(OsFamily.UNRECOGNIZED, osFamily().apply(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOsBitsWithSpace() {
|
||||
assertEquals(osBits().apply("a (32 bit) os"),Integer.valueOf(32));
|
||||
assertEquals(osBits().apply("a (32 bit) os"), Integer.valueOf(32));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOsBitsNoSpace() {
|
||||
assertEquals(osBits().apply("a (64bit) os"),Integer.valueOf(64));
|
||||
assertEquals(osBits().apply("a (64bit) os"), Integer.valueOf(64));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -249,7 +249,7 @@ public class ProductItemToImageTest {
|
|||
|
||||
@Test
|
||||
public void testOsVersion() {
|
||||
assertEquals("2099",osVersion().apply("Windows Server 2099 (256 bit)"));
|
||||
assertEquals("2099", osVersion().apply("Windows Server 2099 (256 bit)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ProductItemsTest {
|
|||
|
||||
@Test
|
||||
public void testDescription() {
|
||||
assertEquals(description().apply(item),"an item");
|
||||
assertEquals(description().apply(item), "an item");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -83,14 +83,14 @@ public class ProductItemsTest {
|
|||
|
||||
@Test
|
||||
public void testPrice() {
|
||||
assertEquals(price().apply(item),price);
|
||||
assertEquals(price().apply(item), price);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPriceMultiplePrices() {
|
||||
ImmutableSet<ProductItemPrice> prices = ImmutableSet.of(price, ProductItemPrice.builder().id(2).build());
|
||||
ProductItem item2 = ProductItem.builder().prices(prices).build();
|
||||
assertEquals(price().apply(item2),price);
|
||||
assertEquals(price().apply(item2), price);
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = NoSuchElementException.class)
|
||||
|
|
|
@ -140,7 +140,7 @@ public class ProductItemsToHardwareTest {
|
|||
ProductItemPrice.builder().id(987).build()).categories(
|
||||
ProductItemCategory.builder().categoryCode("guest_disk1").build()).build();
|
||||
|
||||
Hardware hardware = toHardware.apply(ImmutableSet.of(cpuItem, ramItem, volumeItem,localVolumeItem));
|
||||
Hardware hardware = toHardware.apply(ImmutableSet.of(cpuItem, ramItem, volumeItem, localVolumeItem));
|
||||
|
||||
List<? extends Volume> volumes = hardware.getVolumes();
|
||||
assertEquals(2, volumes.size());
|
||||
|
|
|
@ -70,7 +70,7 @@ public class DatacenterApiLiveTest extends BaseSoftLayerApiLiveTest {
|
|||
Set<Datacenter> response = api().listDatacenters();
|
||||
Set<Datacenter> expected = builder.build();
|
||||
|
||||
assertEquals(response.size(),expected.size());
|
||||
assertEquals(response.size(), expected.size());
|
||||
assertTrue(response.containsAll(expected));
|
||||
|
||||
for (Datacenter datacenter: response) {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ParseProductOrderTest extends BaseItemParserTest<ProductOrder> {
|
|||
ProductOrder expects = expected();
|
||||
Function<HttpResponse, ProductOrder> parser = parser(injector());
|
||||
ProductOrder response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(payload()).build());
|
||||
assertEquals(response,expects);
|
||||
assertEquals(response, expects);
|
||||
hasOs(response);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.testng.annotations.Test;
|
|||
*
|
||||
* @author Jason King
|
||||
*/
|
||||
@Test(sequential = true,groups = "unit")
|
||||
@Test(sequential = true, groups = "unit")
|
||||
public class ProductPackagePredicatesTest {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
<module name="SimplifyBooleanExpression"/>
|
||||
<module name="UnnecessaryParentheses"/>
|
||||
<module name="UnusedImports"/>
|
||||
<module name="WhitespaceAfter">
|
||||
<property name="tokens" value="COMMA"/>
|
||||
</module>
|
||||
</module>
|
||||
<module name="RegexpMultiline">
|
||||
<property name="format" value="=\s*new ArrayList<[^>]"/>
|
||||
|
|
|
@ -33,7 +33,7 @@ public class SshStatements {
|
|||
* lock sshd down so root cannot login, and password auth is disabled,
|
||||
*/
|
||||
public static Statement lockSshd() {
|
||||
return sshdConfig(ImmutableMap.of("PasswordAuthentication","no", "PermitRootLogin","no"));
|
||||
return sshdConfig(ImmutableMap.of("PasswordAuthentication", "no", "PermitRootLogin", "no"));
|
||||
}
|
||||
|
||||
public static Statement sshdConfig(Map<String, String> params) {
|
||||
|
|
Loading…
Reference in New Issue