mirror of https://github.com/apache/jclouds.git
Code Formatting commit.
This commit is contained in:
parent
60f70a0589
commit
6d4ce41d15
|
@ -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}
|
||||
|
|
|
@ -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<AccountAsyncClient> {
|
||||
|
||||
|
@ -61,8 +62,8 @@ public class AccountAsyncClientTest extends BaseCloudStackAsyncClientTest<Accoun
|
|||
|
||||
public void testListAccountsOptions() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = AccountAsyncClient.class.getMethod("listAccounts", ListAccountsOptions[].class);
|
||||
HttpRequest httpRequest = processor.createRequest(method, ListAccountsOptions.Builder.accountInDomain("jclouds",
|
||||
123));
|
||||
HttpRequest httpRequest = processor.createRequest(method,
|
||||
ListAccountsOptions.Builder.accountInDomain("jclouds", 123));
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=listAccounts&account=jclouds&domainid=123 HTTP/1.1");
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
*/
|
||||
package org.jclouds.cloudstack.features;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.cloudstack.domain.Account;
|
||||
import org.jclouds.cloudstack.domain.User;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Tests behavior of {@code AccountClient}
|
||||
*
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.jclouds.cloudstack.options.AssociateIPAddressOptions;
|
|||
import org.jclouds.cloudstack.options.ListPublicIPAddressesOptions;
|
||||
import org.jclouds.functions.IdentityFunction;
|
||||
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.ReturnNullOnNotFoundOr404;
|
||||
|
@ -43,12 +43,12 @@ 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 = "AddressAsyncClientTest")
|
||||
public class AddressAsyncClientTest extends BaseCloudStackAsyncClientTest<AddressAsyncClient> {
|
||||
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<Addres
|
|||
}
|
||||
|
||||
public void testListPublicIPAddressesOptions() 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,
|
||||
ListPublicIPAddressesOptions.Builder.accountInDomain("adrian", 6).usesVirtualNetwork(true));
|
||||
|
||||
|
@ -103,12 +102,11 @@ public class AddressAsyncClientTest extends BaseCloudStackAsyncClientTest<Addres
|
|||
}
|
||||
|
||||
public void testAssociateIPAddressInZone() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = AddressAsyncClient.class.getMethod("associateIPAddressInZone",
|
||||
long.class, AssociateIPAddressOptions[].class);
|
||||
Method method = AddressAsyncClient.class.getMethod("associateIPAddressInZone", long.class,
|
||||
AssociateIPAddressOptions[].class);
|
||||
HttpRequest httpRequest = processor.createRequest(method, 6);
|
||||
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
assertRequestLineEquals(httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=associateIpAddress&zoneid=6 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
|
|
@ -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<AsyncJobAsyncClient> {
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<ConfigurationAsyncClient> {
|
||||
|
||||
|
|
|
@ -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,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 = "FirewallAsyncClientTest")
|
||||
public class FirewallAsyncClientTest extends BaseCloudStackAsyncClientTest<FirewallAsyncClient> {
|
||||
public void testListPortForwardingRules() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
|
|
@ -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 = "GuestOSAsyncClientTest")
|
||||
public class GuestOSAsyncClientTest extends BaseCloudStackAsyncClientTest<GuestOSAsyncClient> {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import static org.testng.Assert.assertEquals;
|
|||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.cloudstack.domain.OSType;
|
||||
import org.jclouds.cloudstack.options.ListOSTypesOptions;
|
||||
|
|
|
@ -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<HypervisorAsyncClient> {
|
||||
|
||||
|
|
|
@ -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 = "LoadBalancerAsyncClientTest")
|
||||
public class LoadBalancerAsyncClientTest extends BaseCloudStackAsyncClientTest<LoadBalancerAsyncClient> {
|
||||
public void testListLoadBalancerRules() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
|
|
@ -28,11 +28,11 @@ import java.util.Set;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jclouds.cloudstack.domain.LoadBalancerRule;
|
||||
import org.jclouds.cloudstack.domain.LoadBalancerRule.Algorithm;
|
||||
import org.jclouds.cloudstack.domain.LoadBalancerRule.State;
|
||||
import org.jclouds.cloudstack.domain.Network;
|
||||
import org.jclouds.cloudstack.domain.PublicIPAddress;
|
||||
import org.jclouds.cloudstack.domain.VirtualMachine;
|
||||
import org.jclouds.cloudstack.domain.LoadBalancerRule.Algorithm;
|
||||
import org.jclouds.cloudstack.domain.LoadBalancerRule.State;
|
||||
import org.jclouds.cloudstack.predicates.LoadBalancerRuleActive;
|
||||
import org.jclouds.cloudstack.predicates.NetworkPredicates;
|
||||
import org.jclouds.net.IPSocket;
|
||||
|
@ -110,7 +110,8 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest {
|
|||
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 {
|
||||
|
|
|
@ -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<NATAsyncClient> {
|
||||
public void testListIPForwardingRules() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
|
|
@ -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<NetworkAsyncClient> {
|
||||
public void testListNetworks() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
@ -102,7 +103,8 @@ public class NetworkAsyncClientTest extends BaseCloudStackAsyncClientTest<Networ
|
|||
String.class, CreateNetworkOptions[].class);
|
||||
HttpRequest httpRequest = processor.createRequest(method, 1, 2, "named", "lovely");
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=createNetwork&zoneid=1&name=named&networkofferingid=2&displaytext=lovely HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
@ -122,7 +124,8 @@ public class NetworkAsyncClientTest extends BaseCloudStackAsyncClientTest<Networ
|
|||
HttpRequest httpRequest = processor.createRequest(method, 1, 2, "named", "lovely", CreateNetworkOptions.Builder
|
||||
.netmask("255.255.255.0").domainId(6));
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=createNetwork&zoneid=1&name=named&networkofferingid=2&displaytext=lovely&netmask=255.255.255.0&domainid=6 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
|
|
@ -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 = "ServiceOfferingAsyncClientTest")
|
||||
public class OfferingAsyncClientTest extends BaseCloudStackAsyncClientTest<OfferingAsyncClient> {
|
||||
public void testListDiskOfferings() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
|
|
@ -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<SecurityGroupAsyncClient> {
|
||||
|
||||
|
@ -124,8 +125,8 @@ 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"));
|
||||
HttpRequest httpRequest = processor.createRequest(method, 2, "tcp", 22, 22,
|
||||
ImmutableSet.of("1.1.1.1/24", "1.2.2.2/16"));
|
||||
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
|
@ -144,8 +145,8 @@ 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"));
|
||||
HttpRequest httpRequest = processor.createRequest(method, 2, "tcp", 22, 22,
|
||||
ImmutableMultimap.of("adrian", "group1", "adrian", "group2", "bob", "group1"));
|
||||
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
|
@ -183,8 +184,8 @@ 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"));
|
||||
HttpRequest httpRequest = processor.createRequest(method, 2, 22, 22,
|
||||
ImmutableMultimap.of("adrian", "group1", "adrian", "group2", "bob", "group1"));
|
||||
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
|
@ -203,10 +204,11 @@ 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));
|
||||
HttpRequest httpRequest = processor.createRequest(method, 5,
|
||||
AccountInDomainOptions.Builder.accountInDomain("adrian", 1));
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
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);
|
||||
|
|
|
@ -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<TemplateAsyncClient> {
|
||||
public void testListTemplates() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
@ -61,8 +62,11 @@ public class TemplateAsyncClientTest extends BaseCloudStackAsyncClientTest<Templ
|
|||
|
||||
public void testListTemplatesOptions() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = TemplateAsyncClient.class.getMethod("listTemplates", ListTemplatesOptions.class);
|
||||
HttpRequest httpRequest = processor.createRequest(method, ListTemplatesOptions.Builder.accountInDomain("adrian",
|
||||
6).hypervisor("xen").filter(TemplateFilter.FEATURED));
|
||||
HttpRequest httpRequest = processor
|
||||
.createRequest(
|
||||
method,
|
||||
ListTemplatesOptions.Builder.accountInDomain("adrian", 6).hypervisor("xen")
|
||||
.filter(TemplateFilter.FEATURED));
|
||||
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
|
@ -82,7 +86,8 @@ public class TemplateAsyncClientTest extends BaseCloudStackAsyncClientTest<Templ
|
|||
Method method = TemplateAsyncClient.class.getMethod("getTemplateInZone", long.class, long.class);
|
||||
HttpRequest httpRequest = processor.createRequest(method, 1, 5);
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=listTemplates&templatefilter=executable&zoneid=1&id=5 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
*/
|
||||
package org.jclouds.cloudstack.features;
|
||||
|
||||
import static org.jclouds.cloudstack.options.ListTemplatesOptions.Builder.zoneId;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.cloudstack.domain.Template;
|
||||
import static org.jclouds.cloudstack.options.ListTemplatesOptions.Builder.zoneId;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
|
|
@ -42,7 +42,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 = "VirtualMachineAsyncClientTest")
|
||||
public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest<VirtualMachineAsyncClient> {
|
||||
public void testListVirtualMachines() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
@ -66,8 +67,8 @@ 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));
|
||||
HttpRequest httpRequest = processor.createRequest(method,
|
||||
ListVirtualMachinesOptions.Builder.accountInDomain("adrian", 6).usesVirtualNetwork(true));
|
||||
|
||||
assertRequestLineEquals(
|
||||
httpRequest,
|
||||
|
|
|
@ -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<ZoneAsyncClient> {
|
||||
public void testListZones() throws SecurityException, NoSuchMethodException, IOException {
|
||||
|
|
|
@ -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,7 +43,8 @@ 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" })
|
||||
|
@ -60,33 +61,34 @@ public class QuerySignerTest {
|
|||
|
||||
@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()),
|
||||
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())
|
||||
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(
|
||||
|
|
|
@ -85,10 +85,13 @@ 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<PublicIPAddress> expects = AsyncJob.<PublicIPAddress> builder().id(1103).status(2).progress(0)
|
||||
.resultType("object").error(
|
||||
new AsyncJobError(530,
|
||||
"Internal error executing command, please contact your system administrator"))
|
||||
AsyncJob<PublicIPAddress> expects = AsyncJob
|
||||
.<PublicIPAddress> 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);
|
||||
|
@ -114,13 +117,15 @@ public class ParseAsyncJobFromHttpResponseTest {
|
|||
}
|
||||
|
||||
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")
|
||||
|
@ -132,9 +137,19 @@ public class ParseAsyncJobFromHttpResponseTest {
|
|||
|
||||
public void testPublicIPAddress() {
|
||||
InputStream is = getClass().getResourceAsStream("/queryasyncjobresultresponse-ipaddress.json");
|
||||
AsyncJob<PublicIPAddress> expects = AsyncJob.<PublicIPAddress> builder().id(860).status(1).progress(0)
|
||||
.resultType("object").resultCode(0).result(
|
||||
PublicIPAddress.builder().id(6).IPAddress("72.52.126.35").allocated(
|
||||
AsyncJob<PublicIPAddress> expects = AsyncJob
|
||||
.<PublicIPAddress> 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)
|
||||
|
@ -152,12 +167,17 @@ public class ParseAsyncJobFromHttpResponseTest {
|
|||
|
||||
public void testIPForwardingRule() {
|
||||
InputStream is = getClass().getResourceAsStream("/queryasyncjobresultresponse-ipforwardingrule.json");
|
||||
AsyncJob<IPForwardingRule> expects = AsyncJob.<IPForwardingRule> 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<IPForwardingRule> expects = AsyncJob
|
||||
.<IPForwardingRule> 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")
|
||||
|
|
|
@ -67,7 +67,8 @@ public class ReuseOrAssociateNewPublicIPAddressTest {
|
|||
replay(addressClient);
|
||||
|
||||
// run
|
||||
assertEquals(new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId)
|
||||
assertEquals(
|
||||
new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId)
|
||||
.zoneId(zoneId).build()), address);
|
||||
|
||||
// verify mocks
|
||||
|
@ -105,7 +106,8 @@ public class ReuseOrAssociateNewPublicIPAddressTest {
|
|||
replay(jobClient);
|
||||
|
||||
// run
|
||||
assertEquals(new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId)
|
||||
assertEquals(
|
||||
new ReuseOrAssociateNewPublicIPAddress(client, jobComplete).apply(Network.builder().id(networkId)
|
||||
.zoneId(zoneId).build()), address);
|
||||
|
||||
// verify mocks
|
||||
|
@ -134,7 +136,8 @@ public class ReuseOrAssociateNewPublicIPAddressTest {
|
|||
// 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);
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -93,20 +93,11 @@ public class ListAccountsResponseTest extends BaseSetParserTest<Account> {
|
|||
.VMsRunning(1)
|
||||
.state(State.ENABLED)
|
||||
.users(
|
||||
ImmutableSet.of(User.builder()
|
||||
.id(505)
|
||||
.name("jclouds")
|
||||
.firstName("Adrian")
|
||||
.lastName("Cole")
|
||||
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());
|
||||
.state("enabled").account("jclouds").accountType(Type.USER).domainId(457)
|
||||
.domain("AA000062-jclouds-dev").apiKey("APIKEY").secretKey("SECRETKEY").build())).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ public class ListOSCategoriesResponseTest extends BaseItemParserTest<Map<Long, S
|
|||
|
||||
@Override
|
||||
public Map<Long, String> expected() {
|
||||
return ImmutableMap.<Long, String> 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.<Long, String> 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
|
||||
|
|
|
@ -42,189 +42,157 @@ public class ListOSTypesResponseTest extends BaseSetParserTest<OSType> {
|
|||
@Override
|
||||
@SelectJson("ostype")
|
||||
public Set<OSType> expected() {
|
||||
return ImmutableSet.<OSType> 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())
|
||||
return ImmutableSet
|
||||
.<OSType> 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(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(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(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();
|
||||
.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();
|
||||
}
|
||||
}
|
|
@ -35,7 +35,6 @@ import com.google.common.collect.ImmutableSet;
|
|||
@Test(groups = "unit")
|
||||
public class ListPublicIPAddressesResponseTest extends BaseSetParserTest<PublicIPAddress> {
|
||||
|
||||
|
||||
@Override
|
||||
public String resource() {
|
||||
return "/listpublicipaddressesresponse.json";
|
||||
|
|
|
@ -47,7 +47,10 @@ public class NetworkPredicatesTest {
|
|||
}
|
||||
|
||||
public void testSupportsStaticNATFindsWhenFirewallHasStaticNatFeature() {
|
||||
Network network = Network.builder().id(204).services(
|
||||
Network network = Network
|
||||
.builder()
|
||||
.id(204)
|
||||
.services(
|
||||
ImmutableSet.of(new NetworkService("Firewall", ImmutableMap.<String, String> of("StaticNat", "true"))))
|
||||
.build();
|
||||
|
||||
|
@ -57,8 +60,8 @@ public class NetworkPredicatesTest {
|
|||
}
|
||||
|
||||
public void testNoSupport() {
|
||||
Network network = Network.builder().id(204).services(
|
||||
ImmutableSet.of(new NetworkService("Firewall", ImmutableMap.<String, String> of()))).build();
|
||||
Network network = Network.builder().id(204)
|
||||
.services(ImmutableSet.of(new NetworkService("Firewall", ImmutableMap.<String, String> 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
|
||||
.<String, String> of("PortForwarding", "true")))).build();
|
||||
Network network = Network
|
||||
.builder()
|
||||
.id(204)
|
||||
.services(
|
||||
ImmutableSet.of(new NetworkService("Firewall", ImmutableMap.<String, String> of("PortForwarding",
|
||||
"true")))).build();
|
||||
|
||||
assert !hasLoadBalancerService().apply(network);
|
||||
assert !supportsStaticNAT().apply(network);
|
||||
|
@ -76,7 +82,10 @@ public class NetworkPredicatesTest {
|
|||
}
|
||||
|
||||
public void testSupportsPortForwardingAndStaticNATWhenFirewallHasFeatures() {
|
||||
Network network = Network.builder().id(204).services(
|
||||
Network network = Network
|
||||
.builder()
|
||||
.id(204)
|
||||
.services(
|
||||
ImmutableSet.of(new NetworkService("Firewall", ImmutableMap.<String, String> of("StaticNat", "true",
|
||||
"PortForwarding", "true")))).build();
|
||||
|
||||
|
|
|
@ -53,16 +53,16 @@ public class PublicIPAddressPredicatesTest {
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue