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 2d81f82e25..eaa51964b9 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 @@ -112,11 +112,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ protected RestContext context; protected Session session; - protected String catalogName; protected String catalogId; - protected String networkName; - protected String userName; - protected URI vAppTemplateURI; protected URI mediaURI; protected URI networkURI; @@ -165,11 +161,8 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ } // TODO change properties to URI, not id - @SuppressWarnings("unchecked") protected void initTestParametersFromPropertiesOrLazyDiscover() { - catalogName = Strings.emptyToNull(System.getProperty("test." + provider + ".catalog-name")); catalogId = Strings.emptyToNull(System.getProperty("test." + provider + ".catalog-id")); - networkName = Strings.emptyToNull(System.getProperty("test." + provider + ".network-name")); String vAppTemplateId = Strings.emptyToNull(System.getProperty("test." + provider + ".vapptemplate-id")); if (vAppTemplateId != null) @@ -191,10 +184,18 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ if (userId != null) userURI = URI.create(endpoint + "/admin/user/" + userId); - if (Iterables.any(Lists.newArrayList(catalogName, vAppTemplateURI, networkURI, vdcURI), Predicates.isNull())) { + if (Iterables.any(Lists.newArrayList(vAppTemplateURI, networkURI, vdcURI), Predicates.isNull())) { Org thisOrg = context.getApi().getOrgClient().getOrg( Iterables.find(context.getApi().getOrgClient().getOrgList().getOrgs(), ReferenceTypePredicates. nameEquals(session.getOrg())).getHref()); + + //TODO: can we create new objects via (admin) operations instead of looking things up? + //TODO: lookup mediaURI, userURI + + // FIXME: lookup vAppTemplate +// if (vAppTemplateURI == null) +// vAppTemplateURI = Iterables.find(context.getApi().getQueryClient().vAppTemplatesReferenceQueryAll(), +// ReferenceTypePredicates. typeEquals(VCloudDirectorMediaType.VDC)).getHref(); if (vdcURI == null) vdcURI = Iterables.find(thisOrg.getLinks(), @@ -204,14 +205,6 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ networkURI = Iterables.find(thisOrg.getLinks(), ReferenceTypePredicates. typeEquals(VCloudDirectorMediaType.ORG_NETWORK)).getHref(); - if (Strings.isNullOrEmpty(networkName)) - networkName = Iterables.find(thisOrg.getLinks(), - ReferenceTypePredicates. typeEquals(VCloudDirectorMediaType.ORG_NETWORK)).getName(); - - if (Strings.isNullOrEmpty(catalogName)) - catalogName = Iterables.find(thisOrg.getLinks(), - ReferenceTypePredicates. typeEquals(VCloudDirectorMediaType.CATALOG)).getName(); - // FIXME the URI should be opaque if (Strings.isNullOrEmpty(catalogId)) { String uri = Iterables.find(thisOrg.getLinks(),