From 6d4ce41d15242ef96acf1ae4babd3b5fe8fd07b1 Mon Sep 17 00:00:00 2001 From: vijaykiran Date: Sat, 29 Oct 2011 16:03:15 +0200 Subject: [PATCH] Code Formatting commit. --- .../cloudstack/CloudStackAsyncClientTest.java | 7 +- .../cloudstack/CloudStackClientLiveTest.java | 2 +- .../features/AccountAsyncClientTest.java | 13 +- .../features/AccountClientLiveTest.java | 6 +- .../features/AddressAsyncClientTest.java | 18 +- .../features/AddressClientLiveTest.java | 4 +- .../features/AsyncJobAsyncClientTest.java | 3 +- .../features/AsyncJobClientLiveTest.java | 3 +- .../BaseCloudStackClientLiveTest.java | 16 +- .../ConfigurationAsyncClientTest.java | 5 +- .../features/FirewallAsyncClientTest.java | 23 +- .../features/FirewallClientLiveTest.java | 4 +- .../features/GuestOSAsyncClientTest.java | 13 +- .../features/GuestOSClientLiveTest.java | 4 +- .../features/HypervisorAsyncClientTest.java | 7 +- .../features/LoadBalancerAsyncClientTest.java | 25 +- .../features/LoadBalancerClientLiveTest.java | 17 +- .../features/NATAsyncClientTest.java | 3 +- .../features/NATClientLiveTest.java | 6 +- .../features/NetworkAsyncClientTest.java | 29 +- .../features/OfferingAsyncClientTest.java | 3 +- .../features/OfferingClientLiveTest.java | 6 +- .../SecurityGroupAsyncClientTest.java | 64 ++-- .../features/TemplateAsyncClientTest.java | 21 +- .../features/TemplateClientLiveTest.java | 4 +- .../VirtualMachineAsyncClientTest.java | 39 +- .../features/ZoneAsyncClientTest.java | 3 +- .../cloudstack/filters/QuerySignerTest.java | 58 +-- .../ParseAsyncJobFromHttpResponseTest.java | 86 +++-- ...euseOrAssociateNewPublicIPAddressTest.java | 23 +- .../options/ListAsyncJobsOptionsTest.java | 1 - .../ListIPForwardingRulesOptionsTest.java | 2 +- .../ListPublicIPAddressesOptionsTest.java | 6 +- .../parse/ListAccountsResponseTest.java | 21 +- .../parse/ListOSCategoriesResponseTest.java | 6 +- .../parse/ListOSTypesResponseTest.java | 338 ++++++++---------- .../ListPublicIPAddressesResponseTest.java | 3 +- .../predicates/NetworkPredicatesTest.java | 29 +- .../PublicIPAddressPredicatesTest.java | 10 +- 39 files changed, 472 insertions(+), 459 deletions(-) diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackAsyncClientTest.java index 172a49e2cd..8d555e2757 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackAsyncClientTest.java @@ -18,15 +18,16 @@ */ package org.jclouds.cloudstack; -import com.google.inject.TypeLiteral; +import java.io.IOException; +import java.util.concurrent.ExecutionException; + import org.jclouds.cloudstack.features.BaseCloudStackAsyncClientTest; import org.jclouds.http.HttpRequest; import org.jclouds.rest.internal.RestAnnotationProcessor; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import java.io.IOException; -import java.util.concurrent.ExecutionException; +import com.google.inject.TypeLiteral; /** * Tests behavior of {@code CloudStackAsyncClient} diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackClientLiveTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackClientLiveTest.java index 1312cbfc3c..eb1e7ccc07 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackClientLiveTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/CloudStackClientLiveTest.java @@ -144,4 +144,4 @@ // super.tearDown(); // } // -//} +// } diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AccountAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AccountAsyncClientTest.java index b75a0da6fa..8c136a15e5 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AccountAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AccountAsyncClientTest.java @@ -38,7 +38,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "AccountAsyncClientTest") public class AccountAsyncClientTest extends BaseCloudStackAsyncClientTest { @@ -47,7 +48,7 @@ public class AccountAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListPublicIPAddresses() throws SecurityException, NoSuchMethodException, IOException { - Method method = AddressAsyncClient.class.getMethod("listPublicIPAddresses", - ListPublicIPAddressesOptions[].class); + Method method = AddressAsyncClient.class.getMethod("listPublicIPAddresses", ListPublicIPAddressesOptions[].class); HttpRequest httpRequest = processor.createRequest(method); assertRequestLineEquals(httpRequest, @@ -65,8 +65,7 @@ public class AddressAsyncClientTest extends BaseCloudStackAsyncClientTest getAsyncJob(job.getJobId()).getResult(); checkIP(ip); @@ -76,7 +76,7 @@ public class AddressClientLiveTest extends BaseCloudStackClientLiveTest { assertTrue(response.size() >= 0); for (PublicIPAddress ip : response) { PublicIPAddress newDetails = getOnlyElement(client.getAddressClient().listPublicIPAddresses( - ListPublicIPAddressesOptions.Builder.id(ip.getId()))); + ListPublicIPAddressesOptions.Builder.id(ip.getId()))); assertEquals(ip.getId(), newDetails.getId()); checkIP(ip); } diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobAsyncClientTest.java index 1c8f5a01bb..ba5ce09436 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobAsyncClientTest.java @@ -37,7 +37,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "AsyncJobAsyncClientTest") public class AsyncJobAsyncClientTest extends BaseCloudStackAsyncClientTest { diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobClientLiveTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobClientLiveTest.java index 5d3c162401..f36e4f722f 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobClientLiveTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/AsyncJobClientLiveTest.java @@ -58,7 +58,8 @@ public class AsyncJobClientLiveTest extends BaseCloudStackClientLiveTest { assert query.getResultCode() >= 0 : query; assert query.getProgress() >= 0 : query; if (query.getResultCode() == 0) { - if (query.getResult() != null)// null is ok for result of success = true + if (query.getResult() != null)// null is ok for result of success = + // true // ensure we parsed properly assert (query.getResult().getClass().getPackage().equals(AsyncJob.class.getPackage())) : query; } else if (query.getResultCode() > 400) { diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/BaseCloudStackClientLiveTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/BaseCloudStackClientLiveTest.java index ab971c5bf4..be84e4fa50 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/BaseCloudStackClientLiveTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/BaseCloudStackClientLiveTest.java @@ -82,11 +82,11 @@ public class BaseCloudStackClientLiveTest { protected void setupCredentials() { identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider - + ".identity must be set. ex. apiKey"); + + ".identity must be set. ex. apiKey"); credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider - + ".credential must be set. ex. secretKey"); + + ".credential must be set. ex. secretKey"); endpoint = checkNotNull(System.getProperty("test." + provider + ".endpoint"), "test." + provider - + ".endpoint must be set. ex. http://localhost:8080/client/api"); + + ".endpoint must be set. ex. http://localhost:8080/client/api"); apiversion = System.getProperty("test." + provider + ".apiversion"); } @@ -121,7 +121,7 @@ public class BaseCloudStackClientLiveTest { setupCredentials(); Properties overrides = setupProperties(); context = new RestContextFactory().createContext(provider, ImmutableSet. of(new Log4JLoggingModule()), - overrides); + overrides); client = context.getApi(); // check access @@ -130,8 +130,8 @@ public class BaseCloudStackClientLiveTest { if (currentUser.getAccountType() != Account.Type.USER) throw new IllegalArgumentException(String.format( - "invalid account type: %s, please specify an apiKey of a USER, for example: %s", currentUser - .getAccountType(), Iterables.filter(users, UserPredicates.isUserAccount()))); + "invalid account type: %s, please specify an apiKey of a USER, for example: %s", + currentUser.getAccountType(), Iterables.filter(users, UserPredicates.isUserAccount()))); injector = Guice.createInjector(new SshjSshClientModule(), new Log4JLoggingModule()); sshFactory = injector.getInstance(SshClient.Factory.class); @@ -140,10 +140,10 @@ public class BaseCloudStackClientLiveTest { jobComplete = new RetryablePredicate(new JobComplete(client), 1200, 1, 5, TimeUnit.SECONDS); injector.injectMembers(jobComplete); virtualMachineRunning = new RetryablePredicate(new VirtualMachineRunning(client), 600, 5, 5, - TimeUnit.SECONDS); + TimeUnit.SECONDS); injector.injectMembers(virtualMachineRunning); virtualMachineDestroyed = new RetryablePredicate(new VirtualMachineDestroyed(client), 600, 5, 5, - TimeUnit.SECONDS); + TimeUnit.SECONDS); injector.injectMembers(virtualMachineDestroyed); reuseOrAssociate = new ReuseOrAssociateNewPublicIPAddress(client, jobComplete); injector.injectMembers(reuseOrAssociate); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ConfigurationAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ConfigurationAsyncClientTest.java index 254ad51077..db14096648 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ConfigurationAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ConfigurationAsyncClientTest.java @@ -34,7 +34,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "ConfigurationAsyncClientTest") public class ConfigurationAsyncClientTest extends BaseCloudStackAsyncClientTest { @@ -43,7 +44,7 @@ public class ConfigurationAsyncClientTest extends BaseCloudStackAsyncClientTest< HttpRequest httpRequest = processor.createRequest(method); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listCapabilities HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listCapabilities HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/FirewallAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/FirewallAsyncClientTest.java index 70aa0082a7..a40ff9376d 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/FirewallAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/FirewallAsyncClientTest.java @@ -23,9 +23,9 @@ import java.lang.reflect.Method; import org.jclouds.cloudstack.options.ListPortForwardingRulesOptions; import org.jclouds.http.HttpRequest; +import org.jclouds.http.functions.ParseFirstJsonValueNamed; import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.http.functions.UnwrapOnlyJsonValue; -import org.jclouds.http.functions.ParseFirstJsonValueNamed; import org.jclouds.rest.functions.MapHttp4xxCodesToExceptions; import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404; import org.jclouds.rest.functions.ReturnVoidOnNotFoundOr404; @@ -39,16 +39,17 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "FirewallAsyncClientTest") public class FirewallAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListPortForwardingRules() throws SecurityException, NoSuchMethodException, IOException { Method method = FirewallAsyncClient.class.getMethod("listPortForwardingRules", - ListPortForwardingRulesOptions[].class); + ListPortForwardingRulesOptions[].class); HttpRequest httpRequest = processor.createRequest(method); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listPortForwardingRules HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listPortForwardingRules HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -62,11 +63,11 @@ public class FirewallAsyncClientTest extends BaseCloudStackAsyncClientTest { @@ -49,7 +50,7 @@ public class GuestOSAsyncClientTest extends BaseCloudStackAsyncClientTest= 0); for (OSType type : response) { OSType newDetails = getOnlyElement(client.getGuestOSClient().listOSTypes( - ListOSTypesOptions.Builder.id(type.getId()))); + ListOSTypesOptions.Builder.id(type.getId()))); assertEquals(type.getId(), newDetails.getId()); checkOSType(type); } diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/HypervisorAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/HypervisorAsyncClientTest.java index caefa7354e..a25823f06e 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/HypervisorAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/HypervisorAsyncClientTest.java @@ -34,7 +34,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "HypervisorAsyncClientTest") public class HypervisorAsyncClientTest extends BaseCloudStackAsyncClientTest { @@ -43,7 +44,7 @@ public class HypervisorAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListLoadBalancerRules() throws SecurityException, NoSuchMethodException, IOException { Method method = LoadBalancerAsyncClient.class.getMethod("listLoadBalancerRules", - ListLoadBalancerRulesOptions[].class); + ListLoadBalancerRulesOptions[].class); HttpRequest httpRequest = processor.createRequest(method); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listLoadBalancerRules HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listLoadBalancerRules HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -61,11 +62,11 @@ public class LoadBalancerAsyncClientTest extends BaseCloudStackAsyncClientTest(new LoadBalancerRuleActive(client), 60, 1, 1, - TimeUnit.SECONDS); + TimeUnit.SECONDS); prefix += "rule"; try { network = find(client.getNetworkClient().listNetworks(), NetworkPredicates.hasLoadBalancerService()); vm = VirtualMachineClientLiveTest.createVirtualMachineInNetwork(network, client, jobComplete, - virtualMachineRunning); + virtualMachineRunning); if (vm.getPassword() != null) password = vm.getPassword(); } catch (NoSuchElementException e) { @@ -83,7 +83,7 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest { ip = reuseOrAssociate.apply(network); try { rule = client.getLoadBalancerClient().createLoadBalancerRuleForPublicIP(ip.getId(), Algorithm.LEASTCONN, - prefix, 22, 22); + prefix, 22, 22); } catch (IllegalStateException e) { // very likely an ip conflict, so retry; } @@ -104,13 +104,14 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest { if (networksDisabled) return; assert jobComplete.apply(client.getLoadBalancerClient().assignVirtualMachinesToLoadBalancerRule(rule.getId(), - vm.getId())); + vm.getId())); assertEquals(client.getLoadBalancerClient().listVirtualMachinesAssignedToLoadBalancerRule(rule.getId()).size(), 1); assert loadBalancerRuleActive.apply(rule) : rule; loopAndCheckSSH(); } - // note that when in LB mode, there's a chance you'll have a connection failure + // note that when in LB mode, there's a chance you'll have a connection + // failure private void loopAndCheckSSH() throws IOException { for (int i = 0; i < 5; i++) {// retry loop TODO replace with predicate. try { @@ -132,7 +133,7 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest { if (networksDisabled) throw new SshException(); assert jobComplete.apply(client.getLoadBalancerClient().removeVirtualMachinesFromLoadBalancerRule(rule.getId(), - vm.getId())); + vm.getId())); assertEquals(client.getLoadBalancerClient().listVirtualMachinesAssignedToLoadBalancerRule(rule.getId()).size(), 0); assertEquals(rule.getState(), State.ADD); checkSSH(new IPSocket(ip.getIPAddress(), 22)); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATAsyncClientTest.java index 680db75ce4..b7b8367497 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATAsyncClientTest.java @@ -40,7 +40,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "NATAsyncClientTest") public class NATAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListIPForwardingRules() throws SecurityException, NoSuchMethodException, IOException { diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATClientLiveTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATClientLiveTest.java index 5444216c99..38fac24696 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATClientLiveTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NATClientLiveTest.java @@ -61,7 +61,7 @@ public class NATClientLiveTest extends BaseCloudStackClientLiveTest { try { network = find(client.getNetworkClient().listNetworks(), NetworkPredicates.supportsStaticNAT()); vm = VirtualMachineClientLiveTest.createVirtualMachineInNetwork(network, client, jobComplete, - virtualMachineRunning); + virtualMachineRunning); if (vm.getPassword() != null) password = vm.getPassword(); } catch (NoSuchElementException e) { @@ -73,7 +73,7 @@ public class NATClientLiveTest extends BaseCloudStackClientLiveTest { if (networksDisabled) return; for (ip = reuseOrAssociate.apply(network); (!ip.isStaticNAT() || ip.getVirtualMachineId() != vm.getId()); ip = reuseOrAssociate - .apply(network)) { + .apply(network)) { // check to see if someone already grabbed this ip if (ip.getVirtualMachineId() > 0 && ip.getVirtualMachineId() != vm.getId()) continue; @@ -130,7 +130,7 @@ public class NATClientLiveTest extends BaseCloudStackClientLiveTest { assertTrue(response.size() >= 0); for (IPForwardingRule rule : response) { IPForwardingRule newDetails = getOnlyElement(client.getNATClient().listIPForwardingRules( - ListIPForwardingRulesOptions.Builder.id(rule.getId()))); + ListIPForwardingRulesOptions.Builder.id(rule.getId()))); assertEquals(rule.getId(), newDetails.getId()); checkRule(rule); } diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NetworkAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NetworkAsyncClientTest.java index f957051b1f..33cfb2126d 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NetworkAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/NetworkAsyncClientTest.java @@ -41,7 +41,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "NetworkAsyncClientTest") public class NetworkAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListNetworks() throws SecurityException, NoSuchMethodException, IOException { @@ -49,7 +50,7 @@ public class NetworkAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListDiskOfferings() throws SecurityException, NoSuchMethodException, IOException { diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/OfferingClientLiveTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/OfferingClientLiveTest.java index f983c94263..2426b54283 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/OfferingClientLiveTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/OfferingClientLiveTest.java @@ -50,7 +50,7 @@ public class OfferingClientLiveTest extends BaseCloudStackClientLiveTest { assertTrue(offeringCount >= 0); for (DiskOffering offering : response) { DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listDiskOfferings( - ListDiskOfferingsOptions.Builder.id(offering.getId()))); + ListDiskOfferingsOptions.Builder.id(offering.getId()))); assertEquals(offering, newDetails); assertEquals(offering, client.getOfferingClient().getDiskOffering(offering.getId())); assert offering.getId() > 0 : offering; @@ -69,7 +69,7 @@ public class OfferingClientLiveTest extends BaseCloudStackClientLiveTest { assertTrue(offeringCount >= 0); for (ServiceOffering offering : response) { ServiceOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listServiceOfferings( - ListServiceOfferingsOptions.Builder.id(offering.getId()))); + ListServiceOfferingsOptions.Builder.id(offering.getId()))); assertEquals(offering, newDetails); assert offering.getId() > 0 : offering; @@ -91,7 +91,7 @@ public class OfferingClientLiveTest extends BaseCloudStackClientLiveTest { assertTrue(offeringCount >= 0); for (NetworkOffering offering : response) { NetworkOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listNetworkOfferings( - ListNetworkOfferingsOptions.Builder.id(offering.getId()))); + ListNetworkOfferingsOptions.Builder.id(offering.getId()))); assertEquals(offering, newDetails); assertEquals(offering, client.getOfferingClient().getNetworkOffering(offering.getId())); assert offering.getId() > 0 : offering; diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SecurityGroupAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SecurityGroupAsyncClientTest.java index fd7a8f42f1..1328c67a36 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SecurityGroupAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SecurityGroupAsyncClientTest.java @@ -46,7 +46,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "SecurityGroupAsyncClientTest") public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest { @@ -55,7 +56,7 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< HttpRequest httpRequest = processor.createRequest(method); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listSecurityGroups HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listSecurityGroups HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -70,11 +71,11 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< public void testListSecurityGroupsOptions() throws SecurityException, NoSuchMethodException, IOException { Method method = SecurityGroupAsyncClient.class.getMethod("listSecurityGroups", ListSecurityGroupsOptions[].class); HttpRequest httpRequest = processor.createRequest(method, ListSecurityGroupsOptions.Builder.virtualMachineId(4) - .domainId(5).id(6)); + .domainId(5).id(6)); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listSecurityGroups&virtualmachineid=4&domainid=5&id=6 HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=listSecurityGroups&virtualmachineid=4&domainid=5&id=6 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -91,7 +92,7 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listSecurityGroups&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listSecurityGroups&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -109,7 +110,7 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< HttpRequest httpRequest = processor.createRequest(method, "goo"); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=createSecurityGroup&name=goo HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=createSecurityGroup&name=goo HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -123,13 +124,13 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< public void testAuthorizeIngressPortsToCIDRs() throws SecurityException, NoSuchMethodException, IOException { Method method = SecurityGroupAsyncClient.class.getMethod("authorizeIngressPortsToCIDRs", long.class, - String.class, int.class, int.class, Iterable.class, AccountInDomainOptions[].class); - HttpRequest httpRequest = processor.createRequest(method, 2, "tcp", 22, 22, ImmutableSet.of("1.1.1.1/24", - "1.2.2.2/16")); + String.class, int.class, int.class, Iterable.class, AccountInDomainOptions[].class); + HttpRequest httpRequest = processor.createRequest(method, 2, "tcp", 22, 22, + ImmutableSet.of("1.1.1.1/24", "1.2.2.2/16")); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&securitygroupid=2&startport=22&protocol=tcp&endport=22&cidrlist=1.1.1.1%2F24%2C1.2.2.2%2F16 HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&securitygroupid=2&startport=22&protocol=tcp&endport=22&cidrlist=1.1.1.1%2F24%2C1.2.2.2%2F16 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -143,13 +144,13 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< public void testAuthorizeIngressPortsToSecurityGroups() throws SecurityException, NoSuchMethodException, IOException { Method method = SecurityGroupAsyncClient.class.getMethod("authorizeIngressPortsToSecurityGroups", long.class, - String.class, int.class, int.class, Multimap.class, AccountInDomainOptions[].class); - HttpRequest httpRequest = processor.createRequest(method, 2, "tcp", 22, 22, ImmutableMultimap.of("adrian", - "group1", "adrian", "group2", "bob", "group1")); + String.class, int.class, int.class, Multimap.class, AccountInDomainOptions[].class); + HttpRequest httpRequest = processor.createRequest(method, 2, "tcp", 22, 22, + ImmutableMultimap.of("adrian", "group1", "adrian", "group2", "bob", "group1")); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&securitygroupid=2&startport=22&protocol=tcp&endport=22&usersecuritygrouplist%5B0%5D.account=adrian&usersecuritygrouplist%5B0%5D.group=group1&usersecuritygrouplist%5B1%5D.account=adrian&usersecuritygrouplist%5B1%5D.group=group2&usersecuritygrouplist%5B2%5D.account=bob&usersecuritygrouplist%5B2%5D.group=group1 HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&securitygroupid=2&startport=22&protocol=tcp&endport=22&usersecuritygrouplist%5B0%5D.account=adrian&usersecuritygrouplist%5B0%5D.group=group1&usersecuritygrouplist%5B1%5D.account=adrian&usersecuritygrouplist%5B1%5D.group=group2&usersecuritygrouplist%5B2%5D.account=bob&usersecuritygrouplist%5B2%5D.group=group1 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -163,12 +164,12 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< public void testAuthorizeIngressICMPToCIDRs() throws SecurityException, NoSuchMethodException, IOException { Method method = SecurityGroupAsyncClient.class.getMethod("authorizeIngressICMPToCIDRs", long.class, int.class, - int.class, Iterable.class, AccountInDomainOptions[].class); + int.class, Iterable.class, AccountInDomainOptions[].class); HttpRequest httpRequest = processor.createRequest(method, 2, 22, 22, ImmutableSet.of("1.1.1.1/24", "1.2.2.2/16")); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&protocol=ICMP&securitygroupid=2&icmptype=22&icmpcode=22&cidrlist=1.1.1.1%2F24%2C1.2.2.2%2F16 HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&protocol=ICMP&securitygroupid=2&icmptype=22&icmpcode=22&cidrlist=1.1.1.1%2F24%2C1.2.2.2%2F16 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -182,13 +183,13 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< public void testAuthorizeIngressICMPToSecurityGroups() throws SecurityException, NoSuchMethodException, IOException { Method method = SecurityGroupAsyncClient.class.getMethod("authorizeIngressICMPToSecurityGroups", long.class, - int.class, int.class, Multimap.class, AccountInDomainOptions[].class); - HttpRequest httpRequest = processor.createRequest(method, 2, 22, 22, ImmutableMultimap.of("adrian", "group1", - "adrian", "group2", "bob", "group1")); + int.class, int.class, Multimap.class, AccountInDomainOptions[].class); + HttpRequest httpRequest = processor.createRequest(method, 2, 22, 22, + ImmutableMultimap.of("adrian", "group1", "adrian", "group2", "bob", "group1")); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&protocol=ICMP&securitygroupid=2&icmptype=22&icmpcode=22&usersecuritygrouplist%5B0%5D.account=adrian&usersecuritygrouplist%5B0%5D.group=group1&usersecuritygrouplist%5B1%5D.account=adrian&usersecuritygrouplist%5B1%5D.group=group2&usersecuritygrouplist%5B2%5D.account=bob&usersecuritygrouplist%5B2%5D.group=group1 HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=authorizeSecurityGroupIngress&protocol=ICMP&securitygroupid=2&icmptype=22&icmpcode=22&usersecuritygrouplist%5B0%5D.account=adrian&usersecuritygrouplist%5B0%5D.group=group1&usersecuritygrouplist%5B1%5D.account=adrian&usersecuritygrouplist%5B1%5D.group=group2&usersecuritygrouplist%5B2%5D.account=bob&usersecuritygrouplist%5B2%5D.group=group1 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -202,12 +203,13 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< public void testRevokeIngressRule() throws SecurityException, NoSuchMethodException, IOException { Method method = SecurityGroupAsyncClient.class.getMethod("revokeIngressRule", long.class, - AccountInDomainOptions[].class); - HttpRequest httpRequest = processor.createRequest(method, 5, AccountInDomainOptions.Builder.accountInDomain( - "adrian", 1)); + AccountInDomainOptions[].class); + HttpRequest httpRequest = processor.createRequest(method, 5, + AccountInDomainOptions.Builder.accountInDomain("adrian", 1)); - assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=revokeSecurityGroupIngress&id=5&account=adrian&domainid=1 HTTP/1.1"); + assertRequestLineEquals( + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=revokeSecurityGroupIngress&id=5&account=adrian&domainid=1 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -224,7 +226,7 @@ public class SecurityGroupAsyncClientTest extends BaseCloudStackAsyncClientTest< HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=deleteSecurityGroup&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=deleteSecurityGroup&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, ""); assertPayloadEquals(httpRequest, null, null, false); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateAsyncClientTest.java index 4def8a2068..58ca1acedf 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateAsyncClientTest.java @@ -39,7 +39,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "TemplateAsyncClientTest") public class TemplateAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListTemplates() throws SecurityException, NoSuchMethodException, IOException { @@ -47,7 +48,7 @@ public class TemplateAsyncClientTest extends BaseCloudStackAsyncClientTest= 0); for (Template template : response) { Template newDetails = Iterables.getOnlyElement(client.getTemplateClient().listTemplates( - zoneId(template.getZoneId()).id(template.getId()))); + zoneId(template.getZoneId()).id(template.getId()))); assertEquals(template, newDetails); assertEquals(template, client.getTemplateClient().getTemplateInZone(template.getZoneId(), template.getId())); assert template.getId() > 0 : template; diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineAsyncClientTest.java index 7aeac89594..ddc02c6f64 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineAsyncClientTest.java @@ -42,16 +42,17 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "VirtualMachineAsyncClientTest") public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListVirtualMachines() throws SecurityException, NoSuchMethodException, IOException { Method method = VirtualMachineAsyncClient.class.getMethod("listVirtualMachines", - ListVirtualMachinesOptions[].class); + ListVirtualMachinesOptions[].class); HttpRequest httpRequest = processor.createRequest(method); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listVirtualMachines HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listVirtualMachines HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -65,13 +66,13 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest public void testListVirtualMachinesOptions() throws SecurityException, NoSuchMethodException, IOException { Method method = VirtualMachineAsyncClient.class.getMethod("listVirtualMachines", - ListVirtualMachinesOptions[].class); - HttpRequest httpRequest = processor.createRequest(method, ListVirtualMachinesOptions.Builder.accountInDomain( - "adrian", 6).usesVirtualNetwork(true)); + ListVirtualMachinesOptions[].class); + HttpRequest httpRequest = processor.createRequest(method, + ListVirtualMachinesOptions.Builder.accountInDomain("adrian", 6).usesVirtualNetwork(true)); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&account=adrian&domainid=6&forvirtualnetwork=true HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&account=adrian&domainid=6&forvirtualnetwork=true HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -88,7 +89,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -103,12 +104,12 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest public void testDeployVirtualMachineInZone() throws SecurityException, NoSuchMethodException, IOException { Method method = VirtualMachineAsyncClient.class.getMethod("deployVirtualMachineInZone", long.class, long.class, - long.class, DeployVirtualMachineOptions[].class); + long.class, DeployVirtualMachineOptions[].class); HttpRequest httpRequest = processor.createRequest(method, 6, 4, 5); assertRequestLineEquals( - httpRequest, - "GET http://localhost:8080/client/api?response=json&command=deployVirtualMachine&zoneid=6&templateid=5&serviceofferingid=4 HTTP/1.1"); + httpRequest, + "GET http://localhost:8080/client/api?response=json&command=deployVirtualMachine&zoneid=6&templateid=5&serviceofferingid=4 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -125,7 +126,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=rebootVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=rebootVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -142,7 +143,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=startVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=startVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -159,7 +160,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=stopVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=stopVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -176,7 +177,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=resetPasswordForVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=resetPasswordForVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -193,7 +194,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=changeServiceForVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=changeServiceForVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -210,7 +211,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=updateVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=updateVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); @@ -227,7 +228,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest HttpRequest httpRequest = processor.createRequest(method, 5); assertRequestLineEquals(httpRequest, - "GET http://localhost:8080/client/api?response=json&command=destroyVirtualMachine&id=5 HTTP/1.1"); + "GET http://localhost:8080/client/api?response=json&command=destroyVirtualMachine&id=5 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ZoneAsyncClientTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ZoneAsyncClientTest.java index 51d17acdaa..fc40f9e87b 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ZoneAsyncClientTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/ZoneAsyncClientTest.java @@ -39,7 +39,8 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "ZoneAsyncClientTest") public class ZoneAsyncClientTest extends BaseCloudStackAsyncClientTest { public void testListZones() throws SecurityException, NoSuchMethodException, IOException { diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/filters/QuerySignerTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/filters/QuerySignerTest.java index 3cd145d9b7..c2d09ef6b1 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/filters/QuerySignerTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/filters/QuerySignerTest.java @@ -27,11 +27,11 @@ import java.util.Map; import org.jclouds.PropertiesBuilder; import org.jclouds.http.HttpRequest; import org.jclouds.logging.config.NullLoggingModule; +import org.jclouds.rest.BaseRestClientTest.MockModule; import org.jclouds.rest.RequestSigner; import org.jclouds.rest.RestContextBuilder; import org.jclouds.rest.RestContextFactory; import org.jclouds.rest.RestContextSpec; -import org.jclouds.rest.BaseRestClientTest.MockModule; import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; @@ -43,55 +43,57 @@ import com.google.inject.Module; * * @author Adrian Cole */ -// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire +// NOTE:without testName, this will not call @Before* and fail w/NPE during +// surefire @Test(groups = "unit", testName = "QuerySignerTest") public class QuerySignerTest { @SuppressWarnings({ "unchecked", "rawtypes" }) public static final RestContextSpec DUMMY_SPEC = new RestContextSpec("cloudstack", - "http://localhost:8080/client/api", "2.2", "", "apiKey", "secretKey", Map.class, List.class, - PropertiesBuilder.class, (Class) RestContextBuilder.class, ImmutableList. of(new MockModule(), - new NullLoggingModule(), new AbstractModule() { - @Override - protected void configure() { - bind(RequestSigner.class).to(QuerySigner.class); - } + "http://localhost:8080/client/api", "2.2", "", "apiKey", "secretKey", Map.class, List.class, + PropertiesBuilder.class, (Class) RestContextBuilder.class, ImmutableList. of(new MockModule(), + new NullLoggingModule(), new AbstractModule() { + @Override + protected void configure() { + bind(RequestSigner.class).to(QuerySigner.class); + } - })); + })); @Test void testCreateStringToSign() { - QuerySigner filter = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector().getInstance( - QuerySigner.class); + QuerySigner filter = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector() + .getInstance(QuerySigner.class); - assertEquals(filter.createStringToSign(HttpRequest.builder().method("GET").endpoint( - URI.create("http://localhost:8080/client/api?command=listZones")).build()), - "apikey=apikey&command=listzones"); + assertEquals( + filter.createStringToSign(HttpRequest.builder().method("GET") + .endpoint(URI.create("http://localhost:8080/client/api?command=listZones")).build()), + "apikey=apikey&command=listzones"); } @Test void testFilter() { - QuerySigner filter = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector().getInstance( - QuerySigner.class); + QuerySigner filter = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector() + .getInstance(QuerySigner.class); assertEquals( - filter.filter( - HttpRequest.builder().method("GET").endpoint( - URI.create("http://localhost:8080/client/api?command=listZones")).build()) - .getRequestLine(), - "GET http://localhost:8080/client/api?command=listZones&apiKey=apiKey&signature=2UG8AcnMaozL3BINdjgkJ%2BRzjEY%3D HTTP/1.1"); + filter.filter( + HttpRequest.builder().method("GET") + .endpoint(URI.create("http://localhost:8080/client/api?command=listZones")).build()) + .getRequestLine(), + "GET http://localhost:8080/client/api?command=listZones&apiKey=apiKey&signature=2UG8AcnMaozL3BINdjgkJ%2BRzjEY%3D HTTP/1.1"); } @Test void testFilterTwice() { - QuerySigner filter = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector().getInstance( - QuerySigner.class); - HttpRequest request = HttpRequest.builder().method("GET").endpoint( - URI.create("http://localhost:8080/client/api?command=listZones")).build(); + QuerySigner filter = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector() + .getInstance(QuerySigner.class); + HttpRequest request = HttpRequest.builder().method("GET") + .endpoint(URI.create("http://localhost:8080/client/api?command=listZones")).build(); for (int i = 0; i < 2; i++) { request = filter.filter(request); assertEquals( - request.getRequestLine(), - "GET http://localhost:8080/client/api?command=listZones&apiKey=apiKey&signature=2UG8AcnMaozL3BINdjgkJ%2BRzjEY%3D HTTP/1.1"); + request.getRequestLine(), + "GET http://localhost:8080/client/api?command=listZones&apiKey=apiKey&signature=2UG8AcnMaozL3BINdjgkJ%2BRzjEY%3D HTTP/1.1"); } } } \ No newline at end of file diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ParseAsyncJobFromHttpResponseTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ParseAsyncJobFromHttpResponseTest.java index 43d04dac38..400a162d08 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ParseAsyncJobFromHttpResponseTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ParseAsyncJobFromHttpResponseTest.java @@ -58,12 +58,12 @@ public class ParseAsyncJobFromHttpResponseTest { String input = "{ \"queryasyncjobresultresponse\" : {\"jobid\":860,\"jobstatus\":0,\"jobprocstatus\":0,\"jobresultcode\":0} }"; AsyncJob expects = AsyncJob. builder().id(860).status(0).progress(0) - .resultCode(0).build(); + .resultCode(0).build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newStringPayload(input))); + Payloads.newStringPayload(input))); assertEquals(response, expects); } @@ -72,12 +72,12 @@ public class ParseAsyncJobFromHttpResponseTest { String input = "{ \"queryasyncjobresultresponse\" : {\"jobid\":1138,\"jobstatus\":1,\"jobprocstatus\":0,\"jobresultcode\":0,\"jobresulttype\":\"object\",\"jobresult\":{\"success\":true}} }"; AsyncJob expects = AsyncJob. builder().id(1138).status(1).progress(0) - .resultType("object").resultCode(0).build(); + .resultType("object").resultCode(0).build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newStringPayload(input))); + Payloads.newStringPayload(input))); assertEquals(response, expects); } @@ -85,16 +85,19 @@ public class ParseAsyncJobFromHttpResponseTest { public void testWithErrorSetsResultNullSoToAvoidClassCastExceptions() { String input = "{ \"queryasyncjobresultresponse\" : {\"jobid\":1103,\"jobstatus\":2,\"jobprocstatus\":0,\"jobresultcode\":530,\"jobresulttype\":\"object\",\"jobresult\":{\"errorcode\":530,\"errortext\":\"Internal error executing command, please contact your system administrator\"}} }"; - AsyncJob expects = AsyncJob. builder().id(1103).status(2).progress(0) - .resultType("object").error( - new AsyncJobError(530, - "Internal error executing command, please contact your system administrator")) - .resultCode(530).build(); + AsyncJob expects = AsyncJob + . builder() + .id(1103) + .status(2) + .progress(0) + .resultType("object") + .error(new AsyncJobError(530, "Internal error executing command, please contact your system administrator")) + .resultCode(530).build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newStringPayload(input))); + Payloads.newStringPayload(input))); assertEquals(response, expects); } @@ -103,66 +106,83 @@ public class ParseAsyncJobFromHttpResponseTest { String input = "{ \"queryasyncjobresultresponse\" : {\"jobid\":860,\"jobstatus\":0,\"jobprocstatus\":0,\"jobresultcode\":0,\"jobresult\":{\"foo\":{\"bar\":1}}}}"; AsyncJob expects = AsyncJob.builder().id(860).status(0).progress(0).resultCode(0).result("{\"bar\":1}") - .build(); + .build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newStringPayload(input))); + Payloads.newStringPayload(input))); assertEquals(response, expects); } public void testWithBadResultReturnsMap() { - // Not the best result object, but this is an unexpected error case. Cloud.com have verified - // that this case will not happen. This code is only here to prevent exceptions from being + // Not the best result object, but this is an unexpected error case. + // Cloud.com have verified + // that this case will not happen. This code is only here to prevent + // exceptions from being // thrown in case they change their minds. String input = "{ \"queryasyncjobresultresponse\" : {\"jobid\":860,\"jobstatus\":0,\"jobprocstatus\":0,\"jobresultcode\":0,\"jobresult\":{\"foo\":{\"bar\":1},\"foo2\":{\"bar2\":2}}}}"; - AsyncJob expects = AsyncJob.builder().id(860).status(0).progress(0).resultCode(0).result( - ImmutableMap.of("foo", new JsonBall("{\"bar\":1}"), "foo2", new JsonBall("{\"bar2\":2}"))).build(); + AsyncJob expects = AsyncJob.builder().id(860).status(0).progress(0).resultCode(0) + .result(ImmutableMap.of("foo", new JsonBall("{\"bar\":1}"), "foo2", new JsonBall("{\"bar2\":2}"))).build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newStringPayload(input))); + Payloads.newStringPayload(input))); assertEquals(response, expects); } public void testPublicIPAddress() { InputStream is = getClass().getResourceAsStream("/queryasyncjobresultresponse-ipaddress.json"); - AsyncJob expects = AsyncJob. builder().id(860).status(1).progress(0) - .resultType("object").resultCode(0).result( - PublicIPAddress.builder().id(6).IPAddress("72.52.126.35").allocated( - new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-02-23T20:15:01-0800")) - .zoneId(1).zoneName("San Jose 1").isSourceNAT(false).account("adrian").domainId(1) - .domain("ROOT").usesVirtualNetwork(true).isStaticNAT(false).associatedNetworkId(204) - .networkId(200).state(PublicIPAddress.State.ALLOCATING).build() + AsyncJob expects = AsyncJob + . builder() + .id(860) + .status(1) + .progress(0) + .resultType("object") + .resultCode(0) + .result( + PublicIPAddress + .builder() + .id(6) + .IPAddress("72.52.126.35") + .allocated( + new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-02-23T20:15:01-0800")) + .zoneId(1).zoneName("San Jose 1").isSourceNAT(false).account("adrian").domainId(1) + .domain("ROOT").usesVirtualNetwork(true).isStaticNAT(false).associatedNetworkId(204) + .networkId(200).state(PublicIPAddress.State.ALLOCATING).build() - ).build(); + ).build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newInputStreamPayload(is))); + Payloads.newInputStreamPayload(is))); assertEquals(response, expects); } public void testIPForwardingRule() { InputStream is = getClass().getResourceAsStream("/queryasyncjobresultresponse-ipforwardingrule.json"); - AsyncJob expects = AsyncJob. builder().id(1133).status(1).progress(0) - .resultType("object").resultCode(0).result( - IPForwardingRule.builder().id(109).protocol("tcp").virtualMachineId(226).virtualMachineName( - "i-3-226-VM").IPAddressId(36).IPAddress("72.52.126.65").startPort(22).endPort(22) - .state("Active").build() - ).build(); + AsyncJob expects = AsyncJob + . builder() + .id(1133) + .status(1) + .progress(0) + .resultType("object") + .resultCode(0) + .result( + IPForwardingRule.builder().id(109).protocol("tcp").virtualMachineId(226) + .virtualMachineName("i-3-226-VM").IPAddressId(36).IPAddress("72.52.126.65").startPort(22) + .endPort(22).state("Active").build()).build(); ParseAsyncJobFromHttpResponse parser = i.getInstance(ParseAsyncJobFromHttpResponse.class); @SuppressWarnings("unchecked") AsyncJob response = (AsyncJob) parser.apply(new HttpResponse(200, "ok", - Payloads.newInputStreamPayload(is))); + Payloads.newInputStreamPayload(is))); assertEquals(response, expects); } diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ReuseOrAssociateNewPublicIPAddressTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ReuseOrAssociateNewPublicIPAddressTest.java index 83f8c4cb6b..b4a4141712 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ReuseOrAssociateNewPublicIPAddressTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/functions/ReuseOrAssociateNewPublicIPAddressTest.java @@ -48,7 +48,7 @@ public class ReuseOrAssociateNewPublicIPAddressTest { long zoneId = 100l; // note that it is associated network, not networkId PublicIPAddress address = PublicIPAddress.builder().id(200).state(PublicIPAddress.State.ALLOCATED) - .associatedNetworkId(networkId).zoneId(zoneId).build(); + .associatedNetworkId(networkId).zoneId(zoneId).build(); public void testReuseWorks() throws SecurityException, NoSuchMethodException { @@ -60,15 +60,16 @@ public class ReuseOrAssociateNewPublicIPAddressTest { // an address is available expect(addressClient.listPublicIPAddresses(allocatedOnly(true).networkId(networkId))).andReturn( - ImmutableSet. of(address)); + ImmutableSet. of(address)); // replay mocks replay(client); replay(addressClient); // run - assertEquals(new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId) - .zoneId(zoneId).build()), address); + assertEquals( + new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId) + .zoneId(zoneId).build()), address); // verify mocks verify(client); @@ -88,7 +89,7 @@ public class ReuseOrAssociateNewPublicIPAddressTest { // no ip addresses available expect(addressClient.listPublicIPAddresses(allocatedOnly(true).networkId(networkId))).andReturn( - ImmutableSet. of()); + ImmutableSet. of()); AsyncCreateResponse job = new AsyncCreateResponse(1, 2); // make sure we created the job relating to a new ip @@ -105,8 +106,9 @@ public class ReuseOrAssociateNewPublicIPAddressTest { replay(jobClient); // run - assertEquals(new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId) - .zoneId(zoneId).build()), address); + assertEquals( + new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId) + .zoneId(zoneId).build()), address); // verify mocks verify(client); @@ -128,13 +130,14 @@ public class ReuseOrAssociateNewPublicIPAddressTest { // no ip addresses available expect(addressClient.listPublicIPAddresses(allocatedOnly(true).networkId(networkId))).andReturn( - ImmutableSet. of()); + ImmutableSet. of()); AsyncCreateResponse job = new AsyncCreateResponse(1, 2); // make sure we created the job relating to a new ip expect(addressClient.associateIPAddressInZone(zoneId, networkId(networkId))).andReturn(job); - // the alwaysfalse predicate above should blow up with IllegalStateException + // the alwaysfalse predicate above should blow up with + // IllegalStateException // replay mocks replay(client); @@ -142,7 +145,7 @@ public class ReuseOrAssociateNewPublicIPAddressTest { // run new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId).zoneId(zoneId) - .build()); + .build()); // verify mocks verify(client); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListAsyncJobsOptionsTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListAsyncJobsOptionsTest.java index 707314b54f..0d35f994f4 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListAsyncJobsOptionsTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListAsyncJobsOptionsTest.java @@ -58,7 +58,6 @@ public class ListAsyncJobsOptionsTest { assertEquals(ImmutableList.of("6"), options.buildQueryParameters().get("domainid")); } - public void testStartDateStatic() { ListAsyncJobsOptions options = startDate(new Date(100000)); assertEquals(ImmutableList.of("1970-01-01T00:01:40Z"), options.buildQueryParameters().get("startdate")); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListIPForwardingRulesOptionsTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListIPForwardingRulesOptionsTest.java index ede17f98de..6463ca2b32 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListIPForwardingRulesOptionsTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListIPForwardingRulesOptionsTest.java @@ -18,10 +18,10 @@ */ package org.jclouds.cloudstack.options; +import static org.jclouds.cloudstack.options.ListIPForwardingRulesOptions.Builder.IPAddressId; import static org.jclouds.cloudstack.options.ListIPForwardingRulesOptions.Builder.accountInDomain; import static org.jclouds.cloudstack.options.ListIPForwardingRulesOptions.Builder.domainId; import static org.jclouds.cloudstack.options.ListIPForwardingRulesOptions.Builder.id; -import static org.jclouds.cloudstack.options.ListIPForwardingRulesOptions.Builder.IPAddressId; import static org.jclouds.cloudstack.options.ListIPForwardingRulesOptions.Builder.virtualMachineId; import static org.testng.Assert.assertEquals; diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListPublicIPAddressesOptionsTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListPublicIPAddressesOptionsTest.java index 2641e03277..538bfff500 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListPublicIPAddressesOptionsTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/options/ListPublicIPAddressesOptionsTest.java @@ -18,13 +18,13 @@ */ package org.jclouds.cloudstack.options; -import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.accountInDomain; -import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.domainId; import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.IPAddress; +import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.VLANId; +import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.accountInDomain; import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.allocatedOnly; +import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.domainId; import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.id; import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.networkId; -import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.VLANId; import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.usesVirtualNetwork; import static org.jclouds.cloudstack.options.ListPublicIPAddressesOptions.Builder.zoneId; import static org.testng.Assert.assertEquals; diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java index 89ddd9a384..588ed57252 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java @@ -41,7 +41,7 @@ import com.google.inject.Injector; */ @Test(groups = "unit") public class ListAccountsResponseTest extends BaseSetParserTest { - + @Override protected Injector injector() { return Guice.createInjector(new CloudStackParserModule(), new GsonModule() { @@ -93,20 +93,11 @@ public class ListAccountsResponseTest extends BaseSetParserTest { .VMsRunning(1) .state(State.ENABLED) .users( - ImmutableSet.of(User.builder() - .id(505) - .name("jclouds") - .firstName("Adrian") - .lastName("Cole") - .email("adrian@jclouds.org") - .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-04-19T01:57:24+0000")) - .state("enabled") - .account("jclouds") - .accountType(Type.USER) - .domainId(457) - .domain("AA000062-jclouds-dev") - .apiKey("APIKEY") - .secretKey("SECRETKEY").build())).build()); + ImmutableSet.of(User.builder().id(505).name("jclouds").firstName("Adrian").lastName("Cole") + .email("adrian@jclouds.org") + .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-04-19T01:57:24+0000")) + .state("enabled").account("jclouds").accountType(Type.USER).domainId(457) + .domain("AA000062-jclouds-dev").apiKey("APIKEY").secretKey("SECRETKEY").build())).build()); } } diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java index d1d0c956f2..7a17056500 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java @@ -43,9 +43,9 @@ public class ListOSCategoriesResponseTest extends BaseItemParserTest expected() { - return ImmutableMap. builder().put(1l, "CentOS").put(2l, "Debian").put(3l, "Oracle").put(4l, - "RedHat").put(5l, "SUSE").put(6l, "Windows").put(7l, "Other").put(8l, "Novel").put(9l, "Unix").put(10l, - "Ubuntu").build(); + return ImmutableMap. builder().put(1l, "CentOS").put(2l, "Debian").put(3l, "Oracle") + .put(4l, "RedHat").put(5l, "SUSE").put(6l, "Windows").put(7l, "Other").put(8l, "Novel").put(9l, "Unix") + .put(10l, "Ubuntu").build(); } @Override diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java index c494d6d85d..4effe11cb0 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSet; */ @Test(groups = "unit") public class ListOSTypesResponseTest extends BaseSetParserTest { - + @Override public String resource() { return "/listostypesresponse.json"; @@ -42,189 +42,157 @@ public class ListOSTypesResponseTest extends BaseSetParserTest { @Override @SelectJson("ostype") public Set expected() { - return ImmutableSet. builder().add( - OSType.builder().id(69).OSCategoryId(7).description("Asianux 3(32-bit)").build()).add( - OSType.builder().id(70).OSCategoryId(7).description("Asianux 3(64-bit)").build()).add( - OSType.builder().id(1).OSCategoryId(1).description("CentOS 4.5 (32-bit)").build()).add( - OSType.builder().id(2).OSCategoryId(1).description("CentOS 4.6 (32-bit)").build()).add( - OSType.builder().id(3).OSCategoryId(1).description("CentOS 4.7 (32-bit)").build()).add( - OSType.builder().id(4).OSCategoryId(1).description("CentOS 4.8 (32-bit)").build()).add( - OSType.builder().id(5).OSCategoryId(1).description("CentOS 5.0 (32-bit)").build()).add( - OSType.builder().id(6).OSCategoryId(1).description("CentOS 5.0 (64-bit)").build()).add( - OSType.builder().id(7).OSCategoryId(1).description("CentOS 5.1 (32-bit)").build()).add( - OSType.builder().id(8).OSCategoryId(1).description("CentOS 5.1 (64-bit)").build()).add( - OSType.builder().id(9).OSCategoryId(1).description("CentOS 5.2 (32-bit)").build()).add( - OSType.builder().id(10).OSCategoryId(1).description("CentOS 5.2 (64-bit)").build()).add( - OSType.builder().id(11).OSCategoryId(1).description("CentOS 5.3 (32-bit)").build()).add( - OSType.builder().id(12).OSCategoryId(1).description("CentOS 5.3 (64-bit)").build()).add( - OSType.builder().id(13).OSCategoryId(1).description("CentOS 5.4 (32-bit)").build()).add( - OSType.builder().id(14).OSCategoryId(1).description("CentOS 5.4 (64-bit)").build()).add( - OSType.builder().id(111).OSCategoryId(1).description("CentOS 5.5 (32-bit)").build()).add( - OSType.builder().id(112).OSCategoryId(1).description("CentOS 5.5 (64-bit)").build()).add( - OSType.builder().id(73).OSCategoryId(2).description("Debian GNU/Linux 4(32-bit)").build()).add( - OSType.builder().id(74).OSCategoryId(2).description("Debian GNU/Linux 4(64-bit)").build()).add( - OSType.builder().id(72).OSCategoryId(2).description("Debian GNU/Linux 5(64-bit)").build()).add( - OSType.builder().id(15).OSCategoryId(2).description("Debian GNU/Linux 5.0 (32-bit)").build()).add( - OSType.builder().id(132).OSCategoryId(2).description("Debian GNU/Linux 6(32-bit)").build()).add( - OSType.builder().id(133).OSCategoryId(2).description("Debian GNU/Linux 6(64-bit)").build()).add( - OSType.builder().id(102).OSCategoryId(6).description("DOS").build()).add( - OSType.builder().id(118).OSCategoryId(4).description("Fedora 10").build()).add( - OSType.builder().id(117).OSCategoryId(4).description("Fedora 11").build()).add( - OSType.builder().id(116).OSCategoryId(4).description("Fedora 12").build()).add( - OSType.builder().id(115).OSCategoryId(4).description("Fedora 13").build()).add( - OSType.builder().id(120).OSCategoryId(4).description("Fedora 8").build()).add( - OSType.builder().id(119).OSCategoryId(4).description("Fedora 9").build()).add( - OSType.builder().id(83).OSCategoryId(9).description("FreeBSD (32-bit)").build()).add( - OSType.builder().id(84).OSCategoryId(9).description("FreeBSD (64-bit)").build()).add( - OSType.builder().id(92).OSCategoryId(6).description("Microsoft Small Bussiness Server 2003").build()) - .add(OSType.builder().id(78).OSCategoryId(8).description("Novell Netware 5.1").build()).add( - OSType.builder().id(77).OSCategoryId(8).description("Novell Netware 6.x").build()).add( - OSType.builder().id(68).OSCategoryId(7).description("Open Enterprise Server").build()).add( - OSType.builder().id(16).OSCategoryId(3).description("Oracle Enterprise Linux 5.0 (32-bit)") - .build()).add( - OSType.builder().id(17).OSCategoryId(3).description("Oracle Enterprise Linux 5.0 (64-bit)") - .build()).add( - OSType.builder().id(18).OSCategoryId(3).description("Oracle Enterprise Linux 5.1 (32-bit)") - .build()).add( - OSType.builder().id(19).OSCategoryId(3).description("Oracle Enterprise Linux 5.1 (64-bit)") - .build()).add( - OSType.builder().id(20).OSCategoryId(3).description("Oracle Enterprise Linux 5.2 (32-bit)") - .build()).add( - OSType.builder().id(21).OSCategoryId(3).description("Oracle Enterprise Linux 5.2 (64-bit)") - .build()).add( - OSType.builder().id(22).OSCategoryId(3).description("Oracle Enterprise Linux 5.3 (32-bit)") - .build()).add( - OSType.builder().id(23).OSCategoryId(3).description("Oracle Enterprise Linux 5.3 (64-bit)") - .build()).add( - OSType.builder().id(24).OSCategoryId(3).description("Oracle Enterprise Linux 5.4 (32-bit)") - .build()).add( - OSType.builder().id(25).OSCategoryId(3).description("Oracle Enterprise Linux 5.4 (64-bit)") - .build()).add( - OSType.builder().id(134).OSCategoryId(3).description("Oracle Enterprise Linux 5.5 (32-bit)") - .build()).add( - OSType.builder().id(135).OSCategoryId(3).description("Oracle Enterprise Linux 5.5 (64-bit)") - .build()).add(OSType.builder().id(104).OSCategoryId(7).description("OS/2").build()) - .add(OSType.builder().id(60).OSCategoryId(7).description("Other (32-bit)").build()).add( - OSType.builder().id(103).OSCategoryId(7).description("Other (64-bit)").build()).add( - OSType.builder().id(75).OSCategoryId(7).description("Other 2.6x Linux (32-bit)").build()).add( - OSType.builder().id(76).OSCategoryId(7).description("Other 2.6x Linux (64-bit)").build()).add( - OSType.builder().id(98).OSCategoryId(7).description("Other Linux (32-bit)").build()).add( - OSType.builder().id(99).OSCategoryId(7).description("Other Linux (64-bit)").build()).add( - OSType.builder().id(59).OSCategoryId(10).description("Other Ubuntu (32-bit)").build()).add( - OSType.builder().id(100).OSCategoryId(10).description("Other Ubuntu (64-bit)").build()).add( - OSType.builder().id(131).OSCategoryId(10).description("Red Hat Enterprise Linux 2").build()) - .add(OSType.builder().id(66).OSCategoryId(4).description("Red Hat Enterprise Linux 3(32-bit)").build()) - .add(OSType.builder().id(67).OSCategoryId(4).description("Red Hat Enterprise Linux 3(64-bit)").build()) - .add(OSType.builder().id(106).OSCategoryId(4).description("Red Hat Enterprise Linux 4(64-bit)").build()) - .add( - OSType.builder().id(26).OSCategoryId(4).description("Red Hat Enterprise Linux 4.5 (32-bit)") - .build()).add( - OSType.builder().id(27).OSCategoryId(4).description("Red Hat Enterprise Linux 4.6 (32-bit)") - .build()).add( - OSType.builder().id(28).OSCategoryId(4).description("Red Hat Enterprise Linux 4.7 (32-bit)") - .build()).add( - OSType.builder().id(29).OSCategoryId(4).description("Red Hat Enterprise Linux 4.8 (32-bit)") - .build()).add( - OSType.builder().id(30).OSCategoryId(4).description("Red Hat Enterprise Linux 5.0 (32-bit)") - .build()).add( - OSType.builder().id(31).OSCategoryId(4).description("Red Hat Enterprise Linux 5.0 (64-bit)") - .build()).add( - OSType.builder().id(32).OSCategoryId(4).description("Red Hat Enterprise Linux 5.1 (32-bit)") - .build()).add( - OSType.builder().id(33).OSCategoryId(4).description("Red Hat Enterprise Linux 5.1 (64-bit)") - .build()).add( - OSType.builder().id(34).OSCategoryId(4).description("Red Hat Enterprise Linux 5.2 (32-bit)") - .build()).add( - OSType.builder().id(35).OSCategoryId(4).description("Red Hat Enterprise Linux 5.2 (64-bit)") - .build()).add( - OSType.builder().id(36).OSCategoryId(4).description("Red Hat Enterprise Linux 5.3 (32-bit)") - .build()).add( - OSType.builder().id(37).OSCategoryId(4).description("Red Hat Enterprise Linux 5.3 (64-bit)") - .build()).add( - OSType.builder().id(38).OSCategoryId(4).description("Red Hat Enterprise Linux 5.4 (32-bit)") - .build()).add( - OSType.builder().id(39).OSCategoryId(4).description("Red Hat Enterprise Linux 5.4 (64-bit)") - .build()).add( - OSType.builder().id(113).OSCategoryId(4).description("Red Hat Enterprise Linux 5.5 (32-bit)") - .build()).add( - OSType.builder().id(114).OSCategoryId(4).description("Red Hat Enterprise Linux 5.5 (64-bit)") - .build()).add( - OSType.builder().id(136).OSCategoryId(4).description("Red Hat Enterprise Linux 6.0 (32-bit)") - .build()).add( - OSType.builder().id(137).OSCategoryId(4).description("Red Hat Enterprise Linux 6.0 (64-bit)") - .build()).add( - OSType.builder().id(85).OSCategoryId(9).description("SCO OpenServer 5").build()).add( - OSType.builder().id(86).OSCategoryId(9).description("SCO UnixWare 7").build()).add( - OSType.builder().id(79).OSCategoryId(9).description("Sun Solaris 10(32-bit)").build()).add( - OSType.builder().id(80).OSCategoryId(9).description("Sun Solaris 10(64-bit)").build()).add( - OSType.builder().id(82).OSCategoryId(9).description("Sun Solaris 8(Experimental)").build()) - .add(OSType.builder().id(81).OSCategoryId(9).description("Sun Solaris 9(Experimental)").build()).add( - OSType.builder().id(109).OSCategoryId(5).description("SUSE Linux Enterprise 10(32-bit)") - .build()).add( - OSType.builder().id(110).OSCategoryId(5).description("SUSE Linux Enterprise 10(64-bit)") - .build()).add( - OSType.builder().id(96).OSCategoryId(5).description("SUSE Linux Enterprise 8(32-bit)").build()) - .add(OSType.builder().id(97).OSCategoryId(5).description("SUSE Linux Enterprise 8(64-bit)").build()) - .add(OSType.builder().id(107).OSCategoryId(5).description("SUSE Linux Enterprise 9(32-bit)").build()) - .add(OSType.builder().id(108).OSCategoryId(5).description("SUSE Linux Enterprise 9(64-bit)").build()) - .add( - OSType.builder().id(41).OSCategoryId(5).description( - "SUSE Linux Enterprise Server 10 SP1 (32-bit)").build()).add( - OSType.builder().id(42).OSCategoryId(5).description( - "SUSE Linux Enterprise Server 10 SP1 (64-bit)").build()).add( - OSType.builder().id(43).OSCategoryId(5).description( - "SUSE Linux Enterprise Server 10 SP2 (32-bit)").build()).add( - OSType.builder().id(44).OSCategoryId(5).description( - "SUSE Linux Enterprise Server 10 SP2 (64-bit)").build()).add( - OSType.builder().id(45).OSCategoryId(5).description( - "SUSE Linux Enterprise Server 10 SP3 (64-bit)").build()).add( - OSType.builder().id(46).OSCategoryId(5).description("SUSE Linux Enterprise Server 11 (32-bit)") - .build()).add( - OSType.builder().id(47).OSCategoryId(5).description("SUSE Linux Enterprise Server 11 (64-bit)") - .build()).add( - OSType.builder().id(40).OSCategoryId(5).description( - "SUSE Linux Enterprise Server 9 SP4 (32-bit)").build()).add( - OSType.builder().id(121).OSCategoryId(10).description("Ubuntu 10.04 (32-bit)").build()).add( - OSType.builder().id(126).OSCategoryId(10).description("Ubuntu 10.04 (64-bit)").build()).add( - OSType.builder().id(125).OSCategoryId(10).description("Ubuntu 8.04 (32-bit)").build()).add( - OSType.builder().id(130).OSCategoryId(10).description("Ubuntu 8.04 (64-bit)").build()).add( - OSType.builder().id(124).OSCategoryId(10).description("Ubuntu 8.10 (32-bit)").build()).add( - OSType.builder().id(129).OSCategoryId(10).description("Ubuntu 8.10 (64-bit)").build()).add( - OSType.builder().id(123).OSCategoryId(10).description("Ubuntu 9.04 (32-bit)").build()).add( - OSType.builder().id(128).OSCategoryId(10).description("Ubuntu 9.04 (64-bit)").build()).add( - OSType.builder().id(122).OSCategoryId(10).description("Ubuntu 9.10 (32-bit)").build()).add( - OSType.builder().id(127).OSCategoryId(10).description("Ubuntu 9.10 (64-bit)").build()).add( - OSType.builder().id(95).OSCategoryId(6).description("Windows 2000 Advanced Server").build()) - .add(OSType.builder().id(105).OSCategoryId(6).description("Windows 2000 Professional").build()).add( - OSType.builder().id(61).OSCategoryId(6).description("Windows 2000 Server").build()) - .add(OSType.builder().id(55).OSCategoryId(6).description("Windows 2000 Server SP4 (32-bit)").build()) - .add(OSType.builder().id(65).OSCategoryId(6).description("Windows 3.1").build()).add( - OSType.builder().id(48).OSCategoryId(6).description("Windows 7 (32-bit)").build()).add( - OSType.builder().id(49).OSCategoryId(6).description("Windows 7 (64-bit)").build()).add( - OSType.builder().id(63).OSCategoryId(6).description("Windows 95").build()).add( - OSType.builder().id(62).OSCategoryId(6).description("Windows 98").build()).add( - OSType.builder().id(64).OSCategoryId(6).description("Windows NT 4").build()).add( - OSType.builder().id(87).OSCategoryId(6).description( - "Windows Server 2003 DataCenter Edition(32-bit)").build()).add( - OSType.builder().id(88).OSCategoryId(6).description( - "Windows Server 2003 DataCenter Edition(64-bit)").build()).add( - OSType.builder().id(50).OSCategoryId(6).description( - "Windows Server 2003 Enterprise Edition(32-bit)").build()).add( - OSType.builder().id(51).OSCategoryId(6).description( - "Windows Server 2003 Enterprise Edition(64-bit)").build()).add( - OSType.builder().id(89).OSCategoryId(6).description( - "Windows Server 2003 Standard Edition(32-bit)").build()).add( - OSType.builder().id(90).OSCategoryId(6).description( - "Windows Server 2003 Standard Edition(64-bit)").build()).add( - OSType.builder().id(91).OSCategoryId(6).description("Windows Server 2003 Web Edition").build()) - .add(OSType.builder().id(52).OSCategoryId(6).description("Windows Server 2008 (32-bit)").build()).add( - OSType.builder().id(53).OSCategoryId(6).description("Windows Server 2008 (64-bit)").build()) - .add(OSType.builder().id(54).OSCategoryId(6).description("Windows Server 2008 R2 (64-bit)").build()) - .add(OSType.builder().id(56).OSCategoryId(6).description("Windows Vista (32-bit)").build()).add( - OSType.builder().id(101).OSCategoryId(6).description("Windows Vista (64-bit)").build()).add( - OSType.builder().id(93).OSCategoryId(6).description("Windows XP (32-bit)").build()).add( - OSType.builder().id(94).OSCategoryId(6).description("Windows XP (64-bit)").build()).add( - OSType.builder().id(57).OSCategoryId(6).description("Windows XP SP2 (32-bit)").build()).add( - OSType.builder().id(58).OSCategoryId(6).description("Windows XP SP3 (32-bit)").build()).build(); + return ImmutableSet + . builder() + .add(OSType.builder().id(69).OSCategoryId(7).description("Asianux 3(32-bit)").build()) + .add(OSType.builder().id(70).OSCategoryId(7).description("Asianux 3(64-bit)").build()) + .add(OSType.builder().id(1).OSCategoryId(1).description("CentOS 4.5 (32-bit)").build()) + .add(OSType.builder().id(2).OSCategoryId(1).description("CentOS 4.6 (32-bit)").build()) + .add(OSType.builder().id(3).OSCategoryId(1).description("CentOS 4.7 (32-bit)").build()) + .add(OSType.builder().id(4).OSCategoryId(1).description("CentOS 4.8 (32-bit)").build()) + .add(OSType.builder().id(5).OSCategoryId(1).description("CentOS 5.0 (32-bit)").build()) + .add(OSType.builder().id(6).OSCategoryId(1).description("CentOS 5.0 (64-bit)").build()) + .add(OSType.builder().id(7).OSCategoryId(1).description("CentOS 5.1 (32-bit)").build()) + .add(OSType.builder().id(8).OSCategoryId(1).description("CentOS 5.1 (64-bit)").build()) + .add(OSType.builder().id(9).OSCategoryId(1).description("CentOS 5.2 (32-bit)").build()) + .add(OSType.builder().id(10).OSCategoryId(1).description("CentOS 5.2 (64-bit)").build()) + .add(OSType.builder().id(11).OSCategoryId(1).description("CentOS 5.3 (32-bit)").build()) + .add(OSType.builder().id(12).OSCategoryId(1).description("CentOS 5.3 (64-bit)").build()) + .add(OSType.builder().id(13).OSCategoryId(1).description("CentOS 5.4 (32-bit)").build()) + .add(OSType.builder().id(14).OSCategoryId(1).description("CentOS 5.4 (64-bit)").build()) + .add(OSType.builder().id(111).OSCategoryId(1).description("CentOS 5.5 (32-bit)").build()) + .add(OSType.builder().id(112).OSCategoryId(1).description("CentOS 5.5 (64-bit)").build()) + .add(OSType.builder().id(73).OSCategoryId(2).description("Debian GNU/Linux 4(32-bit)").build()) + .add(OSType.builder().id(74).OSCategoryId(2).description("Debian GNU/Linux 4(64-bit)").build()) + .add(OSType.builder().id(72).OSCategoryId(2).description("Debian GNU/Linux 5(64-bit)").build()) + .add(OSType.builder().id(15).OSCategoryId(2).description("Debian GNU/Linux 5.0 (32-bit)").build()) + .add(OSType.builder().id(132).OSCategoryId(2).description("Debian GNU/Linux 6(32-bit)").build()) + .add(OSType.builder().id(133).OSCategoryId(2).description("Debian GNU/Linux 6(64-bit)").build()) + .add(OSType.builder().id(102).OSCategoryId(6).description("DOS").build()) + .add(OSType.builder().id(118).OSCategoryId(4).description("Fedora 10").build()) + .add(OSType.builder().id(117).OSCategoryId(4).description("Fedora 11").build()) + .add(OSType.builder().id(116).OSCategoryId(4).description("Fedora 12").build()) + .add(OSType.builder().id(115).OSCategoryId(4).description("Fedora 13").build()) + .add(OSType.builder().id(120).OSCategoryId(4).description("Fedora 8").build()) + .add(OSType.builder().id(119).OSCategoryId(4).description("Fedora 9").build()) + .add(OSType.builder().id(83).OSCategoryId(9).description("FreeBSD (32-bit)").build()) + .add(OSType.builder().id(84).OSCategoryId(9).description("FreeBSD (64-bit)").build()) + .add(OSType.builder().id(92).OSCategoryId(6).description("Microsoft Small Bussiness Server 2003").build()) + .add(OSType.builder().id(78).OSCategoryId(8).description("Novell Netware 5.1").build()) + .add(OSType.builder().id(77).OSCategoryId(8).description("Novell Netware 6.x").build()) + .add(OSType.builder().id(68).OSCategoryId(7).description("Open Enterprise Server").build()) + .add(OSType.builder().id(16).OSCategoryId(3).description("Oracle Enterprise Linux 5.0 (32-bit)").build()) + .add(OSType.builder().id(17).OSCategoryId(3).description("Oracle Enterprise Linux 5.0 (64-bit)").build()) + .add(OSType.builder().id(18).OSCategoryId(3).description("Oracle Enterprise Linux 5.1 (32-bit)").build()) + .add(OSType.builder().id(19).OSCategoryId(3).description("Oracle Enterprise Linux 5.1 (64-bit)").build()) + .add(OSType.builder().id(20).OSCategoryId(3).description("Oracle Enterprise Linux 5.2 (32-bit)").build()) + .add(OSType.builder().id(21).OSCategoryId(3).description("Oracle Enterprise Linux 5.2 (64-bit)").build()) + .add(OSType.builder().id(22).OSCategoryId(3).description("Oracle Enterprise Linux 5.3 (32-bit)").build()) + .add(OSType.builder().id(23).OSCategoryId(3).description("Oracle Enterprise Linux 5.3 (64-bit)").build()) + .add(OSType.builder().id(24).OSCategoryId(3).description("Oracle Enterprise Linux 5.4 (32-bit)").build()) + .add(OSType.builder().id(25).OSCategoryId(3).description("Oracle Enterprise Linux 5.4 (64-bit)").build()) + .add(OSType.builder().id(134).OSCategoryId(3).description("Oracle Enterprise Linux 5.5 (32-bit)").build()) + .add(OSType.builder().id(135).OSCategoryId(3).description("Oracle Enterprise Linux 5.5 (64-bit)").build()) + .add(OSType.builder().id(104).OSCategoryId(7).description("OS/2").build()) + .add(OSType.builder().id(60).OSCategoryId(7).description("Other (32-bit)").build()) + .add(OSType.builder().id(103).OSCategoryId(7).description("Other (64-bit)").build()) + .add(OSType.builder().id(75).OSCategoryId(7).description("Other 2.6x Linux (32-bit)").build()) + .add(OSType.builder().id(76).OSCategoryId(7).description("Other 2.6x Linux (64-bit)").build()) + .add(OSType.builder().id(98).OSCategoryId(7).description("Other Linux (32-bit)").build()) + .add(OSType.builder().id(99).OSCategoryId(7).description("Other Linux (64-bit)").build()) + .add(OSType.builder().id(59).OSCategoryId(10).description("Other Ubuntu (32-bit)").build()) + .add(OSType.builder().id(100).OSCategoryId(10).description("Other Ubuntu (64-bit)").build()) + .add(OSType.builder().id(131).OSCategoryId(10).description("Red Hat Enterprise Linux 2").build()) + .add(OSType.builder().id(66).OSCategoryId(4).description("Red Hat Enterprise Linux 3(32-bit)").build()) + .add(OSType.builder().id(67).OSCategoryId(4).description("Red Hat Enterprise Linux 3(64-bit)").build()) + .add(OSType.builder().id(106).OSCategoryId(4).description("Red Hat Enterprise Linux 4(64-bit)").build()) + .add(OSType.builder().id(26).OSCategoryId(4).description("Red Hat Enterprise Linux 4.5 (32-bit)").build()) + .add(OSType.builder().id(27).OSCategoryId(4).description("Red Hat Enterprise Linux 4.6 (32-bit)").build()) + .add(OSType.builder().id(28).OSCategoryId(4).description("Red Hat Enterprise Linux 4.7 (32-bit)").build()) + .add(OSType.builder().id(29).OSCategoryId(4).description("Red Hat Enterprise Linux 4.8 (32-bit)").build()) + .add(OSType.builder().id(30).OSCategoryId(4).description("Red Hat Enterprise Linux 5.0 (32-bit)").build()) + .add(OSType.builder().id(31).OSCategoryId(4).description("Red Hat Enterprise Linux 5.0 (64-bit)").build()) + .add(OSType.builder().id(32).OSCategoryId(4).description("Red Hat Enterprise Linux 5.1 (32-bit)").build()) + .add(OSType.builder().id(33).OSCategoryId(4).description("Red Hat Enterprise Linux 5.1 (64-bit)").build()) + .add(OSType.builder().id(34).OSCategoryId(4).description("Red Hat Enterprise Linux 5.2 (32-bit)").build()) + .add(OSType.builder().id(35).OSCategoryId(4).description("Red Hat Enterprise Linux 5.2 (64-bit)").build()) + .add(OSType.builder().id(36).OSCategoryId(4).description("Red Hat Enterprise Linux 5.3 (32-bit)").build()) + .add(OSType.builder().id(37).OSCategoryId(4).description("Red Hat Enterprise Linux 5.3 (64-bit)").build()) + .add(OSType.builder().id(38).OSCategoryId(4).description("Red Hat Enterprise Linux 5.4 (32-bit)").build()) + .add(OSType.builder().id(39).OSCategoryId(4).description("Red Hat Enterprise Linux 5.4 (64-bit)").build()) + .add(OSType.builder().id(113).OSCategoryId(4).description("Red Hat Enterprise Linux 5.5 (32-bit)").build()) + .add(OSType.builder().id(114).OSCategoryId(4).description("Red Hat Enterprise Linux 5.5 (64-bit)").build()) + .add(OSType.builder().id(136).OSCategoryId(4).description("Red Hat Enterprise Linux 6.0 (32-bit)").build()) + .add(OSType.builder().id(137).OSCategoryId(4).description("Red Hat Enterprise Linux 6.0 (64-bit)").build()) + .add(OSType.builder().id(85).OSCategoryId(9).description("SCO OpenServer 5").build()) + .add(OSType.builder().id(86).OSCategoryId(9).description("SCO UnixWare 7").build()) + .add(OSType.builder().id(79).OSCategoryId(9).description("Sun Solaris 10(32-bit)").build()) + .add(OSType.builder().id(80).OSCategoryId(9).description("Sun Solaris 10(64-bit)").build()) + .add(OSType.builder().id(82).OSCategoryId(9).description("Sun Solaris 8(Experimental)").build()) + .add(OSType.builder().id(81).OSCategoryId(9).description("Sun Solaris 9(Experimental)").build()) + .add(OSType.builder().id(109).OSCategoryId(5).description("SUSE Linux Enterprise 10(32-bit)").build()) + .add(OSType.builder().id(110).OSCategoryId(5).description("SUSE Linux Enterprise 10(64-bit)").build()) + .add(OSType.builder().id(96).OSCategoryId(5).description("SUSE Linux Enterprise 8(32-bit)").build()) + .add(OSType.builder().id(97).OSCategoryId(5).description("SUSE Linux Enterprise 8(64-bit)").build()) + .add(OSType.builder().id(107).OSCategoryId(5).description("SUSE Linux Enterprise 9(32-bit)").build()) + .add(OSType.builder().id(108).OSCategoryId(5).description("SUSE Linux Enterprise 9(64-bit)").build()) + .add(OSType.builder().id(41).OSCategoryId(5).description("SUSE Linux Enterprise Server 10 SP1 (32-bit)") + .build()) + .add(OSType.builder().id(42).OSCategoryId(5).description("SUSE Linux Enterprise Server 10 SP1 (64-bit)") + .build()) + .add(OSType.builder().id(43).OSCategoryId(5).description("SUSE Linux Enterprise Server 10 SP2 (32-bit)") + .build()) + .add(OSType.builder().id(44).OSCategoryId(5).description("SUSE Linux Enterprise Server 10 SP2 (64-bit)") + .build()) + .add(OSType.builder().id(45).OSCategoryId(5).description("SUSE Linux Enterprise Server 10 SP3 (64-bit)") + .build()) + .add(OSType.builder().id(46).OSCategoryId(5).description("SUSE Linux Enterprise Server 11 (32-bit)") + .build()) + .add(OSType.builder().id(47).OSCategoryId(5).description("SUSE Linux Enterprise Server 11 (64-bit)") + .build()) + .add(OSType.builder().id(40).OSCategoryId(5).description("SUSE Linux Enterprise Server 9 SP4 (32-bit)") + .build()) + .add(OSType.builder().id(121).OSCategoryId(10).description("Ubuntu 10.04 (32-bit)").build()) + .add(OSType.builder().id(126).OSCategoryId(10).description("Ubuntu 10.04 (64-bit)").build()) + .add(OSType.builder().id(125).OSCategoryId(10).description("Ubuntu 8.04 (32-bit)").build()) + .add(OSType.builder().id(130).OSCategoryId(10).description("Ubuntu 8.04 (64-bit)").build()) + .add(OSType.builder().id(124).OSCategoryId(10).description("Ubuntu 8.10 (32-bit)").build()) + .add(OSType.builder().id(129).OSCategoryId(10).description("Ubuntu 8.10 (64-bit)").build()) + .add(OSType.builder().id(123).OSCategoryId(10).description("Ubuntu 9.04 (32-bit)").build()) + .add(OSType.builder().id(128).OSCategoryId(10).description("Ubuntu 9.04 (64-bit)").build()) + .add(OSType.builder().id(122).OSCategoryId(10).description("Ubuntu 9.10 (32-bit)").build()) + .add(OSType.builder().id(127).OSCategoryId(10).description("Ubuntu 9.10 (64-bit)").build()) + .add(OSType.builder().id(95).OSCategoryId(6).description("Windows 2000 Advanced Server").build()) + .add(OSType.builder().id(105).OSCategoryId(6).description("Windows 2000 Professional").build()) + .add(OSType.builder().id(61).OSCategoryId(6).description("Windows 2000 Server").build()) + .add(OSType.builder().id(55).OSCategoryId(6).description("Windows 2000 Server SP4 (32-bit)").build()) + .add(OSType.builder().id(65).OSCategoryId(6).description("Windows 3.1").build()) + .add(OSType.builder().id(48).OSCategoryId(6).description("Windows 7 (32-bit)").build()) + .add(OSType.builder().id(49).OSCategoryId(6).description("Windows 7 (64-bit)").build()) + .add(OSType.builder().id(63).OSCategoryId(6).description("Windows 95").build()) + .add(OSType.builder().id(62).OSCategoryId(6).description("Windows 98").build()) + .add(OSType.builder().id(64).OSCategoryId(6).description("Windows NT 4").build()) + .add(OSType.builder().id(87).OSCategoryId(6).description("Windows Server 2003 DataCenter Edition(32-bit)") + .build()) + .add(OSType.builder().id(88).OSCategoryId(6).description("Windows Server 2003 DataCenter Edition(64-bit)") + .build()) + .add(OSType.builder().id(50).OSCategoryId(6).description("Windows Server 2003 Enterprise Edition(32-bit)") + .build()) + .add(OSType.builder().id(51).OSCategoryId(6).description("Windows Server 2003 Enterprise Edition(64-bit)") + .build()) + .add(OSType.builder().id(89).OSCategoryId(6).description("Windows Server 2003 Standard Edition(32-bit)") + .build()) + .add(OSType.builder().id(90).OSCategoryId(6).description("Windows Server 2003 Standard Edition(64-bit)") + .build()) + .add(OSType.builder().id(91).OSCategoryId(6).description("Windows Server 2003 Web Edition").build()) + .add(OSType.builder().id(52).OSCategoryId(6).description("Windows Server 2008 (32-bit)").build()) + .add(OSType.builder().id(53).OSCategoryId(6).description("Windows Server 2008 (64-bit)").build()) + .add(OSType.builder().id(54).OSCategoryId(6).description("Windows Server 2008 R2 (64-bit)").build()) + .add(OSType.builder().id(56).OSCategoryId(6).description("Windows Vista (32-bit)").build()) + .add(OSType.builder().id(101).OSCategoryId(6).description("Windows Vista (64-bit)").build()) + .add(OSType.builder().id(93).OSCategoryId(6).description("Windows XP (32-bit)").build()) + .add(OSType.builder().id(94).OSCategoryId(6).description("Windows XP (64-bit)").build()) + .add(OSType.builder().id(57).OSCategoryId(6).description("Windows XP SP2 (32-bit)").build()) + .add(OSType.builder().id(58).OSCategoryId(6).description("Windows XP SP3 (32-bit)").build()).build(); } } \ No newline at end of file diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListPublicIPAddressesResponseTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListPublicIPAddressesResponseTest.java index b6d1f9ae8a..f71cd19b17 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListPublicIPAddressesResponseTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/parse/ListPublicIPAddressesResponseTest.java @@ -35,12 +35,11 @@ import com.google.common.collect.ImmutableSet; @Test(groups = "unit") public class ListPublicIPAddressesResponseTest extends BaseSetParserTest { - @Override public String resource() { return "/listpublicipaddressesresponse.json"; } - + @Override @SelectJson("publicipaddress") public Set expected() { diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/NetworkPredicatesTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/NetworkPredicatesTest.java index b5b1829f6c..effd125c96 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/NetworkPredicatesTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/NetworkPredicatesTest.java @@ -47,9 +47,12 @@ public class NetworkPredicatesTest { } public void testSupportsStaticNATFindsWhenFirewallHasStaticNatFeature() { - Network network = Network.builder().id(204).services( - ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of("StaticNat", "true")))) - .build(); + Network network = Network + .builder() + .id(204) + .services( + ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of("StaticNat", "true")))) + .build(); assert !hasLoadBalancerService().apply(network); assert supportsStaticNAT().apply(network); @@ -57,8 +60,8 @@ public class NetworkPredicatesTest { } public void testNoSupport() { - Network network = Network.builder().id(204).services( - ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of()))).build(); + Network network = Network.builder().id(204) + .services(ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of()))).build(); assert !hasLoadBalancerService().apply(network); assert !supportsStaticNAT().apply(network); @@ -66,9 +69,12 @@ public class NetworkPredicatesTest { } public void testSupportsPortForwardingFindsWhenFirewallHasPortForwardingFeature() { - Network network = Network.builder().id(204).services( - ImmutableSet.of(new NetworkService("Firewall", ImmutableMap - . of("PortForwarding", "true")))).build(); + Network network = Network + .builder() + .id(204) + .services( + ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of("PortForwarding", + "true")))).build(); assert !hasLoadBalancerService().apply(network); assert !supportsStaticNAT().apply(network); @@ -76,8 +82,11 @@ public class NetworkPredicatesTest { } public void testSupportsPortForwardingAndStaticNATWhenFirewallHasFeatures() { - Network network = Network.builder().id(204).services( - ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of("StaticNat", "true", + Network network = Network + .builder() + .id(204) + .services( + ImmutableSet.of(new NetworkService("Firewall", ImmutableMap. of("StaticNat", "true", "PortForwarding", "true")))).build(); assert Predicates.and(supportsPortForwarding(), supportsStaticNAT()).apply(network); diff --git a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicatesTest.java b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicatesTest.java index 37e5f1df1a..cf6ff37b8c 100644 --- a/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicatesTest.java +++ b/sandbox-apis/cloudstack/src/test/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicatesTest.java @@ -46,23 +46,23 @@ public class PublicIPAddressPredicatesTest { public void testIsNotAvailableWhenAssignedToVM() { PublicIPAddress address = PublicIPAddress.builder().state(PublicIPAddress.State.ALLOCATED).virtualMachineId(1) - .id(204).build(); + .id(204).build(); assert !available().apply(address); } public void testIsNotAvailableWhenSourceNAT() { - PublicIPAddress address = PublicIPAddress.builder().state(PublicIPAddress.State.ALLOCATED).isSourceNAT(true).id( - 204).build(); + PublicIPAddress address = PublicIPAddress.builder().state(PublicIPAddress.State.ALLOCATED).isSourceNAT(true) + .id(204).build(); assert !available().apply(address); } public void testIsNotAvailableWhenStaticNAT() { - PublicIPAddress address = PublicIPAddress.builder().state(PublicIPAddress.State.ALLOCATED).isStaticNAT(true).id( - 204).build(); + PublicIPAddress address = PublicIPAddress.builder().state(PublicIPAddress.State.ALLOCATED).isStaticNAT(true) + .id(204).build(); assert !available().apply(address);