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