remove unused code, replace TODOs with task checking

This commit is contained in:
danikov 2012-02-23 13:47:11 +00:00
parent ae308cb1fd
commit 1387d9f704
1 changed files with 10 additions and 11 deletions

View File

@ -34,6 +34,7 @@ import static org.testng.Assert.fail;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.domain.Catalog; import org.jclouds.vcloud.director.v1_5.domain.Catalog;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
import org.jclouds.vcloud.director.v1_5.domain.Checks;
import org.jclouds.vcloud.director.v1_5.domain.Error; import org.jclouds.vcloud.director.v1_5.domain.Error;
import org.jclouds.vcloud.director.v1_5.domain.Metadata; 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.MetadataEntry;
@ -63,7 +64,6 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
private CatalogClient catalogClient; private CatalogClient catalogClient;
private QueryClient queryClient; private QueryClient queryClient;
private MediaClient mediaClient;
/* /*
* Shared state between dependant tests. * Shared state between dependant tests.
@ -81,7 +81,6 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public void setupRequiredClients() { public void setupRequiredClients() {
catalogClient = context.getApi().getCatalogClient(); catalogClient = context.getApi().getCatalogClient();
queryClient = context.getApi().getQueryClient(); queryClient = context.getApi().getQueryClient();
mediaClient = context.getApi().getMediaClient();
} }
private Metadata catalogItemMetadata; private Metadata catalogItemMetadata;
@ -227,9 +226,9 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Task setCatalogItemMetadataValue = catalogClient.setCatalogItemMetadataValue(catalogItemRef, "KEY", newMetadataValue); Task setCatalogItemMetadataValue = catalogClient.setCatalogItemMetadataValue(catalogItemRef, "KEY", newMetadataValue);
checkTask(setCatalogItemMetadataValue); checkTask(setCatalogItemMetadataValue);
// TODO requires code from dan to be merged Checks.checkTask(setCatalogItemMetadataValue);
// assertTrue(taskTester.apply(setCatalogItemMetadataValue.getHref()), assertTrue(retryTaskSuccess.apply(setCatalogItemMetadataValue.getHref()),
// String.format(TASK_COMPLETE_TIMELY, "setCatalogItemMetadataValue")); String.format(TASK_COMPLETE_TIMELY, "setCatalogItemMetadataValue"));
MetadataValue updatedMetadataValue = catalogClient.getCatalogItemMetadataValue(catalogItemRef, "KEY"); MetadataValue updatedMetadataValue = catalogClient.getCatalogItemMetadataValue(catalogItemRef, "KEY");
assertEquals(updatedMetadataValue.getValue(), newMetadataValue.getValue(), assertEquals(updatedMetadataValue.getValue(), newMetadataValue.getValue(),
@ -241,9 +240,9 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public void testDeleteCatalogItemMetadataValue() { public void testDeleteCatalogItemMetadataValue() {
Task deleteCatalogItemMetadataValue = catalogClient.deleteCatalogItemMetadataValue(catalogItemRef, "KEY"); Task deleteCatalogItemMetadataValue = catalogClient.deleteCatalogItemMetadataValue(catalogItemRef, "KEY");
checkTask(deleteCatalogItemMetadataValue); checkTask(deleteCatalogItemMetadataValue);
// TODO requires code from dan to be merged Checks.checkTask(deleteCatalogItemMetadataValue);
// assertTrue(taskTester.apply(deleteCatalogItemMetadataValue.getHref()), assertTrue(retryTaskSuccess.apply(deleteCatalogItemMetadataValue.getHref()),
// String.format(TASK_COMPLETE_TIMELY, "deleteCatalogItemMetadataValue")); String.format(TASK_COMPLETE_TIMELY, "deleteCatalogItemMetadataValue"));
try { try {
catalogClient.getCatalogItemMetadataValue(catalogItemRef, "KEY"); catalogClient.getCatalogItemMetadataValue(catalogItemRef, "KEY");
fail("The CatalogItem MetadataValue for KEY should have been deleted"); fail("The CatalogItem MetadataValue for KEY should have been deleted");
@ -269,8 +268,8 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
deleteAllCatalogItemMetadata(catalogItemRef); deleteAllCatalogItemMetadata(catalogItemRef);
Metadata newMetadata = Metadata.builder().entry(MetadataEntry.builder().entry("KEY", "VALUE").build()).build(); Metadata newMetadata = Metadata.builder().entry(MetadataEntry.builder().entry("KEY", "VALUE").build()).build();
Task mergeCatalogItemMetadata = catalogClient.mergeCatalogItemMetadata(catalogItemRef, newMetadata); Task mergeCatalogItemMetadata = catalogClient.mergeCatalogItemMetadata(catalogItemRef, newMetadata);
// TODO requires code from dan to be merged Checks.checkTask(mergeCatalogItemMetadata);
// assertTrue(taskTester.apply(mergeCatalogItemMetadata.getHref()), assertTrue(retryTaskSuccess.apply(mergeCatalogItemMetadata.getHref()),
// String.format(TASK_COMPLETE_TIMELY, "mergeCatalogItemMetadata")); String.format(TASK_COMPLETE_TIMELY, "mergeCatalogItemMetadata"));
} }
} }