strip out proxying

This commit is contained in:
danikov 2012-02-16 01:00:10 +00:00
parent c57a267dd9
commit f7c35b7e61
2 changed files with 7 additions and 73 deletions

View File

@ -18,14 +18,11 @@
*/ */
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.*; import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkTask;
import static org.jclouds.vcloud.director.v1_5.domain.Checks.*; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.*;
import java.net.URI; import java.net.URI;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
import org.jclouds.vcloud.director.v1_5.domain.OrgList; import org.jclouds.vcloud.director.v1_5.domain.OrgList;
import org.jclouds.vcloud.director.v1_5.domain.Reference; import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.domain.Task;
@ -55,11 +52,11 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
@Test(testName = "GET /tasksList/{id}") @Test(testName = "GET /tasksList/{id}")
public void testGetTaskList() { public void testGetTaskList() {
orgList = getOrgList(); orgList = context.getApi().getOrgClient().getOrgList();
orgRef = Iterables.getFirst(orgList.getOrgs(), null); orgRef = Iterables.getFirst(orgList.getOrgs(), null);
// Call the method being tested // Call the method being tested
taskList = getTaskList(orgRef); taskList = context.getApi().getTaskClient().getTaskList(orgRef);
// NOTE The environment MUST have ... // NOTE The environment MUST have ...
@ -76,7 +73,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
taskUri = Iterables.getFirst(taskList.getTasks(), null).getHref(); taskUri = Iterables.getFirst(taskList.getTasks(), null).getHref();
// Call the method being tested // Call the method being tested
task = getTask(taskUri); task = context.getApi().getTaskClient().getTask(taskUri);
// Check required elements and attributes // Check required elements and attributes
checkTask(task); checkTask(task);
@ -85,6 +82,6 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
@Test(testName = "GET /task/{id}/metadata/", dependsOnMethods = { "testGetTask" }) @Test(testName = "GET /task/{id}/metadata/", dependsOnMethods = { "testGetTask" })
public void testCancelTask() { public void testCancelTask() {
// Call the method being tested // Call the method being tested
cancelTask(taskUri); context.getApi().getTaskClient().cancelTask(taskUri);
} }
} }

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;
@ -28,15 +27,6 @@ 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.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.OrgList;
import org.jclouds.vcloud.director.v1_5.domain.ReferenceType;
import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
import org.jclouds.vcloud.director.v1_5.features.OrgClient;
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
import org.testng.annotations.AfterGroups; import org.testng.annotations.AfterGroups;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -50,7 +40,7 @@ import com.google.inject.Module;
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live") @Test(groups = "live")
public class BaseVCloudDirectorClientLiveTest extends BaseVersionedServiceLiveTest implements OrgClient, TaskClient { public class BaseVCloudDirectorClientLiveTest extends BaseVersionedServiceLiveTest {
public BaseVCloudDirectorClientLiveTest() { public BaseVCloudDirectorClientLiveTest() {
provider = "vcloud-director"; provider = "vcloud-director";
} }
@ -71,57 +61,4 @@ public class BaseVCloudDirectorClientLiveTest extends BaseVersionedServiceLiveTe
context.close(); context.close();
} }
private final OrgClient orgClient = context.getApi().getOrgClient();
private final TaskClient taskClient = context.getApi().getTaskClient();
/*
* Proxying implementations of OrgClient.
*/
/** @see OrgClient#getOrgList() */
@Override
public OrgList getOrgList() {
return orgClient.getOrgList();
}
/** @see OrgClient#getOrg(ReferenceType) */
@Override
public Org getOrg(ReferenceType<?> orgRef) {
return orgClient.getOrg(orgRef);
}
/** @see OrgClient#getOrgMetadata(ReferenceType) */
@Override
public Metadata getOrgMetadata(ReferenceType<?> orgRef) {
return orgClient.getOrgMetadata(orgRef);
}
/** @see OrgClient#getOrgMetadataEntry(ReferenceType, String) */
@Override
public MetadataEntry getOrgMetadataEntry(ReferenceType<?> orgRef, String key) {
return orgClient.getOrgMetadataEntry(orgRef, key);
}
/*
* Proxying implementations of TaskClient.
*/
/** @see TaskClient#getTaskList(ReferenceType) */
@Override
public TasksList getTaskList(ReferenceType<?> orgRef) {
return taskClient.getTaskList(orgRef);
}
/** @see TaskClient#getTask(URI) */
@Override
public Task getTask(URI taskUri) {
return taskClient.getTask(taskUri);
}
/** @see TaskClient#cancelTask(URI */
@Override
public void cancelTask(URI taskUri) {
taskClient.cancelTask(taskUri);
}
} }