remove not-needed properties + vars

This commit is contained in:
danikov 2012-03-23 15:31:51 +00:00
parent 7d4f81a46c
commit d91a8efe70
1 changed files with 9 additions and 16 deletions

View File

@ -112,11 +112,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
protected RestContext<VCloudDirectorClient, VCloudDirectorAsyncClient> 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,11 +184,19 @@ 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.<Reference> 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.<Link> typeEquals(VCloudDirectorMediaType.VDC)).getHref();
if (vdcURI == null)
vdcURI = Iterables.find(thisOrg.getLinks(),
ReferenceTypePredicates.<Link> typeEquals(VCloudDirectorMediaType.VDC)).getHref();
@ -204,14 +205,6 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
networkURI = Iterables.find(thisOrg.getLinks(),
ReferenceTypePredicates.<Link> typeEquals(VCloudDirectorMediaType.ORG_NETWORK)).getHref();
if (Strings.isNullOrEmpty(networkName))
networkName = Iterables.find(thisOrg.getLinks(),
ReferenceTypePredicates.<Link> typeEquals(VCloudDirectorMediaType.ORG_NETWORK)).getName();
if (Strings.isNullOrEmpty(catalogName))
catalogName = Iterables.find(thisOrg.getLinks(),
ReferenceTypePredicates.<Link> typeEquals(VCloudDirectorMediaType.CATALOG)).getName();
// FIXME the URI should be opaque
if (Strings.isNullOrEmpty(catalogId)) {
String uri = Iterables.find(thisOrg.getLinks(),