From 8d317d67b5dfc47f7c944bd1da663dca33c4584e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 00:21:51 -0700 Subject: [PATCH] Issue 590:Support StratoGen vCloud provider --- README.txt | 2 +- allcompute/pom.xml | 5 + core/src/main/resources/rest.properties | 3 + providers/pom.xml | 1 + providers/stratogen-vcloud-mycloud/pom.xml | 164 +++++++++++++++++ .../StratoGenVCloudMyCloudContextBuilder.java | 51 ++++++ ...ratoGenVCloudMyCloudPropertiesBuilder.java | 47 +++++ ...tratoGenVCloudMyCloudProviderMetadata.java | 116 ++++++++++++ ...oudMyCloudComputeServiceContextModule.java | 38 ++++ ...tratoGenVCloudMyCloudRestClientModule.java | 34 ++++ .../org.jclouds.providers.ProviderMetadata | 1 + ...dStratoGenVCloudMyCloudClientLiveTest.java | 35 ++++ .../StratoGenVCloudMyCloudProviderTest.java | 35 ++++ ...enVCloudMyCloudComputeServiceLiveTest.java | 70 ++++++++ ...nVCloudMyCloudTemplateBuilderLiveTest.java | 77 ++++++++ ...GenVCloudMyCloudCatalogClientLiveTest.java | 35 ++++ ...GenVCloudMyCloudNetworkClientLiveTest.java | 35 ++++ ...ratoGenVCloudMyCloudOrgClientLiveTest.java | 35 ++++ ...atoGenVCloudMyCloudTaskClientLiveTest.java | 35 ++++ ...atoGenVCloudMyCloudVAppClientLiveTest.java | 35 ++++ ...loudMyCloudVAppTemplateClientLiveTest.java | 35 ++++ ...ratoGenVCloudMyCloudVDCClientLiveTest.java | 35 ++++ ...tratoGenVCloudMyCloudVmClientLiveTest.java | 39 ++++ .../src/test/resources/log4j.xml | 170 ++++++++++++++++++ 24 files changed, 1132 insertions(+), 1 deletion(-) create mode 100644 providers/stratogen-vcloud-mycloud/pom.xml create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml diff --git a/README.txt b/README.txt index 96ac14d007..89c1dd96a5 100644 --- a/README.txt +++ b/README.txt @@ -33,7 +33,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers-us, stub (in-memory), de cloudservers-uk, vcloud (generic), ec2 (generic), byon, nova, trmk-ecloud, trmk-vcloudexpress, eucalyptus (generic), cloudsigma-zrh, elasticstack(generic), bluelock-vcloud-vcenterprise, - bluelock-vcloud-zone01, + bluelock-vcloud-zone01, stratogen-vcloud-mycloud, slicehost, eucalyptus-partnercloud-ec2, elastichosts-lon-p (Peer 1), elastichosts-sat-p (Peer 1), elastichosts-lon-b (BlueSquare), openhosting-east1, serverlove-z1-man, skalicloud-sdg-my diff --git a/allcompute/pom.xml b/allcompute/pom.xml index 465001759a..f1a130039f 100644 --- a/allcompute/pom.xml +++ b/allcompute/pom.xml @@ -114,6 +114,11 @@ bluelock-vcloud-zone01 ${project.version} + + org.jclouds.provider + stratogen-vcloud-mycloud + ${project.version} + org.jclouds.provider gogrid diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties index 910dcf59cc..c4167f6770 100644 --- a/core/src/main/resources/rest.properties +++ b/core/src/main/resources/rest.properties @@ -104,6 +104,9 @@ bluelock-vcloud-vcenterprise.propertiesbuilder=org.jclouds.bluelock.vcloud.vcent bluelock-vcloud-zone01.contextbuilder=org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01ContextBuilder bluelock-vcloud-zone01.propertiesbuilder=org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01PropertiesBuilder +stratogen-vcloud-mycloud.contextbuilder=org.jclouds.stratogen.vcloud.mycloud.StratoGenVCloudMyCloudContextBuilder +stratogen-vcloud-mycloud.propertiesbuilder=org.jclouds.stratogen.vcloud.mycloud.StratoGenVCloudMyCloudPropertiesBuilder + gogrid.propertiesbuilder=org.jclouds.gogrid.GoGridPropertiesBuilder gogrid.contextbuilder=org.jclouds.gogrid.GoGridContextBuilder diff --git a/providers/pom.xml b/providers/pom.xml index 3b29719485..91ba5d6a15 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -56,6 +56,7 @@ bluelock-vcdirector bluelock-vcloud-vcenterprise bluelock-vcloud-zone01 + stratogen-vcloud-mycloud trmk-ecloud trmk-vcloudexpress elastichosts-lon-p diff --git a/providers/stratogen-vcloud-mycloud/pom.xml b/providers/stratogen-vcloud-mycloud/pom.xml new file mode 100644 index 0000000000..445159ddc9 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/pom.xml @@ -0,0 +1,164 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + stratogen-vcloud-mycloud + jclouds StratoGen vCloud MyCloud provider + vCloud implementation targeted to StratoGen vCloud MyCloud + bundle + + + https://mycloud.stratogen.net/api + 1.0 + FIXME_IDENTITY + FIXME_CREDENTIAL + + + + + org.jclouds.api + vcloud + ${project.version} + + + org.jclouds.common + vcloud-common + ${project.version} + test-jar + test + + + org.jclouds.api + vcloud + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-compute + ${project.version} + test-jar + test + + + org.jclouds.driver + jclouds-log4j + ${project.version} + test + + + org.jclouds.driver + jclouds-jsch + ${project.version} + test + + + com.jcraft + jsch + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.stratogen-vcloud-mycloud.endpoint + ${test.stratogen-vcloud-mycloud.endpoint} + + + test.stratogen-vcloud-mycloud.apiversion + ${test.stratogen-vcloud-mycloud.apiversion} + + + test.stratogen-vcloud-mycloud.identity + ${test.stratogen-vcloud-mycloud.identity} + + + test.stratogen-vcloud-mycloud.credential + ${test.stratogen-vcloud-mycloud.credential} + + + + + + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + + ${project.artifactId} + org.jclouds.stratogen.vcloud.mycloud.*;version="${project.version}" + org.jclouds.*;version="${project.version}",* + + + + + + + + diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java new file mode 100644 index 0000000000..e8a9ec9010 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java @@ -0,0 +1,51 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud; + +import java.util.List; +import java.util.Properties; + +import org.jclouds.stratogen.vcloud.mycloud.config.StratoGenVCloudMyCloudComputeServiceContextModule; +import org.jclouds.stratogen.vcloud.mycloud.config.StratoGenVCloudMyCloudRestClientModule; +import org.jclouds.vcloud.VCloudContextBuilder; + +import com.google.inject.Module; + +/** + * {@inheritDoc} + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudContextBuilder extends VCloudContextBuilder { + + public StratoGenVCloudMyCloudContextBuilder(Properties props) { + super(props); + } + + @Override + protected void addContextModule(List modules) { + modules.add(new StratoGenVCloudMyCloudComputeServiceContextModule()); + } + + @Override + protected void addClientModule(List modules) { + modules.add(new StratoGenVCloudMyCloudRestClientModule()); + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java new file mode 100644 index 0000000000..692c2d62d4 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; +import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK; + +import java.util.Properties; + +import org.jclouds.vcloud.VCloudPropertiesBuilder; + +/** + * Builds properties used in stratogen VCloud Clients + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudPropertiesBuilder extends VCloudPropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_ISO3166_CODES, "GB"); + properties.setProperty(PROPERTY_ENDPOINT, "https://mycloud.stratogen.net/api"); + properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, "Direct Internet"); + return properties; + } + + public StratoGenVCloudMyCloudPropertiesBuilder(Properties properties) { + super(properties); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java new file mode 100644 index 0000000000..286767f073 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; +import org.jclouds.providers.ProviderMetadata; + +/** + * Implementation of {@link org.jclouds.types.ProviderMetadata} for StratoGen VMware hosting + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "stratogen-vcloud-mycloud"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return ProviderMetadata.COMPUTE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "StratoGen VMware hosting"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "User at Organization (user@org)"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Password"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.stratogen.net"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://mycloud.stratogen.net/cloud/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://www.vmware.com/support/pubs/vcd_pubs.html"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getLinkedServices() { + return ImmutableSet.of("stratogen-vcloud-mycloud"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("GB"); + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java new file mode 100644 index 0000000000..e08be2a180 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java @@ -0,0 +1,38 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.config; + +import org.jclouds.compute.options.TemplateOptions; +import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule; +import org.jclouds.vcloud.compute.options.VCloudTemplateOptions; +import org.jclouds.vcloud.domain.network.IpAddressAllocationMode; + +import com.google.inject.Injector; + +/** + * per docs, we are to use pool mode. + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudComputeServiceContextModule extends VCloudComputeServiceContextModule { + @Override + protected TemplateOptions provideTemplateOptions(Injector injector, TemplateOptions options) { + return options.as(VCloudTemplateOptions.class).ipAddressAllocationMode(IpAddressAllocationMode.POOL); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java new file mode 100644 index 0000000000..0572b42022 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.config; + +import org.jclouds.http.RequiresHttp; +import org.jclouds.rest.ConfiguresRestClient; +import org.jclouds.vcloud.config.VCloudRestClientModule; + +/** + * Configures the VCloud authentication service connection, including logging and http transport. + * + * @author Adrian Cole + */ +@RequiresHttp +@ConfiguresRestClient +public class StratoGenVCloudMyCloudRestClientModule extends VCloudRestClientModule { + +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..63dd94140e --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.stratogen.vcloud.mycloud.StratoGenVCloudMyCloudProviderMetadata diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java new file mode 100644 index 0000000000..4503b9b080 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud; + +import org.jclouds.vcloud.DeprecatedVCloudClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Deprecated +@Test(groups = "live", singleThreaded = true, testName = "DeprecatedStratoGenVCloudMyCloudClientLiveTest") +public class DeprecatedStratoGenVCloudMyCloudClientLiveTest extends DeprecatedVCloudClientLiveTest { + public DeprecatedStratoGenVCloudMyCloudClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java new file mode 100644 index 0000000000..477d09eb4d --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "unit", testName = "StratoGenVCloudMyCloudProviderTest") +public class StratoGenVCloudMyCloudProviderTest extends BaseProviderMetadataTest { + + public StratoGenVCloudMyCloudProviderTest() { + super(new StratoGenVCloudMyCloudProviderMetadata(), ProviderMetadata.COMPUTE_TYPE); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java new file mode 100644 index 0000000000..16ad0f7f92 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java @@ -0,0 +1,70 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import org.jclouds.compute.domain.Image; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.TemplateBuilder; +import org.jclouds.compute.predicates.OperatingSystemPredicates; +import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudComputeServiceLiveTest") +public class StratoGenVCloudMyCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest { + public StratoGenVCloudMyCloudComputeServiceLiveTest() { + provider = "stratogen-vcloud-mycloud"; + // vcloud requires instantiate before deploy, which takes longer than 30 seconds + nonBlockDurationSeconds = 300; + } + + @Override + public void setServiceDefaults() { + group = "director"; + } + + @Test + public void testTemplateBuilder() { + Template defaultTemplate = client.templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assert OperatingSystemPredicates.supportsApt().apply(defaultTemplate.getImage().getOperatingSystem()); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getDescription(), "Ubuntu Linux (64-bit)"); + assert defaultTemplate.getLocation().getId() != null : defaultTemplate.getLocation(); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + System.out.println(defaultTemplate.getHardware()); + } + + @Override + protected Template buildTemplate(TemplateBuilder templateBuilder) { + Template template = super.buildTemplate(templateBuilder); + Image image = template.getImage(); + assert image.getDefaultCredentials().credential != null : image; + return template; + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java new file mode 100644 index 0000000000..361ec1113e --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java @@ -0,0 +1,77 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.util.Set; + +import org.jclouds.compute.BaseTemplateBuilderLiveTest; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.OsFamilyVersion64Bit; +import org.jclouds.compute.domain.Template; +import org.testng.annotations.Test; + +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableSet; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "StratoGenVCloudMyCloudTemplateBuilderLiveTest") +public class StratoGenVCloudMyCloudTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { + + public StratoGenVCloudMyCloudTemplateBuilderLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } + + @Override + protected Predicate defineUnsupportedOperatingSystems() { + return new Predicate() { + + @Override + public boolean apply(OsFamilyVersion64Bit input) { + switch (input.family) { + case UBUNTU: + return !input.version.equals("") || !input.is64Bit; + default: + return true; + } + } + + }; + } + + @Override + public void testDefaultTemplateBuilder() throws IOException { + Template defaultTemplate = context.getComputeService().templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), ""); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + } + + @Override + protected Set getIso3166Codes() { + return ImmutableSet. of("GB"); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java new file mode 100644 index 0000000000..42b7b04017 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.CatalogClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudCatalogClientLiveTest") +public class StratoGenVCloudMyCloudCatalogClientLiveTest extends CatalogClientLiveTest { + + public StratoGenVCloudMyCloudCatalogClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java new file mode 100644 index 0000000000..a74a0efa2f --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.NetworkClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudNetworkClientLiveTest") +public class StratoGenVCloudMyCloudNetworkClientLiveTest extends NetworkClientLiveTest { + + public StratoGenVCloudMyCloudNetworkClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java new file mode 100644 index 0000000000..e000259167 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.OrgClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudOrgClientLiveTest") +public class StratoGenVCloudMyCloudOrgClientLiveTest extends OrgClientLiveTest { + + public StratoGenVCloudMyCloudOrgClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java new file mode 100644 index 0000000000..e6b54053c2 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.TaskClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudTaskClientLiveTest") +public class StratoGenVCloudMyCloudTaskClientLiveTest extends TaskClientLiveTest { + + public StratoGenVCloudMyCloudTaskClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java new file mode 100644 index 0000000000..58eb39ec8a --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VAppClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVAppClientLiveTest") +public class StratoGenVCloudMyCloudVAppClientLiveTest extends VAppClientLiveTest { + + public StratoGenVCloudMyCloudVAppClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java new file mode 100644 index 0000000000..f3c36da6f9 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VAppTemplateClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVAppTemplateClientLiveTest") +public class StratoGenVCloudMyCloudVAppTemplateClientLiveTest extends VAppTemplateClientLiveTest { + + public StratoGenVCloudMyCloudVAppTemplateClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java new file mode 100644 index 0000000000..8ee2715b3c --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VDCClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVDCClientLiveTest") +public class StratoGenVCloudMyCloudVDCClientLiveTest extends VDCClientLiveTest { + + public StratoGenVCloudMyCloudVDCClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java new file mode 100644 index 0000000000..9a7319374f --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java @@ -0,0 +1,39 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VmClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVmClientLiveTest") +public class StratoGenVCloudMyCloudVmClientLiveTest extends VmClientLiveTest { + + public StratoGenVCloudMyCloudVmClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } + + protected void checkApiOutput(String apiOutput) { + checkApiOutput1_0_1(apiOutput); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml b/providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml new file mode 100644 index 0000000000..c1e74e57ff --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +