From d7f0a675faab099c67451d092a28f027d641c30e 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 | 79 ------------------- .../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 | 62 +++------------ 24 files changed, 26 insertions(+), 744 deletions(-) diff --git a/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java b/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java index 3fc78f8a0c..c4656b99d5 100644 --- a/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java +++ b/compute/src/test/java/org/jclouds/compute/StubTemplateBuilderIntegrationTest.java @@ -32,7 +32,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 ed73307f60..15ad5a42c8 100644 --- a/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java @@ -20,38 +20,24 @@ import static org.jclouds.compute.util.ComputeServiceUtils.getCores; import static org.testng.Assert.assertEquals; import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; -import java.util.NoSuchElementException; import java.util.Properties; 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; -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; -import com.google.common.collect.Sets; import com.google.common.io.ByteSource; -import com.google.inject.Guice; import com.google.inject.Module; @Test(groups = "integration,live") @@ -64,10 +50,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); @@ -86,66 +68,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(); @@ -173,7 +95,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 9220e15704..f2fc9107dc 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; @@ -61,33 +58,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() { @@ -357,7 +327,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 3f9b27cbab..9c6c3f45d2 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; @Test(groups = "live") @@ -37,32 +34,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 dcbc2fbaed..6f9fcbf4d3 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; @Test(groups = "live") @@ -38,32 +35,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(); @@ -76,6 +47,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 172bdb217a..1f34ad999a 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; @Test(groups = "live", testName = "ElasticHostsAmsterdamTemplateBuilderLiveTest") @@ -40,32 +37,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 2885d139bb..7e130ddfb3 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; @Test(groups = "live", testName = "ElasticHostsHongKongTemplateBuilderLiveTest") @@ -40,32 +37,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(); @@ -77,6 +48,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 e8f76d7d4a..832b4ceb7b 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; @Test(groups = "live") @@ -40,32 +37,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(); @@ -77,6 +48,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 cc7f56b8be..5d4820b600 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; @Test(groups = "live") @@ -40,32 +37,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 85c2ea6d9a..40a164fa23 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; @Test(groups = "live") @@ -40,32 +37,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(); @@ -77,6 +48,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 f6c88cab41..3fff2154d2 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; @Test(groups = "live") @@ -40,32 +37,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(); @@ -77,6 +48,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 5244171f32..d5fb2c6247 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; @Test(groups = "live", testName = "ElasticHostsSanJoseTemplateBuilderLiveTest") @@ -40,32 +37,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 33aec6d3a0..aa6a87b1f1 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; @Test(groups = "live", testName = "ElasticHostsSydneyTemplateBuilderLiveTest") @@ -40,32 +37,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 76ebaec6b1..2f71ddfa78 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; @Test(groups = "live") @@ -40,32 +37,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 d7a612fb86..8881ac2dca 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; @Test(groups = "live", testName = "GleSYSTemplateBuilderLiveTest") @@ -42,38 +39,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(); @@ -92,6 +57,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 236ec7337f..949453c9f5 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; @Test(groups = "live") @@ -39,27 +36,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(); @@ -72,6 +48,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 26cdb3cef2..e17bc9f313 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; //NOTE:without testName, this will not call @Before* and fail w/NPE during surefire @@ -40,29 +37,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(); @@ -74,6 +48,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 9ff2ee6a1f..3c539e0521 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; @Test(groups = "live", singleThreaded = true, testName = "HPCloudComputeTemplateBuilderLiveTest") @@ -40,29 +37,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(); @@ -80,6 +54,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 adc305a713..c6c8027ab3 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; @Test(groups = "live") @@ -39,29 +36,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(); @@ -74,6 +48,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 d29d3d0161..d73b2041b0 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; @Test(groups = "live", singleThreaded = true, testName = "CloudServersUKTemplateBuilderLiveTest") @@ -40,31 +37,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 54b553c519..4bab764a7b 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; @Test(groups = "live", singleThreaded = true, testName = "CloudServersUSTemplateBuilderLiveTest") @@ -40,31 +37,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(); @@ -83,6 +55,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 0309544a73..f56f4a8f37 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; @Test(groups = "live") @@ -38,29 +35,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(); @@ -73,6 +47,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 58e5bdc981..c747e24952 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,48 +23,19 @@ 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; @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(); @@ -77,6 +48,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 678bae4cfe..78a7b5c233 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 @@ -16,25 +16,21 @@ */ package org.jclouds.softlayer.compute; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -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; -import org.jclouds.softlayer.compute.options.SoftLayerTemplateOptions; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.jclouds.compute.util.ComputeServiceUtils.getSpace; +import static org.testng.Assert.assertEquals; import java.io.IOException; import java.util.Properties; import java.util.Set; -import static org.jclouds.compute.util.ComputeServiceUtils.getCores; -import static org.jclouds.compute.util.ComputeServiceUtils.getSpace; -import static org.testng.Assert.assertEquals; +import org.jclouds.compute.ComputeServiceContext; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.Volume; +import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest; +import org.jclouds.softlayer.compute.options.SoftLayerTemplateOptions; +import org.testng.annotations.Test; @Test(groups = "live", alwaysRun = false) public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { @@ -45,38 +41,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.04"); - 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") || - input.version.equals("6.1") || input.version.equals("5.4") || input.version.equals("5.7"); - case CENTOS: - return input.version.equals("") || input.version.equals("5") || input.version.equals("6.0") || - input.version.equals("6.1") || input.version.equals("6.2") || input.version.equals("6"); - 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(); @@ -164,10 +128,4 @@ public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes protected Set getIso3166Codes() { return createProviderMetadata().getIso3166Codes(); } - - @BeforeClass(groups = "live") - @Override - public void setupContext() { - super.setupContext(); - } }