From aec64012ee5cc1a295e9490ddb5a70dd9b9eee16 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 16 Nov 2014 19:17:17 -0800 Subject: [PATCH] JCLOUDS-778 Remove OS support tests from TemplateBuilderLiveTest, as people are ignoring failures, --- .../StubTemplateBuilderIntegrationTest.java | 2 +- .../internal/BaseTemplateBuilderLiveTest.java | 72 ------------------- .../AWSEC2TemplateBuilderLiveTest.java | 32 +-------- ...CloudServersUKTemplateBuilderLiveTest.java | 29 -------- ...CloudServersUSTemplateBuilderLiveTest.java | 31 +------- ...HostsAmsterdamTemplateBuilderLiveTest.java | 29 -------- ...cHostsHongKongTemplateBuilderLiveTest.java | 31 +------- ...eer1LosAngelesTemplateBuilderLiveTest.java | 31 +------- ...ueSquareLondonTemplateBuilderLiveTest.java | 29 -------- ...stsPeer1LondonTemplateBuilderLiveTest.java | 31 +------- ...eer1SanAntonioTemplateBuilderLiveTest.java | 31 +------- ...icHostsSanJoseTemplateBuilderLiveTest.java | 29 -------- ...ticHostsSydneyTemplateBuilderLiveTest.java | 29 -------- ...tsPeer1TorontoTemplateBuilderLiveTest.java | 29 -------- .../GleSYSTemplateBuilderLiveTest.java | 37 +--------- ...dJohannesburg1TemplateBuilderLiveTest.java | 26 +------ .../GoGridTemplateBuilderLiveTest.java | 28 +------- ...HPCloudComputeTemplateBuilderLiveTest.java | 28 +------- ...enHostingEast1TemplateBuilderLiveTest.java | 28 +------- ...CloudServersUKTemplateBuilderLiveTest.java | 28 -------- ...CloudServersUSTemplateBuilderLiveTest.java | 30 +------- ...loveManchesterTemplateBuilderLiveTest.java | 28 +------- ...iCloudMalaysiaTemplateBuilderLiveTest.java | 33 +-------- .../SoftLayerTemplateBuilderLiveTest.java | 31 -------- 24 files changed, 16 insertions(+), 716 deletions(-) diff --git a/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java b/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java index 2395217bed..f8a340dfc1 100644 --- a/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java +++ b/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java @@ -37,7 +37,7 @@ public class StubTemplateBuilderIntegrationTest extends BaseTemplateBuilderLiveT @Override protected Set getIso3166Codes() { - return ImmutableSet. of(); + return ImmutableSet.of(); } } diff --git a/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java b/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java index 501aba5e69..d0f8438e36 100644 --- a/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java @@ -29,13 +29,9 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import org.jclouds.compute.ComputeServiceContext; -import org.jclouds.compute.config.BaseComputeServiceContextModule; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; -import org.jclouds.compute.domain.TemplateBuilder; -import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.domain.Location; import org.jclouds.domain.LocationScope; import org.jclouds.domain.LoginCredentials; @@ -43,11 +39,8 @@ import org.jclouds.io.CopyInputStreamInputSupplierMap; import org.jclouds.json.Json; import org.jclouds.json.config.GsonModule; import org.jclouds.rest.config.CredentialStoreModule; -import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; @@ -70,10 +63,6 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseComputeServiceCont Hardware fastest = view.getComputeService().templateBuilder().fastest().build().getHardware(); Hardware biggest = view.getComputeService().templateBuilder().biggest().build().getHardware(); - System.out.printf("smallest %s%n", smallest); - System.out.printf("fastest %s%n", fastest); - System.out.printf("biggest %s%n", biggest); - assertEquals(defaultSize, smallest); assert getCores(smallest) <= getCores(fastest) : String.format("%s ! <= %s", smallest, fastest); @@ -92,66 +81,6 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseComputeServiceCont defaultTemplate.toString()); } - @DataProvider(name = "osSupported") - public Object[][] osSupported() { - return convertToArray(Sets.filter(provideAllOperatingSystems(), - Predicates.not(defineUnsupportedOperatingSystems()))); - } - - protected Object[][] convertToArray(Set supportedOperatingSystems) { - Object[][] returnVal = new Object[supportedOperatingSystems.size()][1]; - int i = 0; - for (OsFamilyVersion64Bit config : supportedOperatingSystems) - returnVal[i++][0] = config; - return returnVal; - } - - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.alwaysFalse(); - } - - @DataProvider(name = "osNotSupported") - public Object[][] osNotSupported() { - return convertToArray(Sets.filter(provideAllOperatingSystems(), defineUnsupportedOperatingSystems())); - } - - protected Set provideAllOperatingSystems() { - Map> map = new BaseComputeServiceContextModule() { - }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule()) - .getInstance(Json.class)); - - Set supportedOperatingSystems = Sets.newHashSet(); - for (Entry> osVersions : map.entrySet()) { - for (String version : Sets.newHashSet(osVersions.getValue().values())) { - supportedOperatingSystems.add(new OsFamilyVersion64Bit(osVersions.getKey(), version, false)); - supportedOperatingSystems.add(new OsFamilyVersion64Bit(osVersions.getKey(), version, true)); - } - } - return supportedOperatingSystems; - } - - @Test(dataProvider = "osSupported") - public void testTemplateBuilderCanFind(OsFamilyVersion64Bit matrix) throws InterruptedException { - TemplateBuilder builder = view.getComputeService().templateBuilder().osFamily(matrix.family) - .os64Bit(matrix.is64Bit); - if (!matrix.version.equals("")) - builder.osVersionMatches("^" + matrix.version + "$"); - Template template = builder.build(); - if (!matrix.version.equals("")) - assertEquals(template.getImage().getOperatingSystem().getVersion(), matrix.version); - assertEquals(template.getImage().getOperatingSystem().is64Bit(), matrix.is64Bit); - assertEquals(template.getImage().getOperatingSystem().getFamily(), matrix.family); - } - - @Test(dataProvider = "osNotSupported", expectedExceptions = NoSuchElementException.class) - public void testTemplateBuilderCannotFind(OsFamilyVersion64Bit matrix) throws InterruptedException { - TemplateBuilder builder = view.getComputeService().templateBuilder().osFamily(matrix.family) - .os64Bit(matrix.is64Bit); - if (!matrix.version.equals("")) - builder.osVersionMatches("^" + matrix.version + "$"); - builder.build(); - } - @Test public void testTemplateBuilderCanUseImageId() throws Exception { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -179,7 +108,6 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseComputeServiceCont public void testGetAssignableLocations() throws Exception { assertProvider(view.unwrap()); for (Location location : view.getComputeService().listAssignableLocations()) { - System.err.printf("location %s%n", location); assert location.getId() != null : location; assert location != location.getParent() : location; assert location.getScope() != null : location; diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java index 3cbad70325..f53b90ff27 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java @@ -31,7 +31,6 @@ import org.jclouds.aws.ec2.AWSEC2Api; import org.jclouds.aws.ec2.reference.AWSEC2Constants; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.ec2.EC2Api; import org.jclouds.ec2.compute.EC2TemplateBuilderLiveTest; @@ -48,8 +47,6 @@ import org.jclouds.location.reference.LocationConstants; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.inject.Module; @@ -65,33 +62,6 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { provider = "aws-ec2"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return true; - case DEBIAN: - return true; - case RHEL: - return input.version.equals("5.6") || input.version.equals("") - || (input.version.matches("[56].0") && input.is64Bit); - case CENTOS: - return input.version.matches("5.[0246]") || (input.version.equals("6.0") && input.is64Bit) - || input.version.equals(""); - case WINDOWS: - return input.version.matches("200[38]") || (input.version.equals("7") && !input.is64Bit) - || input.version.equals(""); - default: - return false; - } - } - - }); - } - @Test public void testTemplateBuilderM1MEDIUMWithNegativeLookaroundDoesntMatchTestImages() { @@ -361,7 +331,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-VA", "US-CA", "US-OR", "BR-SP", "IE", "SG", "AU-NSW", "JP-13"); + return ImmutableSet.of("US-VA", "US-CA", "US-OR", "BR-SP", "IE", "SG", "AU-NSW", "JP-13"); } } diff --git a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java index 793f523c7d..d3a6c92bd9 100644 --- a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java +++ b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java @@ -22,13 +22,10 @@ import static org.testng.Assert.assertEquals; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -41,32 +38,6 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi public CloudServersUKTemplateBuilderLiveTest() { provider = "cloudservers-uk"; } - - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.matches("(10.04)|(12.04)|(12.10)|(13.04)")) - && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.equals("5.0"); - case CENTOS: - return (input.version.equals("") || input.version.equals("5.6") || input.version.equals("6.0")) - && input.is64Bit; - case WINDOWS: - return input.version.equals("2008 SP2") || input.version.equals("") - || (input.version.equals("2008 R2") && input.is64Bit); - default: - return false; - } - } - - }); - } @Test public void testTemplateBuilder() { diff --git a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java index 940a8c7886..14b534fc31 100644 --- a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java +++ b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java @@ -22,13 +22,10 @@ import static org.testng.Assert.assertEquals; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -42,32 +39,6 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi provider = "cloudservers-us"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.matches("(10.04)|(12.04)|(12.10)|(13.04)")) - && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.equals("5.0"); - case CENTOS: - return (input.version.equals("") || input.version.matches("(5.6)|(5.8)|(5.9)|(6.0)|(6.2)|(6.3)|(6.4)")) - && input.is64Bit; - case WINDOWS: - return input.version.equals("2008 SP2") || input.version.equals("") - || (input.version.equals("2008 R2") && input.is64Bit); - default: - return false; - } - } - - }); - } - @Test public void testTemplateBuilder() { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -80,6 +51,6 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-IL", "US-TX", "AU-NSW"); + return ImmutableSet.of("US-IL", "US-TX", "AU-NSW"); } } diff --git a/providers/elastichosts-ams-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsAmsterdamTemplateBuilderLiveTest.java b/providers/elastichosts-ams-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsAmsterdamTemplateBuilderLiveTest.java index 1c8121fe57..bc98e4c9d1 100644 --- a/providers/elastichosts-ams-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsAmsterdamTemplateBuilderLiveTest.java +++ b/providers/elastichosts-ams-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsAmsterdamTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,32 +40,6 @@ public class ElasticHostsAmsterdamTemplateBuilderLiveTest extends BaseTemplateBu provider = "elastichosts-ams-e"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); diff --git a/providers/elastichosts-hkg-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsHongKongTemplateBuilderLiveTest.java b/providers/elastichosts-hkg-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsHongKongTemplateBuilderLiveTest.java index 4276e74561..e6ba8df158 100644 --- a/providers/elastichosts-hkg-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsHongKongTemplateBuilderLiveTest.java +++ b/providers/elastichosts-hkg-e/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsHongKongTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,32 +40,6 @@ public class ElasticHostsHongKongTemplateBuilderLiveTest extends BaseTemplateBui provider = "elastichosts-hkg-e"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -80,6 +51,6 @@ public class ElasticHostsHongKongTemplateBuilderLiveTest extends BaseTemplateBui @Override protected Set getIso3166Codes() { - return ImmutableSet. of("HK"); + return ImmutableSet.of("HK"); } } diff --git a/providers/elastichosts-lax-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LosAngelesTemplateBuilderLiveTest.java b/providers/elastichosts-lax-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LosAngelesTemplateBuilderLiveTest.java index 5fe8bf5f0f..df0a7f78d6 100644 --- a/providers/elastichosts-lax-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LosAngelesTemplateBuilderLiveTest.java +++ b/providers/elastichosts-lax-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LosAngelesTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,32 +41,6 @@ public class ElasticHostsPeer1LosAngelesTemplateBuilderLiveTest extends BaseTemp provider = "elastichosts-lax-p"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -81,6 +52,6 @@ public class ElasticHostsPeer1LosAngelesTemplateBuilderLiveTest extends BaseTemp @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-CA"); + return ImmutableSet.of("US-CA"); } } diff --git a/providers/elastichosts-lon-b/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsBlueSquareLondonTemplateBuilderLiveTest.java b/providers/elastichosts-lon-b/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsBlueSquareLondonTemplateBuilderLiveTest.java index 1a143385c9..d1a8f06f58 100644 --- a/providers/elastichosts-lon-b/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsBlueSquareLondonTemplateBuilderLiveTest.java +++ b/providers/elastichosts-lon-b/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsBlueSquareLondonTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,32 +40,6 @@ public class ElasticHostsBlueSquareLondonTemplateBuilderLiveTest extends BaseTem provider = "elastichosts-lon-b"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); diff --git a/providers/elastichosts-lon-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LondonTemplateBuilderLiveTest.java b/providers/elastichosts-lon-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LondonTemplateBuilderLiveTest.java index bf5b692979..b823cf73df 100644 --- a/providers/elastichosts-lon-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LondonTemplateBuilderLiveTest.java +++ b/providers/elastichosts-lon-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1LondonTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,32 +41,6 @@ public class ElasticHostsPeer1LondonTemplateBuilderLiveTest extends BaseTemplate provider = "elastichosts-lon-p"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -81,6 +52,6 @@ public class ElasticHostsPeer1LondonTemplateBuilderLiveTest extends BaseTemplate @Override protected Set getIso3166Codes() { - return ImmutableSet. of("GB-LND"); + return ImmutableSet.of("GB-LND"); } } diff --git a/providers/elastichosts-sat-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1SanAntonioTemplateBuilderLiveTest.java b/providers/elastichosts-sat-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1SanAntonioTemplateBuilderLiveTest.java index 1988ec7c13..0acb084588 100644 --- a/providers/elastichosts-sat-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1SanAntonioTemplateBuilderLiveTest.java +++ b/providers/elastichosts-sat-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1SanAntonioTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,32 +41,6 @@ public class ElasticHostsPeer1SanAntonioTemplateBuilderLiveTest extends BaseTemp provider = "elastichosts-sat-p"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -81,6 +52,6 @@ public class ElasticHostsPeer1SanAntonioTemplateBuilderLiveTest extends BaseTemp @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-TX"); + return ImmutableSet.of("US-TX"); } } diff --git a/providers/elastichosts-sjc-c/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSanJoseTemplateBuilderLiveTest.java b/providers/elastichosts-sjc-c/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSanJoseTemplateBuilderLiveTest.java index 85f54b436c..950e6ea787 100644 --- a/providers/elastichosts-sjc-c/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSanJoseTemplateBuilderLiveTest.java +++ b/providers/elastichosts-sjc-c/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSanJoseTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,32 +40,6 @@ public class ElasticHostsSanJoseTemplateBuilderLiveTest extends BaseTemplateBuil provider = "elastichosts-sjc-c"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); diff --git a/providers/elastichosts-syd-v/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSydneyTemplateBuilderLiveTest.java b/providers/elastichosts-syd-v/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSydneyTemplateBuilderLiveTest.java index ceaf2691da..25796920f3 100644 --- a/providers/elastichosts-syd-v/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSydneyTemplateBuilderLiveTest.java +++ b/providers/elastichosts-syd-v/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsSydneyTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,32 +40,6 @@ public class ElasticHostsSydneyTemplateBuilderLiveTest extends BaseTemplateBuild provider = "elastichosts-syd-v"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); diff --git a/providers/elastichosts-tor-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1TorontoTemplateBuilderLiveTest.java b/providers/elastichosts-tor-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1TorontoTemplateBuilderLiveTest.java index 75bd1d08f8..3f3bc412ce 100644 --- a/providers/elastichosts-tor-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1TorontoTemplateBuilderLiveTest.java +++ b/providers/elastichosts-tor-p/src/test/java/org/jclouds/elastichosts/compute/ElasticHostsPeer1TorontoTemplateBuilderLiveTest.java @@ -24,13 +24,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,32 +41,6 @@ public class ElasticHostsPeer1TorontoTemplateBuilderLiveTest extends BaseTemplat provider = "elastichosts-tor-p"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(final OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("12.04.1") || input.version.equals("13.10") || input.version - .equals("14.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("7.4")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("6.5")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") - || input.version.equals("2008 R2 + SQL") || input.version.equals("2012") || input.version - .equals("2012 R2 + SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); diff --git a/providers/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java b/providers/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java index b2043aab02..0833fcdfa1 100644 --- a/providers/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java +++ b/providers/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java @@ -24,15 +24,12 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.domain.Volume; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.jclouds.glesys.compute.options.GleSYSTemplateOptions; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -46,38 +43,6 @@ public class GleSYSTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { provider = "glesys"; } - // / allows us to break when a new os is added - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return input.version.equals("") - || input.version.equals("10.04") - || input.version.equals("12.04") - || ((input.version.equals("8.04") || input.version.equals("11.04") || input.version - .equals("10.10")) && input.is64Bit); - case DEBIAN: - return input.version.equals("") || input.version.matches("[56].0"); - case FEDORA: - return input.version.equals("") || input.version.equals("13") || input.version.equals("15"); - case CENTOS: - return input.version.equals("") || input.version.equals("5") || input.version.equals("5.5") - || input.version.equals("5.0") || input.version.equals("6.0"); - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008") - || input.version.equals("2008 R2")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -96,6 +61,6 @@ public class GleSYSTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { @Override protected Set getIso3166Codes() { - return ImmutableSet. of("NL-NH", "SE-N", "US-NY", "SE-AB"); + return ImmutableSet.of("NL-NH", "SE-N", "US-NY", "SE-AB"); } } diff --git a/providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java b/providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java index 9752bd4332..90501963c8 100644 --- a/providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java +++ b/providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java @@ -23,13 +23,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,27 +40,6 @@ public class Go2CloudJohannesburg1TemplateBuilderLiveTest extends BaseTemplateBu provider = "go2cloud-jhb1"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("10.10")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.equals("6.0")) && input.is64Bit; - case WINDOWS: - return input.version.equals("") && input.is64Bit; - default: - return false; - } - } - - }); - } - @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -76,6 +52,6 @@ public class Go2CloudJohannesburg1TemplateBuilderLiveTest extends BaseTemplateBu @Override protected Set getIso3166Codes() { - return ImmutableSet. of("ZA-GP"); + return ImmutableSet.of("ZA-GP"); } } diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/compute/GoGridTemplateBuilderLiveTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/compute/GoGridTemplateBuilderLiveTest.java index 930b818e5c..fc56de38e1 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/compute/GoGridTemplateBuilderLiveTest.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/compute/GoGridTemplateBuilderLiveTest.java @@ -23,13 +23,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,29 +41,6 @@ public class GoGridTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { provider = "gogrid"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case RHEL: - return input.version.equals("") || input.version.matches("5.[67]"); - case DEBIAN: - return input.version.equals("") || input.version.matches("[56].0"); - case UBUNTU: - return input.version.equals("") || input.version.equals("10.04"); - case CENTOS: - return input.version.equals("") || input.version.matches("5.[06]") || input.version.equals("6.0"); - case WINDOWS: - return input.version.equals("") || input.version.matches("200[38]"); - default: - return false; - } - } - }); - } - @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -78,6 +52,6 @@ public class GoGridTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-CA", "US-VA", "NL-NH"); + return ImmutableSet.of("US-CA", "US-VA", "NL-NH"); } } diff --git a/providers/hpcloud-compute/src/test/java/org/jclouds/hpcloud/compute/compute/HPCloudComputeTemplateBuilderLiveTest.java b/providers/hpcloud-compute/src/test/java/org/jclouds/hpcloud/compute/compute/HPCloudComputeTemplateBuilderLiveTest.java index c06fcb34f6..618c2963dc 100644 --- a/providers/hpcloud-compute/src/test/java/org/jclouds/hpcloud/compute/compute/HPCloudComputeTemplateBuilderLiveTest.java +++ b/providers/hpcloud-compute/src/test/java/org/jclouds/hpcloud/compute/compute/HPCloudComputeTemplateBuilderLiveTest.java @@ -23,14 +23,11 @@ import static org.testng.Assert.assertTrue; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,29 +41,6 @@ public class HPCloudComputeTemplateBuilderLiveTest extends BaseTemplateBuilderLi provider = "hpcloud-compute"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.matches("(10.04)|(11.10)|(12.04)|(12.10)|(13.04)|(13.10)")) && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.matches("(5.[0-9])|(6.[0-9])|(7.[0-9])"); - case CENTOS: - return (input.version.equals("") || input.version.matches("(5.0)|(5.8)|(6.3)|(6.5)")) && input.is64Bit; - case WINDOWS: - return input.version.equals("") || input.version.equals("2008") || (input.version.equals("2008 R2") && input.is64Bit); - default: - return false; - } - } - - }); - } - @Test public void testTemplateBuilder() { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -84,6 +58,6 @@ public class HPCloudComputeTemplateBuilderLiveTest extends BaseTemplateBuilderLi @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-NV", "US-VA"); + return ImmutableSet.of("US-NV", "US-VA"); } } diff --git a/providers/openhosting-east1/src/test/java/org/jclouds/openhosting/compute/OpenHostingEast1TemplateBuilderLiveTest.java b/providers/openhosting-east1/src/test/java/org/jclouds/openhosting/compute/OpenHostingEast1TemplateBuilderLiveTest.java index 3954d0749f..5ee34192f6 100644 --- a/providers/openhosting-east1/src/test/java/org/jclouds/openhosting/compute/OpenHostingEast1TemplateBuilderLiveTest.java +++ b/providers/openhosting-east1/src/test/java/org/jclouds/openhosting/compute/OpenHostingEast1TemplateBuilderLiveTest.java @@ -23,13 +23,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -43,29 +40,6 @@ public class OpenHostingEast1TemplateBuilderLiveTest extends BaseTemplateBuilder provider = "openhosting-east1"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2")) && input.is64Bit; - case UBUNTU: - return (input.version.equals("") || input.version.equals("10.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.matches("[56].0")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.matches("5.[567]")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -78,6 +52,6 @@ public class OpenHostingEast1TemplateBuilderLiveTest extends BaseTemplateBuilder @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-VA"); + return ImmutableSet.of("US-VA"); } } diff --git a/providers/rackspace-cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/uk/compute/CloudServersUKTemplateBuilderLiveTest.java b/providers/rackspace-cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/uk/compute/CloudServersUKTemplateBuilderLiveTest.java index 78d1637224..833d198278 100644 --- a/providers/rackspace-cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/uk/compute/CloudServersUKTemplateBuilderLiveTest.java +++ b/providers/rackspace-cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/uk/compute/CloudServersUKTemplateBuilderLiveTest.java @@ -23,14 +23,11 @@ import static org.testng.Assert.assertNull; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,31 +41,6 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi provider = "rackspace-cloudservers-uk"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.matches("(10.04)|(12.04)|(12.10)|(13.04)")) - && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.equals("5.0"); - case CENTOS: - return (input.version.equals("") || input.version.matches("(5.0)|(5.6)|(5.8)|(5.9)|(6.0)|(6.2)|(6.3)|(6.4)")) - && input.is64Bit; - case WINDOWS: - return input.is64Bit && input.version.equals(""); - default: - return false; - } - } - - }); - } - @Test public void testTemplateBuilder() { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); diff --git a/providers/rackspace-cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/us/compute/CloudServersUSTemplateBuilderLiveTest.java b/providers/rackspace-cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/us/compute/CloudServersUSTemplateBuilderLiveTest.java index 55bdebd326..a704f73654 100644 --- a/providers/rackspace-cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/us/compute/CloudServersUSTemplateBuilderLiveTest.java +++ b/providers/rackspace-cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/us/compute/CloudServersUSTemplateBuilderLiveTest.java @@ -23,14 +23,11 @@ import static org.testng.Assert.assertNull; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -44,31 +41,6 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi provider = "rackspace-cloudservers-us"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.matches("(10.04)|(12.04)|(12.10)|(13.04)")) - && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.equals("5.0"); - case CENTOS: - return (input.version.equals("") || input.version.matches("(5.0)|(5.6)|(5.8)|(5.9)|(6.0)|(6.2)|(6.3)|(6.4)")) - && input.is64Bit; - case WINDOWS: - return input.is64Bit && input.version.equals(""); - default: - return false; - } - } - - }); - } - @Test public void testTemplateBuilder() { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -87,6 +59,6 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi @Override protected Set getIso3166Codes() { - return ImmutableSet. of("US-IL", "US-TX", "AU-NSW"); + return ImmutableSet.of("US-IL", "US-TX", "AU-NSW"); } } diff --git a/providers/serverlove-z1-man/src/test/java/org/jclouds/serverlove/compute/ServerloveManchesterTemplateBuilderLiveTest.java b/providers/serverlove-z1-man/src/test/java/org/jclouds/serverlove/compute/ServerloveManchesterTemplateBuilderLiveTest.java index 49d3e6bca9..f3e639596e 100644 --- a/providers/serverlove-z1-man/src/test/java/org/jclouds/serverlove/compute/ServerloveManchesterTemplateBuilderLiveTest.java +++ b/providers/serverlove-z1-man/src/test/java/org/jclouds/serverlove/compute/ServerloveManchesterTemplateBuilderLiveTest.java @@ -22,13 +22,10 @@ import static org.testng.Assert.assertEquals; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -42,29 +39,6 @@ public class ServerloveManchesterTemplateBuilderLiveTest extends BaseTemplateBui provider = "serverlove-z1-man"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return (input.version.equals("") || input.version.equals("10.04") || input.version.equals("12.04")) && input.is64Bit; - case DEBIAN: - return (input.version.equals("") || input.version.equals("6.0")) && input.is64Bit; - case CENTOS: - return (input.version.equals("") || input.version.equals("5.7") || input.version.equals("6.2")) && input.is64Bit; - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2") || input.version.equals("2008 R2 SP1 SQL") || input.version.equals("2012") || input.version.equals("2008 R2 Web") || input.version.equals("2008 R2 SP1 Web SQL")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Test public void testTemplateBuilder() { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -77,6 +51,6 @@ public class ServerloveManchesterTemplateBuilderLiveTest extends BaseTemplateBui @Override protected Set getIso3166Codes() { - return ImmutableSet. of("GB-MAN"); + return ImmutableSet.of("GB-MAN"); } } diff --git a/providers/skalicloud-sdg-my/src/test/java/org/jclouds/skalicloud/compute/SkaliCloudMalaysiaTemplateBuilderLiveTest.java b/providers/skalicloud-sdg-my/src/test/java/org/jclouds/skalicloud/compute/SkaliCloudMalaysiaTemplateBuilderLiveTest.java index 2a235091fe..3fbdca0ad3 100644 --- a/providers/skalicloud-sdg-my/src/test/java/org/jclouds/skalicloud/compute/SkaliCloudMalaysiaTemplateBuilderLiveTest.java +++ b/providers/skalicloud-sdg-my/src/test/java/org/jclouds/skalicloud/compute/SkaliCloudMalaysiaTemplateBuilderLiveTest.java @@ -23,13 +23,10 @@ import java.io.IOException; import java.util.Set; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; import org.testng.annotations.Test; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; /** @@ -37,38 +34,12 @@ import com.google.common.collect.ImmutableSet; * @author Adrian Cole */ @Test(groups = "live") -public class SkaliCloudMalaysiaTemplateBuilderLiveTest - extends - BaseTemplateBuilderLiveTest { +public class SkaliCloudMalaysiaTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { public SkaliCloudMalaysiaTemplateBuilderLiveTest() { provider = "skalicloud-sdg-my"; } - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - switch (input.family) { - case UBUNTU: - return input.version.equals("") || input.version.matches("10.[01][04]"); - case DEBIAN: - return (input.version.equals("") || input.version.equals("5.0")) - || (input.version.equals("6.0") && input.is64Bit); - case CENTOS: - return input.version.equals("") || input.version.matches("5.[56]"); - case WINDOWS: - return (input.version.equals("") || input.version.equals("2008 R2")) && input.is64Bit; - default: - return false; - } - } - - }); - } - @Override public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); @@ -81,6 +52,6 @@ public class SkaliCloudMalaysiaTemplateBuilderLiveTest @Override protected Set getIso3166Codes() { - return ImmutableSet. of("MY-10"); + return ImmutableSet.of("MY-10"); } } diff --git a/providers/softlayer/src/test/java/org/jclouds/softlayer/compute/SoftLayerTemplateBuilderLiveTest.java b/providers/softlayer/src/test/java/org/jclouds/softlayer/compute/SoftLayerTemplateBuilderLiveTest.java index 98f31e7af6..401e52f057 100644 --- a/providers/softlayer/src/test/java/org/jclouds/softlayer/compute/SoftLayerTemplateBuilderLiveTest.java +++ b/providers/softlayer/src/test/java/org/jclouds/softlayer/compute/SoftLayerTemplateBuilderLiveTest.java @@ -29,7 +29,6 @@ import java.util.Set; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; import org.jclouds.compute.domain.Volume; import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; @@ -51,35 +50,6 @@ public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes provider = "softlayer"; } - // / allows us to break when a new os is added - @Override - protected Predicate defineUnsupportedOperatingSystems() { - return Predicates.not(new Predicate() { - - @Override - public boolean apply(OsFamilyVersion64Bit input) { - // For each os-type both 32- and 64-bit are supported. - switch (input.family) { - case UBUNTU: - return input.version.equals("") || input.version.equals("10.04") || input.version.equals("12.04") || input.version.equals("8"); - case DEBIAN: - return input.version.equals("") || input.version.matches("[56].0"); - case FEDORA: - return input.version.equals("") || input.version.equals("13") || input.version.equals("15"); - case RHEL: - return input.version.equals("") || input.version.equals("5") || input.version.equals("6"); - case CENTOS: - return input.version.equals("") || input.version.equals("5") || input.version.equals("6.0"); - case WINDOWS: - return input.version.equals("") || input.version.equals("2003") || input.version.equals("2008"); - default: - return false; - } - } - - }); - } - @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); @@ -212,5 +182,4 @@ public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes protected Set getIso3166Codes() { return ImmutableSet. of("SG", "US-CA", "US-TX", "US-VA", "US-WA", "NL"); } - }