diff --git a/labs/vcloud-director/pom.xml b/labs/vcloud-director/pom.xml index a813091aa9..5cf8bca690 100644 --- a/labs/vcloud-director/pom.xml +++ b/labs/vcloud-director/pom.xml @@ -42,6 +42,11 @@ + + + + + @@ -109,6 +114,11 @@ ${test.vcloud-director.image-id} ${test.vcloud-director.image.login-user} ${test.vcloud-director.image.authenticate-sudo} + ${test.vcloud-director.catalog-name} + ${test.vcloud-director.media-id} + ${test.vcloud-director.vapptemplate-id} + ${test.vcloud-director.network-id} + ${test.vcloud-director.vdc-id} diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java index 8a4392d78b..ba36539abb 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java @@ -40,14 +40,10 @@ import org.testng.annotations.Test; @Test(groups = { "live", "apitests" }, testName = "NetworkClientLiveTest") public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { - // @Before populate - String networkId = "55a677cf-ab3f-48ae-b880-fab90421980c"; - String catalogId = "9e08c2f6-077a-42ce-bece-d5332e2ebb5c"; - @Test(testName = "GET /network/{id}") public void testWhenResponseIs2xxLoginReturnsValidNetwork() { Reference networkRef = Reference.builder() - .href(URI.create(endpoint + "/network/"+networkId)).build(); + .href(URI.create(endpoint + "/network/" + networkId)).build(); OrgNetwork network = context.getApi().getNetworkClient().getNetwork(networkRef); @@ -77,8 +73,8 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { @Test(testName = "GET /network/{catalog_id}", enabled=false) public void testWhenResponseIs403ForCatalogIdUsedAsNetworkId() { - Reference networkRef = Reference.builder() - .href(URI.create(endpoint + "/network"+catalogId)).build(); + String catalogId = "7212e451-76e1-4631-b2de-ba1dfd8080e4"; + Reference networkRef = Reference.builder().href(URI.create(endpoint + "/network/" + catalogId)).build(); Error expected = Error.builder() .message("This operation is denied.") @@ -120,7 +116,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { @Test(testName = "GET /network/{id}/metadata") public void testWhenResponseIs2xxLoginReturnsValidMetadataList() { Reference networkRef = Reference.builder() - .href(URI.create(endpoint + "/network/"+networkId)).build(); + .href(URI.create(endpoint + "/network/" + networkId)).build(); Metadata expected = context.getApi().getNetworkClient().getMetadata(networkRef); @@ -135,7 +131,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { @Test(testName = "GET /network/{id}/metadata", enabled=false) public void testWhenResponseIs2xxLoginReturnsValidMetadataEntry() { Reference networkRef = Reference.builder() - .href(URI.create(endpoint + "/network/"+networkId)).build(); + .href(URI.create(endpoint + "/network/" + networkId)).build(); MetadataEntry expected = context.getApi().getNetworkClient().getMetadataEntry(networkRef, metadataKey); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/internal/BaseVCloudDirectorClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/internal/BaseVCloudDirectorClientLiveTest.java index 5bd2cb9c4b..c2fd50c785 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/internal/BaseVCloudDirectorClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/internal/BaseVCloudDirectorClientLiveTest.java @@ -35,7 +35,7 @@ import com.google.common.collect.ImmutableSet; import com.google.inject.Module; /** - * Tests behavior of {@code VCloudDirectorClient} + * Tests behavior of {@link VCloudDirectorClient} and acts as parent for other client live tests. * * @author Adrian Cole */ @@ -47,6 +47,22 @@ public class BaseVCloudDirectorClientLiveTest extends BaseVersionedServiceLiveTe protected RestContext context; + protected String catalogName; + protected String mediaId; + protected String vAppTemplateId; + protected String networkId; + protected String vDCId; + + @Override + protected void setupCredentials() { + super.setupCredentials(); + catalogName = System.getProperty("test." + provider + ".catalog-name", "Public"); + mediaId = System.getProperty("test." + provider + ".media-id"); + vAppTemplateId = System.getProperty("test." + provider + ".vapptemplate-id"); + networkId = System.getProperty("test." + provider + ".network-id"); + vDCId = System.getProperty("test." + provider + ".vdc-id"); + } + @BeforeGroups(groups = { "live" }) public void setupClient() { setupCredentials();