switch to using URISupplier, remove un-needed vars

This commit is contained in:
danikov 2012-02-29 11:27:49 +00:00
parent a74a79fe17
commit 8bca943086
1 changed files with 7 additions and 11 deletions

View File

@ -18,7 +18,6 @@
*/ */
package org.jclouds.vcloud.director.v1_5.internal; package org.jclouds.vcloud.director.v1_5.internal;
import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.compute.BaseVersionedServiceLiveTest; import org.jclouds.compute.BaseVersionedServiceLiveTest;
@ -29,6 +28,7 @@ import org.jclouds.rest.RestContextFactory;
import org.jclouds.sshj.config.SshjSshClientModule; import org.jclouds.sshj.config.SshjSshClientModule;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorAsyncClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorAsyncClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.domain.URISupplier;
import org.jclouds.vcloud.director.v1_5.predicates.TaskSuccess; import org.jclouds.vcloud.director.v1_5.predicates.TaskSuccess;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -51,24 +51,21 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
} }
protected String catalogName; protected String catalogName;
protected String mediaId;
protected String vAppTemplateId; protected String vAppTemplateId;
protected String networkId; protected String networkId;
protected String vDCId; protected String vdcId;
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties overrides= super.setupProperties(); Properties overrides= super.setupProperties();
if (catalogName != null) if (catalogName != null)
overrides.setProperty(provider + ".catalog-name", catalogName); overrides.setProperty(provider + ".catalog-name", catalogName);
if (mediaId != null)
overrides.setProperty(provider + ".media-id", mediaId);
if (vAppTemplateId != null) if (vAppTemplateId != null)
overrides.setProperty(provider + ".vapptemplate-id", vAppTemplateId); overrides.setProperty(provider + ".vapptemplate-id", vAppTemplateId);
if (networkId != null) if (networkId != null)
overrides.setProperty(provider + ".network-id", networkId); overrides.setProperty(provider + ".network-id", networkId);
if (vDCId != null) if (vdcId != null)
overrides.setProperty(provider + ".vcd-id", vDCId); overrides.setProperty(provider + ".vdc-id", vdcId);
return overrides; return overrides;
} }
@ -77,7 +74,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
public abstract void setupRequiredClients(); public abstract void setupRequiredClients();
/** Injected by {@link #setupContext} */ /** Injected by {@link #setupContext} */
public Predicate<URI> retryTaskSuccess; public Predicate<URISupplier> retryTaskSuccess;
@Override @Override
@BeforeClass(groups = { "live" }) @BeforeClass(groups = { "live" })
@ -85,10 +82,9 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
super.setupCredentials(); super.setupCredentials();
catalogName = System.getProperty("test." + provider + ".catalog-name"); catalogName = System.getProperty("test." + provider + ".catalog-name");
mediaId = System.getProperty("test." + provider + ".media-id");
vAppTemplateId = System.getProperty("test." + provider + ".vapptemplate-id"); vAppTemplateId = System.getProperty("test." + provider + ".vapptemplate-id");
networkId = System.getProperty("test." + provider + ".network-id"); networkId = System.getProperty("test." + provider + ".network-id");
vDCId = System.getProperty("test." + provider + ".vdc-id"); vdcId = System.getProperty("test." + provider + ".vdc-id");
} }
protected RestContext<VCloudDirectorClient, VCloudDirectorAsyncClient> context; protected RestContext<VCloudDirectorClient, VCloudDirectorAsyncClient> context;
@ -103,7 +99,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
ImmutableSet.<Module> of(new Log4JLoggingModule(), new SshjSshClientModule()), overrides); ImmutableSet.<Module> of(new Log4JLoggingModule(), new SshjSshClientModule()), overrides);
TaskSuccess taskSuccess = context.utils().injector().getInstance(TaskSuccess.class); TaskSuccess taskSuccess = context.utils().injector().getInstance(TaskSuccess.class);
retryTaskSuccess = new RetryablePredicate<URI>(taskSuccess, 1000L); retryTaskSuccess = new RetryablePredicate<URISupplier>(taskSuccess, 1000L);
} }
protected void tearDown() { protected void tearDown() {