diff --git a/allcompute/pom.xml b/allcompute/pom.xml index 679a26f9fb..fdd6950b95 100644 --- a/allcompute/pom.xml +++ b/allcompute/pom.xml @@ -180,11 +180,6 @@ hpcloud-compute ${project.version} - - org.jclouds.provider - trystack-nova - ${project.version} - org.jclouds.provider rackspace-cloudservers-us diff --git a/apis/openstack-keystone/src/test/resources/keystoneAuthResponse_trystack.json b/apis/openstack-keystone/src/test/resources/keystoneAuthResponse_openstack.json similarity index 81% rename from apis/openstack-keystone/src/test/resources/keystoneAuthResponse_trystack.json rename to apis/openstack-keystone/src/test/resources/keystoneAuthResponse_openstack.json index 27844f2fd8..469734f0f4 100644 --- a/apis/openstack-keystone/src/test/resources/keystoneAuthResponse_trystack.json +++ b/apis/openstack-keystone/src/test/resources/keystoneAuthResponse_openstack.json @@ -10,10 +10,10 @@ }, "serviceCatalog": [{ "endpoints": [{ - "adminURL": "https://nova-api.trystack.org:9774/v1.1/3456", + "adminURL": "https://nova-api.openstack.org:9774/v1.1/3456", "region": "RegionOne", - "internalURL": "https://nova-api.trystack.org:9774/v1.1/3456", - "publicURL": "https://nova-api.trystack.org:9774/v1.1/3456" + "internalURL": "https://nova-api.openstack.org:9774/v1.1/3456", + "publicURL": "https://nova-api.openstack.org:9774/v1.1/3456" }], "type": "compute", "name": "nova" @@ -28,7 +28,7 @@ "name": "glance" }, { "endpoints": [{ - "adminURL": "https://nova-api.trystack.org:5443/v2.0", + "adminURL": "https://nova-api.openstack.org:5443/v2.0", "region": "RegionOne", "internalURL": "https://keystone.thefreecloud.org:5000/v2.0", "publicURL": "https://keystone.thefreecloud.org:5000/v2.0" diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java index 015085105f..f12c1a9697 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java @@ -86,7 +86,6 @@ public class CreateSecurityGroupIfNeeded implements Function> authorizing securityGroup(%s) permission to 0.0.0.0/0 on port %d", securityGroup, port); securityGroupApi.createRuleAllowingCidrBlock(securityGroup.getId(), Ingress.builder().ipProtocol( IpProtocol.TCP).fromPort(port).toPort(port).build(), "0.0.0.0/0"); diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceExpectTest.java index 04cdc36499..df25289584 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceExpectTest.java @@ -58,7 +58,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe protected Properties setupProperties() { Properties overrides = super.setupProperties(); // only specify limited zones so that we don't have to configure requests for multiple zones. - // since we are doing tests with keystone responses from hpcloud and also trystack, we have + // since we are doing tests with keystone responses from hpcloud and also openstack, we have // to whitelist one zone from each overrides.setProperty("jclouds.zones", "az-1.region-a.geo-1,RegionOne"); return overrides; @@ -85,7 +85,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe assertEquals(apiWhenServersExist.listNodes().iterator().next().getName(), "sample-server"); } - Map defaultTemplateTryStack = ImmutableMap + Map defaultTemplateOpenStack = ImmutableMap . builder() .put(keystoneAuthWithUsernameAndPasswordAndTenantName, HttpResponse @@ -93,31 +93,31 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe .statusCode(200) .message("HTTP/1.1 200") .payload( - payloadFromResourceWithContentType("/keystoneAuthResponse_trystack.json", "application/json")) + payloadFromResourceWithContentType("/keystoneAuthResponse_openstack.json", "application/json")) .build()) .put(extensionsOfNovaRequest.toBuilder() - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/extensions").build(), - HttpResponse.builder().statusCode(200).payload(payloadFromResource("/extension_list_trystack.json")) + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/extensions").build(), + HttpResponse.builder().statusCode(200).payload(payloadFromResource("/extension_list_openstack.json")) .build()) .put(listDetail.toBuilder() - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/images/detail").build(), - HttpResponse.builder().statusCode(200).payload(payloadFromResource("/image_list_detail_trystack.json")) + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/images/detail").build(), + HttpResponse.builder().statusCode(200).payload(payloadFromResource("/image_list_detail_openstack.json")) .build()) .put(listServers.toBuilder() - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/servers/detail").build(), + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/servers/detail").build(), listServersResponse) .put(listFlavorsDetail.toBuilder() - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/flavors/detail").build(), - HttpResponse.builder().statusCode(200).payload(payloadFromResource("/flavor_list_detail_trystack.json")) + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/flavors/detail").build(), + HttpResponse.builder().statusCode(200).payload(payloadFromResource("/flavor_list_detail_openstack.json")) .build()).build(); - public void testDefaultTemplateTryStack() throws Exception { + public void testDefaultTemplateOpenStack() throws Exception { - ComputeService apiForTryStack = requestsSendResponses(defaultTemplateTryStack); + ComputeService apiForOpenStack = requestsSendResponses(defaultTemplateOpenStack); - Template defaultTemplate = apiForTryStack.templateBuilder().imageId("RegionOne/15").build(); + Template defaultTemplate = apiForOpenStack.templateBuilder().imageId("RegionOne/15").build(); checkTemplate(defaultTemplate); - checkTemplate(apiForTryStack.templateBuilder().fromTemplate(defaultTemplate).build()); + checkTemplate(apiForOpenStack.templateBuilder().fromTemplate(defaultTemplate).build()); } @@ -149,7 +149,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest list = HttpRequest .builder() .method("GET") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/os-security-groups") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/os-security-groups") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken).build(); @@ -158,7 +158,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest createWithPrefixOnGroup = HttpRequest .builder() .method("POST") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/os-security-groups") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/os-security-groups") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .payload( @@ -172,7 +172,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest createRuleForDefaultPort22 = HttpRequest .builder() .method("POST") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/os-security-group-rules") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/os-security-group-rules") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .payload( @@ -186,7 +186,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest getSecurityGroup = HttpRequest .builder() .method("GET") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/os-security-groups/160") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/os-security-groups/160") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken).build(); @@ -196,7 +196,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest create = HttpRequest .builder() .method("POST") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/os-keypairs") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/os-keypairs") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .payload( @@ -210,7 +210,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest serverDetail = HttpRequest .builder() .method("GET") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/servers/71752") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/servers/71752") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken).build(); @@ -220,7 +220,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe @Test public void testCreateNodeWithGeneratedKeyPair() throws Exception { Builder requestResponseMap = ImmutableMap. builder() - .putAll(defaultTemplateTryStack); + .putAll(defaultTemplateOpenStack); requestResponseMap.put(list, notFound); requestResponseMap.put(createWithPrefixOnGroup, securityGroupCreated); @@ -236,7 +236,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest createServerWithGeneratedKeyPair = HttpRequest .builder() .method("POST") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/servers") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/servers") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .payload( @@ -276,7 +276,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe @Test public void testCreateNodeWhileUserSpecifiesKeyPair() throws Exception { Builder requestResponseMap = ImmutableMap. builder() - .putAll(defaultTemplateTryStack); + .putAll(defaultTemplateOpenStack); requestResponseMap.put(list, notFound); requestResponseMap.put(createWithPrefixOnGroup, securityGroupCreated); @@ -290,7 +290,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest createServerWithSuppliedKeyPair = HttpRequest .builder() .method("POST") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/servers") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/servers") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .payload( @@ -332,7 +332,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe @Test public void testCreateNodeWhileUserSpecifiesKeyPairAndUserSpecifiedGroups() throws Exception { Builder requestResponseMap = ImmutableMap. builder() - .putAll(defaultTemplateTryStack); + .putAll(defaultTemplateOpenStack); requestResponseMap.put(list, notFound); requestResponseMap.put(serverDetail, serverDetailResponse); @@ -340,7 +340,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe HttpRequest createServerWithSuppliedKeyPairAndGroup = HttpRequest .builder() .method("POST") - .endpoint("https://nova-api.trystack.org:9774/v1.1/3456/servers") + .endpoint("https://nova-api.openstack.org:9774/v1.1/3456/servers") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .payload( diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java index 676de9f1a4..914b829310 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java @@ -48,7 +48,7 @@ public class ParseServerWithInternetAddressesTest extends BaseItemParserTest extends BaseRestClientExpectTest @Override protected Properties setupProperties() { Properties overrides = super.setupProperties(); - // hpcloud or trystack + // hpcloud or openstack overrides.setProperty("jclouds.regions", "region-a.geo-1,RegionOne"); return overrides; } diff --git a/core/src/main/java/org/jclouds/providers/ProviderMetadata.java b/core/src/main/java/org/jclouds/providers/ProviderMetadata.java index 8c3d8266d7..fe341d04d1 100644 --- a/core/src/main/java/org/jclouds/providers/ProviderMetadata.java +++ b/core/src/main/java/org/jclouds/providers/ProviderMetadata.java @@ -120,7 +120,7 @@ public interface ProviderMetadata { /** * - * @return the provider's unique identifier (ex. aws-ec2, trystack-nova) + * @return the provider's unique identifier (ex. aws-ec2, rackspace-cloudservers-us) */ public String getId(); diff --git a/providers/pom.xml b/providers/pom.xml index 1010e200a6..0c4edf3310 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -61,7 +61,6 @@ ninefold-compute hpcloud-compute hpcloud-objectstorage - trystack-nova cloudservers-us cloudservers-uk cloudfiles-us diff --git a/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadata.java b/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadata.java deleted file mode 100644 index 16299e5890..0000000000 --- a/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadata.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova; - -import static org.jclouds.Constants.PROPERTY_TRUST_ALL_CERTS; -import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS; - -import java.net.URI; -import java.util.Properties; - -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule; -import org.jclouds.openstack.keystone.v2_0.config.MappedAuthenticationApiModule; -import org.jclouds.openstack.nova.v2_0.NovaApiMetadata; -import org.jclouds.openstack.nova.v2_0.config.NovaParserModule; -import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule; -import org.jclouds.providers.ProviderMetadata; -import org.jclouds.providers.internal.BaseProviderMetadata; -import org.jclouds.trystack.nova.config.TryStackNovaServiceContextModule; - -import com.google.common.collect.ImmutableSet; -import com.google.inject.Module; - -/** - * Implementation of {@link org.jclouds.types.ProviderMetadata} for TryStack Nova - * - * @author Adrian Cole - */ -public class TryStackNovaProviderMetadata extends BaseProviderMetadata { - - public static Builder builder() { - return new Builder(); - } - - @Override - public Builder toBuilder() { - return builder().fromProviderMetadata(this); - } - - public TryStackNovaProviderMetadata() { - super(builder()); - } - - public TryStackNovaProviderMetadata(Builder builder) { - super(builder); - } - - public static Properties defaultProperties() { - Properties properties = new Properties(); - properties.setProperty(PROPERTY_TRUST_ALL_CERTS, "true"); - properties.setProperty(AUTO_GENERATE_KEYPAIRS, "true"); - return properties; - } - - public static class Builder extends BaseProviderMetadata.Builder { - - protected Builder(){ - id("trystack-nova") - .name("TryStack.org (Nova)") - .apiMetadata( - new NovaApiMetadata().toBuilder() - .defaultModules(ImmutableSet.>builder() - .add(MappedAuthenticationApiModule.class) - .add(KeystoneAuthenticationModule.class) - .add(ZoneModule.class) - .add(NovaParserModule.class) - .add(NovaRestClientModule.class) - .add(TryStackNovaServiceContextModule.class).build()) - .build()) - .homepage(URI.create("https://trystack.org")) - .console(URI.create("https://trystack.org/dash")) - .iso3166Codes("US-CA") - .endpoint("https://nova-api.trystack.org:5443/v2.0/") - .defaultProperties(TryStackNovaProviderMetadata.defaultProperties()); - } - - @Override - public TryStackNovaProviderMetadata build() { - return new TryStackNovaProviderMetadata(this); - } - - @Override - public Builder fromProviderMetadata( - ProviderMetadata in) { - super.fromProviderMetadata(in); - return this; - } - } -} diff --git a/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaServiceAdapter.java b/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaServiceAdapter.java deleted file mode 100644 index 8f1819c085..0000000000 --- a/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaServiceAdapter.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.jclouds.trystack.nova; - -import java.util.Set; - -import javax.inject.Inject; - -import org.jclouds.location.Zone; -import org.jclouds.openstack.nova.v2_0.NovaApi; -import org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter; -import org.jclouds.openstack.nova.v2_0.compute.functions.RemoveFloatingIpFromNodeAndDeallocate; -import org.jclouds.openstack.nova.v2_0.domain.KeyPair; -import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ImageInZone; -import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndName; - -import com.google.common.base.Predicate; -import com.google.common.base.Supplier; -import com.google.common.cache.LoadingCache; -import com.google.common.collect.Iterables; - -/** - * - * @author Adrian Cole - */ -public class TryStackNovaServiceAdapter extends NovaComputeServiceAdapter { - - @Inject - public TryStackNovaServiceAdapter(NovaApi novaApi, @Zone Supplier> zoneIds, - RemoveFloatingIpFromNodeAndDeallocate removeFloatingIpFromNodeAndDeallocate, LoadingCache keyPairCache) { - super(novaApi, zoneIds, removeFloatingIpFromNodeAndDeallocate, keyPairCache); - } - - @Override - public Iterable listImages() { - return Iterables.filter(super.listImages(), new Predicate() { - - @Override - public boolean apply(ImageInZone arg0) { - String imageName = arg0.getImage().getName(); - return imageName.indexOf("kernel") == -1; - } - - @Override - public String toString() { - return "notKernel"; - } - }); - } -} diff --git a/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/config/TryStackNovaServiceContextModule.java b/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/config/TryStackNovaServiceContextModule.java deleted file mode 100644 index e969b134ca..0000000000 --- a/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/config/TryStackNovaServiceContextModule.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.config; - -import org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter; -import org.jclouds.openstack.nova.v2_0.compute.config.NovaComputeServiceContextModule; -import org.jclouds.trystack.nova.TryStackNovaServiceAdapter; - -/** - * - * @author Adrian Cole - */ -public class TryStackNovaServiceContextModule extends NovaComputeServiceContextModule { - - @Override - protected void configure() { - super.configure(); - bind(NovaComputeServiceAdapter.class).to(TryStackNovaServiceAdapter.class); - } -} diff --git a/providers/trystack-nova/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/trystack-nova/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata deleted file mode 100644 index a74ec9d803..0000000000 --- a/providers/trystack-nova/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata +++ /dev/null @@ -1 +0,0 @@ -org.jclouds.trystack.nova.TryStackNovaProviderMetadata diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadataExpectTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadataExpectTest.java deleted file mode 100644 index 83a356b470..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadataExpectTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova; - -import static org.testng.Assert.assertEquals; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.nova.v2_0.NovaApi; -import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * This test ensures that the wiring in {@link TryStackNovaProviderMetadata} is correct. - * - * @author Adrian Cole - */ -@Test(groups = "unit", testName = "TryStackNovaProviderMetadataExpectTest") -public class TryStackNovaProviderMetadataExpectTest extends BaseNovaApiExpectTest { - - public TryStackNovaProviderMetadataExpectTest() { - this.provider = "trystack-nova"; - this.identity = "demo:demo"; - this.credential = "password"; - } - - public void testCanGetConfiguredZones() { - - HttpRequest authenticate = HttpRequest.builder().method("POST") - .endpoint("https://nova-api.trystack.org:5443/v2.0/tokens") - .addHeader("Accept", "application/json") - .payload(payloadFromStringWithContentType( - "{\"auth\":{\"passwordCredentials\":{\"username\":\"demo\",\"password\":\"password\"},\"tenantName\":\"demo\"}}" - , "application/json")).build(); - - - HttpResponse authenticationResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResourceWithContentType("/access_trystack.json", "application/json")).build(); - - NovaApi whenNovaRegionExists = requestSendsResponse(authenticate, authenticationResponse); - - assertEquals(whenNovaRegionExists.getConfiguredZones(), ImmutableSet.of("RegionOne")); - - } - -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/TryStackNovaProviderTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/TryStackNovaProviderTest.java deleted file mode 100644 index 7d9ffa2db3..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/TryStackNovaProviderTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not computee this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * - * - * ==================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not computee this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ -package org.jclouds.trystack.nova; - -import org.jclouds.openstack.nova.v2_0.NovaApiMetadata; -import org.jclouds.providers.internal.BaseProviderMetadataTest; -import org.testng.annotations.Test; - -/** - * - * @author Adrian Cole - */ -@Test(groups = "unit", testName = "TryStackNovaProviderTest") -public class TryStackNovaProviderTest extends BaseProviderMetadataTest { - - public TryStackNovaProviderTest() { - super(new TryStackNovaProviderMetadata(), new NovaApiMetadata()); - } -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/compute/TryStackNovaComputeServiceLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/compute/TryStackNovaComputeServiceLiveTest.java deleted file mode 100644 index b77820fd77..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/compute/TryStackNovaComputeServiceLiveTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not computee this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.compute; - -import org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceLiveTest; -import org.testng.annotations.Test; - -/** - * - * @author Adrian Cole - */ -@Test(groups = "live", singleThreaded = true, testName = "TryStackNovaComputeServiceLiveTest") -public class TryStackNovaComputeServiceLiveTest extends NovaComputeServiceLiveTest { - - public TryStackNovaComputeServiceLiveTest() { - provider = "trystack-nova"; - } -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/compute/TryStackNovaTemplateBuilderLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/compute/TryStackNovaTemplateBuilderLiveTest.java deleted file mode 100644 index 4f8c3b9e7e..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/compute/TryStackNovaTemplateBuilderLiveTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not computee this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.compute; - -import static org.jclouds.compute.util.ComputeServiceUtils.getCores; -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.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; - -/** - * - * @author Adrian Cole - */ -@Test(groups = "live", singleThreaded = true, testName = "TryStackNovaTemplateBuilderLiveTest") -public class TryStackNovaTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { - - public TryStackNovaTemplateBuilderLiveTest() { - provider = "trystack-nova"; - } - - @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("^11.*")) && input.is64Bit; - default: - return false; - } - } - - }); - } - - @Test - public void testTemplateBuilder() { - Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); - assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); - assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.10"); - assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); - assertEquals(defaultTemplate.getImage().getName(), "oneiric-server-cloudimg-amd64"); - assertEquals(defaultTemplate.getImage().getDefaultCredentials().getUser(), "ubuntu"); - assertEquals(defaultTemplate.getLocation().getId(), "RegionOne"); - assertEquals(defaultTemplate.getOptions().as(NovaTemplateOptions.class).shouldAutoAssignFloatingIp(), false); - assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); - } - - @Override - protected Set getIso3166Codes() { - return ImmutableSet. of("US-CA"); - } -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaFlavorApiLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaFlavorApiLiveTest.java deleted file mode 100644 index c1e90235bb..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaFlavorApiLiveTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.features; - -import org.jclouds.openstack.nova.v2_0.features.FlavorApiLiveTest; -import org.testng.annotations.Test; - -/** - * - * @author Adrian Cole - */ -@Test(groups = "live", testName = "TryStackNovaFlavorApiLiveTest") -public class TryStackNovaFlavorApiLiveTest extends FlavorApiLiveTest { - public TryStackNovaFlavorApiLiveTest() { - provider = "trystack-nova"; - } - -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaImageApiLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaImageApiLiveTest.java deleted file mode 100644 index d3eed3ea65..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaImageApiLiveTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.features; - -import org.jclouds.openstack.nova.v2_0.features.ImageApiLiveTest; -import org.testng.annotations.Test; - -/** - * - * @author Michael Arnold - */ -@Test(groups = "live", testName = "TryStackNovaImageApiLiveTest") -public class TryStackNovaImageApiLiveTest extends ImageApiLiveTest { - public TryStackNovaImageApiLiveTest() { - provider = "trystack-nova"; - } -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaKeyPairApiLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaKeyPairApiLiveTest.java deleted file mode 100644 index 3a456d0bed..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaKeyPairApiLiveTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.features; - -import org.jclouds.openstack.nova.v2_0.extensions.KeyPairApiLiveTest; -import org.testng.annotations.Test; - -/** - * - * @author Michael Arnold - */ -@Test(groups = "live", testName = "TryStackNovaKeyPairApiLiveTest") -public class TryStackNovaKeyPairApiLiveTest extends KeyPairApiLiveTest { - public TryStackNovaKeyPairApiLiveTest() { - provider = "trystack-nova"; - } - -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaSecurityGroupApiLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaSecurityGroupApiLiveTest.java deleted file mode 100644 index c78d169889..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaSecurityGroupApiLiveTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.features; - -import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApiLiveTest; -import org.testng.annotations.Test; - -/** - * - * @author Michael Arnold - */ -@Test(groups = "live", testName = "TryStackNovaSecurityGroupApiLiveTest") -public class TryStackNovaSecurityGroupApiLiveTest extends SecurityGroupApiLiveTest { - public TryStackNovaSecurityGroupApiLiveTest() { - provider = "trystack-nova"; - } -} diff --git a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaServerApiLiveTest.java b/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaServerApiLiveTest.java deleted file mode 100644 index f63359c823..0000000000 --- a/providers/trystack-nova/src/test/java/org/jclouds/trystack/nova/features/TryStackNovaServerApiLiveTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.trystack.nova.features; - -import org.jclouds.openstack.nova.v2_0.features.ServerApiLiveTest; -import org.testng.annotations.Test; - -/** - * - * @author Adrian Cole - */ -@Test(groups = "live", testName = "TryStackNovaServerApiLiveTest") -public class TryStackNovaServerApiLiveTest extends ServerApiLiveTest { - public TryStackNovaServerApiLiveTest() { - provider = "trystack-nova"; - } - -} diff --git a/providers/trystack-nova/src/test/resources/access_trystack.json b/providers/trystack-nova/src/test/resources/access_trystack.json deleted file mode 100644 index 27844f2fd8..0000000000 --- a/providers/trystack-nova/src/test/resources/access_trystack.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "access": { - "token": { - "expires": "2012-03-23T21:44:09", - "id": "Auth_4f173437e4b013bee56d1007", - "tenant": { - "id": "3456", - "name": "508151008" - } - }, - "serviceCatalog": [{ - "endpoints": [{ - "adminURL": "https://nova-api.trystack.org:9774/v1.1/3456", - "region": "RegionOne", - "internalURL": "https://nova-api.trystack.org:9774/v1.1/3456", - "publicURL": "https://nova-api.trystack.org:9774/v1.1/3456" - }], - "type": "compute", - "name": "nova" - }, { - "endpoints": [{ - "adminURL": "https://GLANCE_API_IS_NOT_DISCLOSED/v1.1/3456", - "region": "RegionOne", - "internalURL": "https://GLANCE_API_IS_NOT_DISCLOSED/v1.1/3456", - "publicURL": "https://GLANCE_API_IS_NOT_DISCLOSED/v1.1/3456" - }], - "type": "image", - "name": "glance" - }, { - "endpoints": [{ - "adminURL": "https://nova-api.trystack.org:5443/v2.0", - "region": "RegionOne", - "internalURL": "https://keystone.thefreecloud.org:5000/v2.0", - "publicURL": "https://keystone.thefreecloud.org:5000/v2.0" - }], - "type": "identity", - "name": "keystone" - }], - "user": { - "id": "43", - "roles": [{ - "tenantId": "3456", - "id": "2", - "name": "Member" - }], - "name": "508151008" - } - } -} \ No newline at end of file