From d4713572e47007c9e5120a541bd5acb0007171de Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Mon, 26 Mar 2012 15:14:42 +0100 Subject: [PATCH 1/5] Issue 830: Update API listener - Log timestamp, test name - Get test duration from framework - Uses test description paramater for operation request details - Updated live client tests to use description instead of testName --- .../testng/FormatApiResultsListener.java | 52 +++---- .../features/AdminCatalogClientLiveTest.java | 14 +- .../features/AdminNetworkClientLiveTest.java | 6 +- .../v1_5/features/AdminOrgClientLiveTest.java | 28 ++-- .../features/AdminQueryClientLiveTest.java | 14 +- .../v1_5/features/AdminVdcClientLiveTest.java | 18 +-- .../v1_5/features/CatalogClientLiveTest.java | 24 ++-- .../v1_5/features/GroupClientLiveTest.java | 8 +- .../v1_5/features/MediaClientLiveTest.java | 22 +-- .../v1_5/features/NetworkClientLiveTest.java | 10 +- .../v1_5/features/OrgClientLiveTest.java | 16 +-- .../v1_5/features/QueryClientLiveTest.java | 24 ++-- .../v1_5/features/TaskClientLiveTest.java | 6 +- .../v1_5/features/UploadClientLiveTest.java | 2 +- .../v1_5/features/UserClientLiveTest.java | 10 +- .../v1_5/features/VAppClientLiveTest.java | 128 +++++++++--------- .../features/VAppTemplateClientLiveTest.java | 58 ++++---- .../v1_5/features/VdcClientLiveTest.java | 20 +-- 18 files changed, 221 insertions(+), 239 deletions(-) diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/testng/FormatApiResultsListener.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/testng/FormatApiResultsListener.java index 6abbb96dce..a628c67c57 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/testng/FormatApiResultsListener.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/testng/FormatApiResultsListener.java @@ -18,17 +18,14 @@ */ package org.jclouds.vcloud.director.testng; -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; +import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.testng.ITestContext; -import org.testng.ITestListener; import org.testng.ITestResult; -import org.testng.annotations.Test; +import org.testng.TestListenerAdapter; import com.google.common.base.Joiner; import com.google.common.base.Predicates; @@ -42,20 +39,12 @@ import com.google.common.collect.Iterables; * * @author Adrian Cole */ -public class FormatApiResultsListener implements ITestListener { +public class FormatApiResultsListener extends TestListenerAdapter { public static final Logger logger = LoggerFactory.getLogger("jclouds.vcloud.api"); - public static final Set apis = ImmutableSet.of("admin", "user"); - - private ThreadLocal threadTestStart = new ThreadLocal(); - - @Override - public void onTestStart(ITestResult res) { - if (methodInApiGroup(res)) { - threadTestStart.set(System.currentTimeMillis()); - } - } + private static final SimpleDateFormat timestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + private static final Set apis = ImmutableSet.of("admin", "user"); @Override synchronized public void onTestSuccess(ITestResult res) { @@ -81,24 +70,12 @@ public class FormatApiResultsListener implements ITestListener { } } - @Override - public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) { - } - - @Override - public void onStart(ITestContext arg0) { - } - - @Override - public void onFinish(ITestContext arg0) { - } - private boolean methodInApiGroup(ITestResult res) { return Iterables.any(Arrays.asList(res.getMethod().getGroups()), Predicates.in(apis)); } private String resultForState(ITestResult res, String state) { - return Joiner.on(',').join(getApi(res), getOperation(res), getDuration(), state); + return Joiner.on(',').join(getApi(res), getOperation(res), getStart(res), getTest(res), getDuration(res), state); } private String getApi(ITestResult res) { @@ -106,13 +83,18 @@ public class FormatApiResultsListener implements ITestListener { } private String getOperation(ITestResult res) { - Method method = res.getMethod().getConstructorOrMethod().getMethod(); - Test test = method.getAnnotation(Test.class); - return test != null ? test.testName() : method.getName(); + return res.getMethod().getDescription(); } - private String getDuration() { - Long start = threadTestStart.get(); - return (start == null) ? "" : Long.toString(System.currentTimeMillis() - start); + private String getTest(ITestResult res) { + return res.getName(); + } + + private String getStart(ITestResult res) { + return timestamp.format(res.getStartMillis()); + } + + private String getDuration(ITestResult res) { + return Long.toString(res.getEndMillis() - res.getStartMillis()); } } diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientLiveTest.java index add04a608b..f281480c43 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientLiveTest.java @@ -78,7 +78,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest orgRef = Iterables.getFirst(context.getApi().getOrgClient().getOrgList().getOrgs(), null).toAdminReference(endpoint); } - @Test(testName = "POST /admin/org/{id}/catalogs") + @Test(description = "POST /admin/org/{id}/catalogs") public void testCreateCatalog() { AdminCatalog newCatalog = AdminCatalog.builder() .name(name("Test Catalog ")) @@ -91,7 +91,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest // FIXME: documentation suggests we should wait for a task here } - @Test(testName = "GET /admin/catalog/{id}", + @Test(description = "GET /admin/catalog/{id}", dependsOnMethods = { "testCreateCatalog" }) public void testGetCatalog() { catalog = catalogClient.getCatalog(catalog.getHref()); @@ -99,14 +99,14 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest Checks.checkAdminCatalog(catalog); } - @Test(testName = "GET /admin/catalog/{id}/owner", + @Test(description = "GET /admin/catalog/{id}/owner", dependsOnMethods = { "testGetCatalog" }) public void testGetCatalogOwner() { owner = catalogClient.getOwner(catalog.getHref()); Checks.checkOwner(owner); } - @Test(testName = "PUT /admin/catalog/{id}/owner", + @Test(description = "PUT /admin/catalog/{id}/owner", dependsOnMethods = { "testGetCatalog" }) public void updateCatalogOwner() { User newOwnerUser = UserClientLiveTest.randomTestUser("testUpdateCatalogOwner", context); @@ -133,7 +133,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest } } - @Test(testName = "PUT /admin/catalog/{id}", dependsOnMethods = { "testGetCatalogOwner" }) + @Test(description = "PUT /admin/catalog/{id}", dependsOnMethods = { "testGetCatalogOwner" }) public void testUpdateCatalog() { String oldName = catalog.getName(); String newName = "new "+oldName; @@ -171,7 +171,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest } } - @Test(testName = "POST /admin/catalog/{id}/action/publish", + @Test(description = "POST /admin/catalog/{id}/action/publish", dependsOnMethods = { "testUpdateCatalog" } ) // FIXME: fails with a 403 public void testPublishCatalog() { assertNotNull(catalog, String.format(NOT_NULL_OBJ_FMT, "Catalog")); @@ -189,7 +189,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest CATALOG, "isPublished", true, catalog.isPublished())); } - @Test(testName = "DELETE /admin/catalog/{id}", + @Test(description = "DELETE /admin/catalog/{id}", dependsOnMethods = { "testCreateCatalog" } ) public void testDeleteCatalog() { // assertEquals(catalog.getCatalogItems().getCatalogItems().size(), 0, diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminNetworkClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminNetworkClientLiveTest.java index b51db728c1..3d0532f359 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminNetworkClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminNetworkClientLiveTest.java @@ -71,7 +71,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest networkRef = Reference.builder().href(networkURI).build().toAdminReference(endpoint); } - @Test(testName = "GET /admin/network/{id}") + @Test(description = "GET /admin/network/{id}") public void testGetNetwork() { //TODO: test both org and external networks assertNotNull(networkRef, String.format(OBJ_REQ_LIVE, NETWORK)); @@ -88,7 +88,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest } // TODO: this test is far from exhaustive - @Test(testName = "PUT /admin/network/{id}" ) + @Test(description = "PUT /admin/network/{id}" ) public void testUpdateNetwork() { //TODO: ensure network instanceof OrgNetwork, may require queries assertTrue(network instanceof OrgNetwork, String.format(REF_REQ_LIVE, "OrgNetwork")); @@ -144,7 +144,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest } } - @Test(testName = "POST /admin/network/{id}/action/reset") + @Test(description = "POST /admin/network/{id}/action/reset") public void testResetNetwork() { // TODO assert that network is deployed somehow Task resetNetworkTask = networkClient.resetNetwork(networkRef.getHref()); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientLiveTest.java index def0438b7f..adcdce11d1 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientLiveTest.java @@ -77,21 +77,21 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertNotNull(orgRef, String.format(REF_REQ_LIVE, "admin org")); } - @Test(testName = "GET /admin/org/{id}") + @Test(description = "GET /admin/org/{id}") public void testGetAdminOrg() { AdminOrg adminOrg = orgClient.getOrg(orgRef.getHref()); Checks.checkAdminOrg(adminOrg); } - @Test(testName = "GET /admin/org/{id}/settings/email") + @Test(description = "GET /admin/org/{id}/settings/email") public void testGetEmailSettings() { emailSettings = orgClient.getEmailSettings(orgRef.getHref()); Checks.checkEmailSettings(emailSettings); } - @Test(testName = "PUT /admin/org/{id}/settings/email", + @Test(description = "PUT /admin/org/{id}/settings/email", dependsOnMethods = { "testGetEmailSettings" }) public void testUpdateEmailSettings() { boolean isDefaultSmtpServer = emailSettings.isDefaultSmtpServer(); @@ -159,14 +159,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/org/{id}/settings/general") + @Test(description = "GET /admin/org/{id}/settings/general") public void testGetGeneralSettings() { generalSettings = orgClient.getGeneralSettings(orgRef.getHref()); Checks.checkGeneralSettings(generalSettings); } - @Test(testName = "PUT /admin/org/{id}/settings/general", + @Test(description = "PUT /admin/org/{id}/settings/general", dependsOnMethods = { "testGetGeneralSettings" } ) public void testUpdateGeneralSettings() { // FIXME: canPublishCatalogs does not update @@ -221,21 +221,21 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/org/{id}/settings/ldap") + @Test(description = "GET /admin/org/{id}/settings/ldap") public void testGetLdapSettings() { ldapSettings = orgClient.getLdapSettings(orgRef.getHref()); Checks.checkLdapSettings(ldapSettings); } - @Test(testName = "GET /admin/org/{id}/settings/passwordPolicy") + @Test(description = "GET /admin/org/{id}/settings/passwordPolicy") public void testGetPasswordPolicy() { passwordPolicy = orgClient.getPasswordPolicy(orgRef.getHref()); Checks.checkPasswordPolicySettings(passwordPolicy); } - @Test(testName = "PUT /admin/org/{id}/settings/passwordPolicy", + @Test(description = "PUT /admin/org/{id}/settings/passwordPolicy", dependsOnMethods = { "testGetPasswordPolicy" }) public void testUpdatePasswordPolicy() { boolean accountLockoutEnabled = passwordPolicy.isAccountLockoutEnabled(); @@ -277,14 +277,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/org/{id}/settings/vAppLeaseSettings") + @Test(description = "GET /admin/org/{id}/settings/vAppLeaseSettings") public void testGetVAppLeaseSettings() { vAppLeaseSettings = orgClient.getVAppLeaseSettings(orgRef.getHref()); Checks.checkVAppLeaseSettings(vAppLeaseSettings); } - @Test(testName = "PUT /admin/org/{id}/settings/vAppLeaseSettings", + @Test(description = "PUT /admin/org/{id}/settings/vAppLeaseSettings", dependsOnMethods = { "testGetVAppLeaseSettings" } ) // FIXME: fails with 403 forbidden public void testUpdateVAppLeaseSettings() { boolean deleteOnStorageLeaseExpiration = vAppLeaseSettings.deleteOnStorageLeaseExpiration(); @@ -326,14 +326,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/org/{id}/settings/vAppTemplateLeaseSettings") + @Test(description = "GET /admin/org/{id}/settings/vAppTemplateLeaseSettings") public void testGetVAppTemplateLeaseSettings() { vAppTemplateLeaseSettings = orgClient.getVAppTemplateLeaseSettings(orgRef.getHref()); Checks.checkVAppTemplateLeaseSettings(vAppTemplateLeaseSettings); } - @Test(testName = "PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings", + @Test(description = "PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings", dependsOnMethods = { "testGetVAppTemplateLeaseSettings" }) // FIXME: fails with 403 forbidden public void testUpdateVAppTemplateLeaseSettings() { boolean deleteOnStorageLeaseExpiration = vAppTemplateLeaseSettings.deleteOnStorageLeaseExpiration(); @@ -369,14 +369,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/org/{id}/settings") + @Test(description = "GET /admin/org/{id}/settings") public void testGetSettings() { settings = orgClient.getSettings(orgRef.getHref()); Checks.checkOrgSettings(settings); } - @Test(testName = "PUT /admin/org/{id}/settings", + @Test(description = "PUT /admin/org/{id}/settings", dependsOnMethods = { "testGetEmailSettings" } ) public void testUpdateSettings() throws Exception { String newFromEmailAddress = "test"+random.nextInt(Integer.MAX_VALUE)+"@test.com"; diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminQueryClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminQueryClientLiveTest.java index cf49f5ede7..5496157109 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminQueryClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminQueryClientLiveTest.java @@ -54,7 +54,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { queryClient = context.getApi().getAdminQueryClient(); } - @Test(testName = "GET /admin/groups/query") + @Test(description = "GET /admin/groups/query") public void testQueryAllGroups() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.groupsQueryAll(); @@ -64,7 +64,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/orgs/query") + @Test(description = "GET /admin/orgs/query") public void testQueryAllOrgs() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.orgsQueryAll(); @@ -74,7 +74,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/rights/query") + @Test(description = "GET /admin/rights/query") public void testQueryAllRights() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.rightsQueryAll(); @@ -85,7 +85,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/roles/query") + @Test(description = "GET /admin/roles/query") public void testQueryAllRoles() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.rolesQueryAll(); @@ -102,7 +102,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/strandedUsers/query") + @Test(description = "GET /admin/strandedUsers/query") public void testQueryAllStrandedUsers() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.strandedUsersQueryAll(); @@ -113,7 +113,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/users/query") + @Test(description = "GET /admin/users/query") public void testQueryAllUsers() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.usersQueryAll(); @@ -124,7 +124,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/vdcs/query") + @Test(description = "GET /admin/vdcs/query") public void testQueryAllVdc() { // TODO Ensure there will be at least one record, for asserting result QueryResultRecords resultRecords = queryClient.vdcsQueryAll(); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClientLiveTest.java index 7eb335c44c..9daa1f653e 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClientLiveTest.java @@ -80,7 +80,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/vdc/{id}") + @Test(description = "GET /admin/vdc/{id}") public void testGetVdc() { AdminVdc vdc = vdcClient.getVdc(adminVdcUri); assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC)); @@ -90,7 +90,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "PUT /admin/vdc/{id}", enabled=false) + @Test(description = "PUT /admin/vdc/{id}", enabled=false) public void testEditVdc() throws Exception { String origName = vdcClient.getVdc(adminVdcUri).getName(); String newName = name("a"); @@ -128,7 +128,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "DELETE /admin/vdc/{id}", enabled=false) + @Test(description = "DELETE /admin/vdc/{id}", enabled=false) public void testDeleteVdc() throws Exception { // TODO Need to have a VDC that we're happy to delete! Task task = vdcClient.deleteVdc(adminVdcUri); @@ -142,7 +142,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "DISABLE/ENABLE /admin/vdc/{id}", enabled=false) + @Test(description = "DISABLE/ENABLE /admin/vdc/{id}", enabled=false) public void testDisableAndEnableVdc() throws Exception { // TODO Need to have a VDC that we're happy to delete! Exception exception = null; @@ -165,7 +165,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /admin/vdc/{id}/metadata") + @Test(description = "GET /admin/vdc/{id}/metadata") public void testGetMetadata() throws Exception { Metadata metadata = metadataClient.getMetadata(adminVdcUri); @@ -173,7 +173,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "PUT /admin/vdc/{id}/metadata", enabled=false) + @Test(description = "PUT /admin/vdc/{id}/metadata", enabled=false) public void testSetMetadata() throws Exception { metadataKey = name("key-"); metadataValue = name("value-"); @@ -190,7 +190,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "GET /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadata" }, enabled=false) + @Test(description = "GET /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadata" }, enabled=false) public void testGetMetadataValue() throws Exception { MetadataValue retrievedMetadataValue = metadataClient.getMetadataValue(adminVdcUri, metadataKey); @@ -198,7 +198,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "PUT /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" }, enabled=false ) + @Test(description = "PUT /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" }, enabled=false ) public void testSetMetadataValue() throws Exception { metadataValue = name("value-"); MetadataValue newV = MetadataValue.builder().value(metadataValue).build(); @@ -211,7 +211,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO insufficient permissions to test - @Test(testName = "DELETE /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }, enabled=false ) + @Test(description = "DELETE /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }, enabled=false ) public void testDeleteMetadataValue() throws Exception { // TODO Remove dependency on other tests; make cleanUp delete a list of metadata entries? diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientLiveTest.java index c07b6627e8..868835c668 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientLiveTest.java @@ -110,7 +110,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /catalog/{id}") + @Test(description = "GET /catalog/{id}") public void testGetCatalog() { CatalogType catalog = catalogClient.getCatalog(catalogRef.getHref()); assertNotNull(catalog); @@ -118,14 +118,14 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertEquals(catalog.getHref(), catalogRef.getHref()); } - @Test(testName = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem") + @Test(description = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem") public void testGetCatalogItem() { CatalogItem catalogItem = catalogClient.getCatalogItem(this.catalogItem.getHref()); checkCatalogItem(catalogItem); assertEquals(catalogItem.getEntity().getHref(), this.catalogItem.getEntity().getHref()); } - @Test(testName = "POST /catalog/{id}/catalogItems") + @Test(description = "POST /catalog/{id}/catalogItems") public void testAddCatalogItem() { assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC)); @@ -157,7 +157,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertEquals(catalogItem.getDescription(), "New Item"); } - @Test(testName = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem") + @Test(description = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem") public void testUpdateCatalogItem() { CatalogItem updatedCatalogItem = CatalogItem.builder().fromCatalogItem(catalogItem).name("UPDATEDNAME").build(); catalogItem = catalogClient.updateCatalogItem(catalogItem.getHref(), updatedCatalogItem); @@ -166,7 +166,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // Note this runs after all the metadata tests - @Test(testName = "DELETE /catalogItem/{id}", dependsOnMethods = "testDeleteCatalogItemMetadataValue") + @Test(description = "DELETE /catalogItem/{id}", dependsOnMethods = "testDeleteCatalogItemMetadataValue") public void testDeleteCatalogItem() { catalogClient.deleteCatalogItem(catalogItem.getHref()); try { @@ -181,13 +181,13 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /catalog/{id}/metadata") + @Test(description = "GET /catalog/{id}/metadata") public void testGetCatalogMetadata() { Metadata catalogMetadata = catalogClient.getMetadataClient().getMetadata(catalogRef.getHref()); checkMetadata(catalogMetadata); } - @Test(testName = "GET /catalog/{id}/metadata/{key}") + @Test(description = "GET /catalog/{id}/metadata/{key}") public void testGetCatalogMetadataValue() { Metadata catalogMetadata = catalogClient.getMetadataClient().getMetadata(catalogRef.getHref()); MetadataEntry existingMetadataEntry = Iterables.find(catalogMetadata.getMetadataEntries(), new Predicate() { @@ -202,13 +202,13 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { checkMetadataValue(metadataValue); } - @Test(testName = "GET /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem") + @Test(description = "GET /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem") public void testGetCatalogItemMetadata() { Metadata catalogItemMetadata = catalogClient.getCatalogItemMetadataClient().getMetadata(catalogItem.getHref()); checkMetadata(catalogItemMetadata); } - @Test(testName = "POST /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem") + @Test(description = "POST /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem") public void testMergeCatalogItemMetadata() { Metadata newMetadata = Metadata.builder() .entry(MetadataEntry.builder().entry("KEY", "MARMALADE").build()) @@ -236,13 +236,13 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { checkMetadataValue(newKeyMetadataValue); } - @Test(testName = "GET /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testSetCatalogItemMetadataValue") + @Test(description = "GET /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testSetCatalogItemMetadataValue") public void testGetCatalogItemMetadataValue() { MetadataValue metadataValue = catalogClient.getCatalogItemMetadataClient().getMetadataValue(catalogItem.getHref(), "KEY"); checkMetadataValue(metadataValue); } - @Test(testName = "PUT /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testMergeCatalogItemMetadata") + @Test(description = "PUT /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testMergeCatalogItemMetadata") public void testSetCatalogItemMetadataValue() { MetadataValue newMetadataValue = MetadataValue.builder().value("NEW").build(); @@ -257,7 +257,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest { checkMetadataValue(updatedMetadataValue); } - @Test(testName = "DELETE /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testGetCatalogItemMetadataValue") + @Test(description = "DELETE /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testGetCatalogItemMetadataValue") public void testDeleteCatalogItemMetadataValue() { Task deleteCatalogItemMetadataValue = catalogClient.getCatalogItemMetadataClient().deleteMetadataEntry(catalogItem.getHref(), "KEY"); checkTask(deleteCatalogItemMetadataValue); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/GroupClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/GroupClientLiveTest.java index f0aa95b01e..929ed82d80 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/GroupClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/GroupClientLiveTest.java @@ -69,7 +69,7 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest { // context.getApi().getAdminOrgClient().updateLdapSettings(newLdapSettings); } - @Test(testName = "POST /admin/org/{id}/groups") + @Test(description = "POST /admin/org/{id}/groups") public void testCreateGroup() { fail("LDAP not configured, group client isn't currently testable."); // group = groupClient.createGroup(orgUri, Group.builder() @@ -78,14 +78,14 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkGroup(group); } - @Test(testName = "GET /admin/group/{id}", dependsOnMethods = { "testCreateGroup" }) + @Test(description = "GET /admin/group/{id}", dependsOnMethods = { "testCreateGroup" }) public void testGetGroup() { group = groupClient.getGroup(groupRef.getHref()); Checks.checkGroup(group); } - @Test(testName = "PUT /admin/group/{id}", dependsOnMethods = { "testGetGroup" } ) + @Test(description = "PUT /admin/group/{id}", dependsOnMethods = { "testGetGroup" } ) public void testUpdateGroup() { String oldName = group.getName(); String newName = "new "+oldName; @@ -118,7 +118,7 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "DELETE /admin/group/{id}", dependsOnMethods = { "testUpdateGroup" } ) + @Test(description = "DELETE /admin/group/{id}", dependsOnMethods = { "testUpdateGroup" } ) public void testDeleteGroup() { groupClient.deleteGroup(groupRef.getHref()); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientLiveTest.java index 5c276b3837..5cd6d27157 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientLiveTest.java @@ -104,7 +104,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { private MetadataValue metadataValue; private String metadataEntryValue = "value"; - @Test(testName = "POST /vdc/{id}/media") + @Test(description = "POST /vdc/{id}/media") public void testCreateMedia() throws URISyntaxException { assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC)); Vdc vdc = vdcClient.getVdc(vdcURI); @@ -154,7 +154,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /media/{id}", dependsOnMethods = { "testCreateMedia" }) + @Test(description = "GET /media/{id}", dependsOnMethods = { "testCreateMedia" }) public void testGetMedia() { media = mediaClient.getMedia(media.getHref()); assertNotNull(media, String.format(OBJ_REQ_LIVE, MEDIA)); @@ -166,7 +166,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkMediaFor(MEDIA, media); } - @Test(testName = "GET /media/{id}/owner", + @Test(description = "GET /media/{id}/owner", dependsOnMethods = { "testGetMedia" }) public void testGetMediaOwner() { Owner directOwner = mediaClient.getOwner(media.getHref()); @@ -185,7 +185,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkReferenceType(directOwner.getUser()); } - @Test(testName = "POST /vdc/{id}/action/cloneMedia", + @Test(description = "POST /vdc/{id}/action/cloneMedia", dependsOnMethods = { "testGetMediaOwner" }) public void testCloneMedia() { oldMedia = media; @@ -235,7 +235,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { media.toString(), oldMedia.toString())); } - @Test(testName = "PUT /media/{id}", + @Test(description = "PUT /media/{id}", dependsOnMethods = { "testCloneMedia" }) public void testSetMedia() { String oldName = media.getName(); @@ -265,7 +265,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { media = mediaClient.getMedia(media.getHref()); } - @Test(testName = "GET /media/{id}/metadata", + @Test(description = "GET /media/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" }) public void testGetMetadata() { metadata = mediaClient.getMetadataClient().getMetadata(media.getHref()); @@ -276,7 +276,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkMetadataFor(MEDIA, metadata); } - @Test(testName = "POST /media/{id}/metadata", + @Test(description = "POST /media/{id}/metadata", dependsOnMethods = { "testGetMedia" }) public void testMergeMetadata() { // test new @@ -329,14 +329,14 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /media/{id}/metadata/{key}", + @Test(description = "GET /media/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }) public void testGetMetadataValue() { metadataValue = mediaClient.getMetadataClient().getMetadataValue(media.getHref(), "key"); Checks.checkMetadataValueFor(MEDIA, metadataValue); } - @Test(testName = "PUT /media/{id}/metadata/{key}", + @Test(description = "PUT /media/{id}/metadata/{key}", dependsOnMethods = { "testMergeMetadata" }) public void testSetMetadataValue() { metadataEntryValue = "value"; @@ -350,7 +350,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkMetadataValueFor(MEDIA, metadataValue); } - @Test(testName = "DELETE /media/{id}/metadata/{key}", + @Test(description = "DELETE /media/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata", "testGetMetadataValue" } ) public void testDeleteMetadata() { Task deleteMetadataEntry = mediaClient.getMetadataClient().deleteMetadataEntry(media.getHref(), "testKey"); @@ -387,7 +387,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkMediaFor(MEDIA, media); } - @Test(testName = "DELETE /media/{id}", + @Test(description = "DELETE /media/{id}", dependsOnMethods = { "testDeleteMetadata" } ) public void testDeleteMedia() { Task deleteMedia = mediaClient.deleteMedia(media.getHref()); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java index 21100a6410..88b23a1565 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/NetworkClientLiveTest.java @@ -2,14 +2,14 @@ * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information - *(Link.builder().regarding copyright ownership. jclouds licenses this file + * regarding copyright ownership. jclouds licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless(Link.builder().required by applicable law or agreed to in writing, + * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the @@ -72,7 +72,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { .deleteMetadataEntry(toAdminUri(networkURI), "key"); } - @Test(testName = "GET /network/{id}") + @Test(description = "GET /network/{id}") public void testGetNetwork() { // required for testing assertNotNull(networkURI, String.format(REF_REQ_LIVE, NETWORK)); @@ -87,7 +87,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkOrgNetwork(network); } - @Test(testName = "GET /network/{id}/metadata") + @Test(description = "GET /network/{id}/metadata") public void testGetMetadata() { Metadata metadata = networkClient.getMetadataClient().getMetadata(networkURI); // required for testing @@ -109,7 +109,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /network/{id}/metadata/{key}") + @Test(description = "GET /network/{id}/metadata/{key}") public void testGetMetadataValue() { MetadataValue metadataValue = networkClient.getMetadataClient().getMetadataValue(networkURI, "key"); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/OrgClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/OrgClientLiveTest.java index b53b9e71db..bc8f918a09 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/OrgClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/OrgClientLiveTest.java @@ -66,7 +66,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { orgClient = context.getApi().getOrgClient(); } - @AfterClass(groups = { "live" }) + @AfterClass(alwaysRun = true) public void cleanUp() throws Exception { if (metadataSet) { context.getApi().getAdminOrgClient().getMetadataClient() @@ -83,7 +83,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { private Org org; private boolean metadataSet = false; - @Test(testName = "GET /org") + @Test(description = "GET /org") public void testGetOrgList() { // Call the method being tested orgList = orgClient.getOrgList(); @@ -99,7 +99,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /org/{id}", dependsOnMethods = { "testGetOrgList" }) + @Test(description = "GET /org/{id}", dependsOnMethods = { "testGetOrgList" }) public void testGetOrg() { Reference orgRef = Iterables.getFirst(orgList.getOrgs(), null); assertNotNull(orgRef); @@ -112,14 +112,14 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { checkOrg(org); } - @Test(testName = "orgClient admin metadata setup", dependsOnMethods = { "testGetOrg" }) + @Test(description = "orgClient admin metadata setup", dependsOnMethods = { "testGetOrg" }) public void testSetupMetadata() { context.getApi().getAdminOrgClient().getMetadataClient().setMetadata(toAdminUri(orgURI), "KEY", MetadataValue.builder().value("VALUE").build()); metadataSet = true; } - @Test(testName = "GET /org/{id}/metadata", dependsOnMethods = { "testSetupMetadata" }) + @Test(description = "GET /org/{id}/metadata", dependsOnMethods = { "testSetupMetadata" }) public void testGetOrgMetadata() { // Call the method being tested Metadata metadata = orgClient.getMetadataClient().getMetadata(orgURI); @@ -132,7 +132,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()), String.format(NOT_EMPTY_OBJECT_FMT, "MetadataEntry", "Org")); } - @Test(testName = "GET /org/{id}/metadata/{key}", dependsOnMethods = { "testGetOrgMetadata" }) + @Test(description = "GET /org/{id}/metadata/{key}", dependsOnMethods = { "testGetOrgMetadata" }) public void testGetOrgMetadataValue() { // Call the method being tested MetadataValue value = orgClient.getMetadataClient().getMetadataValue(orgURI, "KEY"); @@ -145,7 +145,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertEquals(value.getValue(), expected, String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", expected, value.getValue())); } - @Test(testName = "GET /org/{id}/catalog/{catalogId}/controlAccess", dependsOnMethods = { "testGetOrg" }) + @Test(description = "GET /org/{id}/catalog/{catalogId}/controlAccess", dependsOnMethods = { "testGetOrg" }) public void testGetControlAccess() { // Call the method being tested ControlAccessParams params = orgClient.getControlAccess(orgURI, catalogId); @@ -154,7 +154,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest { checkControlAccessParams(params); } - @Test(testName = "GET /org/{id}/catalog/{catalogId}/action/controlAccess", dependsOnMethods = { "testGetControlAccess" }) + @Test(description = "GET /org/{id}/catalog/{catalogId}/action/controlAccess", dependsOnMethods = { "testGetControlAccess" }) public void testModifyControlAccess() { // Setup params ControlAccessParams params = orgClient.getControlAccess(orgURI, catalogId); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/QueryClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/QueryClientLiveTest.java index fb29ae7fd1..fb8b0c7894 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/QueryClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/QueryClientLiveTest.java @@ -89,7 +89,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { vAppClient = context.getApi().getVAppClient(); } - @Test(testName = "GET /entity/{id}") + @Test(description = "GET /entity/{id}") public void testEntity() { // Get a VAppTemplate to look up as an entity VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI); @@ -107,7 +107,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { } - @Test(testName = "GET /query") + @Test(description = "GET /query") public void testQuery() { VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI); QueryResultRecords queryResult = queryClient.query("vAppTemplate", String.format("name==%s", vAppTemplate.getName())); @@ -117,19 +117,19 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertTrue(hrefs.contains(vAppTemplateURI), "VAppTemplates query result should include vAppTemplate "+vAppTemplateURI+"; but only has "+hrefs); } - @Test(testName = "GET /catalogs/query") + @Test(description = "GET /catalogs/query") public void testQueryAllCatalogs() { QueryResultRecords catalogRecords = queryClient.catalogsQueryAll(); assertFalse(catalogRecords.getRecords().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogRecord", "QueryResultRecords")); } - @Test(testName = "GET /catalogs/query?format=references", dependsOnMethods = { "testQueryAllCatalogs" }) + @Test(description = "GET /catalogs/query?format=references", dependsOnMethods = { "testQueryAllCatalogs" }) public void testQueryAllCatalogReferences() { CatalogReferences catalogReferences = queryClient.catalogReferencesQueryAll(); assertFalse(catalogReferences.getReferences().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogReference", "CatalogReferences")); } - @Test(testName = "GET /vAppTemplates/query") + @Test(description = "GET /vAppTemplates/query") public void testQueryAllVAppTemplates() { QueryResultRecords queryResult = queryClient.vAppTemplatesQueryAll(); Set hrefs = toHrefs(queryResult); @@ -138,7 +138,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertTrue(hrefs.contains(vAppTemplateURI), "VAppTemplates query result should include vAppTemplate "+vAppTemplateURI+"; but only has "+hrefs); } - @Test(testName = "GET /vAppTemplates/query?filter)") + @Test(description = "GET /vAppTemplates/query?filter") public void testQueryVAppTemplatesWithFilter() { VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI); QueryResultRecords queryResult = queryClient.vAppTemplatesQuery(String.format("name==%s", vAppTemplate.getName())); @@ -148,7 +148,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertTrue(hrefs.contains(vAppTemplateURI), "VAppTemplates query result should have found vAppTemplate "+vAppTemplateURI); } - @Test(testName = "GET /vApps/query") + @Test(description = "GET /vApps/query") public void testQueryAllVApps() { vApp = instantiateVApp(); @@ -159,7 +159,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertTrue(hrefs.contains(vApp.getHref()), "VApp query result should include vapp "+vApp.getHref()+"; but only has "+hrefs); } - @Test(testName = "GET /vApps/query?filter", dependsOnMethods = { "testQueryAllVApps" } ) + @Test(description = "GET /vApps/query?filter", dependsOnMethods = { "testQueryAllVApps" } ) public void testQueryVAppsWithFilter() { QueryResultRecords queryResult = queryClient.vAppsQuery(String.format("name==%s", vApp.getName())); Set hrefs = toHrefs(queryResult); @@ -168,7 +168,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertEquals(hrefs, Collections.singleton(vApp.getHref()), "VApps query result should have found vApp "+vApp.getHref()); } - @Test(testName = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" } ) + @Test(description = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" } ) public void testQueryAllVms() { // Wait for vApp to have been entirely instantiated Task instantiateTask = Iterables.getFirst(vApp.getTasks(), null); @@ -192,7 +192,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertTrue(hrefs.containsAll(vmHrefs), "VMs query result should include vms "+vmHrefs+"; but only has "+hrefs); } - @Test(testName = "GET /vms/query?filter", dependsOnMethods = { "testQueryAllVms" } ) + @Test(description = "GET /vms/query?filter", dependsOnMethods = { "testQueryAllVms" } ) public void testQueryAllVmsWithFilter() { List vms = vApp.getChildren().getVms(); Set vmHrefs = toHrefs(vms); @@ -204,14 +204,14 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertEquals(hrefs, vmHrefs, "VMs query result should equal vms of vApp "+vApp.getName()+" ("+vmHrefs+"); but only has "+hrefs); } - @Test(testName = "GET /mediaList/query") + @Test(description = "GET /mediaList/query") public void testQueryAllMedia() { QueryResultRecords queryResult = queryClient.mediaListQueryAll(); assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class); } - @Test(testName = "GET /mediaList/query?filter") + @Test(description = "GET /mediaList/query?filter") public void testQueryMediaWithFilter() { String mediaName = "abc"; QueryResultRecords queryResult = queryClient.mediaListQuery(String.format("name==%s", mediaName)); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/TaskClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/TaskClientLiveTest.java index 7a21f2d0c6..9b1bac8b03 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/TaskClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/TaskClientLiveTest.java @@ -77,7 +77,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest { if (vApp != null) cleanUpVApp(vApp); } - @Test(testName = "GET /tasksList/{id}") + @Test(description = "GET /tasksList/{id}") public void testGetTaskList() { orgList = orgClient.getOrgList(); Reference orgRef = Iterables.getFirst(orgList.getOrgs(), null); @@ -97,7 +97,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "GET /task/{id}", dependsOnMethods = { "testGetTaskList" }) + @Test(description = "GET /task/{id}", dependsOnMethods = { "testGetTaskList" }) public void testGetTask() { //TODO: upload media or something so you can get a fresh cancellable task? @@ -113,7 +113,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest { // FIXME cancelTask complains "This task can not be canceled" // However, when I do this through the UI, I can cancel the task for instantiating a vApp. - @Test(testName = "POST /task/{id}/action/cancel", dependsOnMethods = { "testGetTask" }) + @Test(description = "POST /task/{id}/action/cancel", dependsOnMethods = { "testGetTask" }) public void testCancelTask() { vApp = instantiateVApp(); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UploadClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UploadClientLiveTest.java index 307c75d662..0d9e8b9050 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UploadClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UploadClientLiveTest.java @@ -43,7 +43,7 @@ public class UploadClientLiveTest extends BaseVCloudDirectorClientLiveTest { uploadClient = context.getApi().getUploadClient(); } - @Test(testName = "PUT ???", enabled = false) + @Test(description = "PUT ???", enabled = false) public void testUpload() { } } diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UserClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UserClientLiveTest.java index 442c9b8167..1d3c35ee55 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UserClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/UserClientLiveTest.java @@ -89,14 +89,14 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "POST /admin/org/{id}/users") + @Test(description = "POST /admin/org/{id}/users") public void testCreateUser() { User newUser = randomTestUser("testCreateUser", context); user = userClient.createUser(orgRef.getHref(), newUser); Checks.checkUser(newUser); } - @Test(testName = "GET /admin/user/{id}", + @Test(description = "GET /admin/user/{id}", dependsOnMethods = { "testCreateUser" }) public void testGetUser() { user = userClient.getUser(user.getHref()); @@ -104,7 +104,7 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkUser(user); } - @Test(testName = "PUT /admin/user/{id}", + @Test(description = "PUT /admin/user/{id}", dependsOnMethods = { "testGetUser" }) public void testUpdateUser() { User oldUser = user.toBuilder().build(); @@ -162,7 +162,7 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest { sessionClient.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken()); } - @Test(testName = "POST /admin/user/{id}/action/unlock", dependsOnMethods = { "testUpdateUser" }) + @Test(description = "POST /admin/user/{id}/action/unlock", dependsOnMethods = { "testUpdateUser" }) public void testUnlockUser() { // Need to know how many times to fail login to lock account AdminOrgClient adminOrgClient = context.getApi().getAdminOrgClient(); @@ -216,7 +216,7 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest { } } - @Test(testName = "DELETE /admin/user/{id}", + @Test(description = "DELETE /admin/user/{id}", dependsOnMethods = { "testCreateUser" } ) public void testDeleteUser() { // Create a user to be deleted (so we remove dependencies on test ordering) diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java index 86f0f38541..f076865a66 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java @@ -125,7 +125,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { /** * @see VAppClient#getVApp(URI) */ - @Test(testName = "GET /vApp/{id}") + @Test(description = "GET /vApp/{id}") public void testGetVApp() { // The method under test vApp = vAppClient.getVApp(vAppURI); @@ -148,7 +148,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { /** * @see VAppClient#modifyVApp(URI, VApp) */ - @Test(testName = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" }) + @Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" }) public void testModifyVApp() { VApp newVApp = VApp.builder() .name(name("new-name-")) @@ -168,7 +168,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(vApp.getDescription(), newVApp.getDescription(), String.format(OBJ_FIELD_EQ, VAPP, "Description", newVApp.getDescription(), vApp.getDescription())); } - @Test(testName = "POST /vApp/{id}/action/deploy", dependsOnMethods = { "testGetVApp" }) + @Test(description = "POST /vApp/{id}/action/deploy", dependsOnMethods = { "testGetVApp" }) public void testDeployVApp() { DeployVAppParams params = DeployVAppParams.builder() .deploymentLeaseSeconds((int) TimeUnit.SECONDS.convert(1L, TimeUnit.HOURS)) @@ -190,7 +190,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertVAppStatus(vAppURI, Status.POWERED_OFF); } - @Test(testName = "POST /vApp/{id}/power/action/powerOn", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/power/action/powerOn", dependsOnMethods = { "testDeployVApp" }) public void testPowerOnVApp() { // Power off VApp vApp = powerOff(vApp); @@ -206,7 +206,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertVAppStatus(vAppURI, Status.POWERED_ON); } - @Test(testName = "POST /vApp/{id}/power/action/reboot", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/power/action/reboot", dependsOnMethods = { "testDeployVApp" }) public void testReboot() { // Power on VApp vApp = powerOn(vApp); @@ -222,7 +222,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertVAppStatus(vAppURI, Status.POWERED_OFF); } - @Test(testName = "POST /vApp/{id}/power/action/shutdown", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/power/action/shutdown", dependsOnMethods = { "testDeployVApp" }) public void testShutdown() { // Power on VApp vApp = powerOn(vApp); @@ -241,7 +241,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { vApp = powerOn(vApp); } - @Test(testName = "POST /vApp/{id}/power/action/suspend", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/power/action/suspend", dependsOnMethods = { "testDeployVApp" }) public void testSuspend() { // Power on VApp vApp = powerOn(vApp); @@ -260,7 +260,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { vApp = powerOn(vApp); } - @Test(testName = "POST /vApp/{id}/power/action/reset", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/power/action/reset", dependsOnMethods = { "testDeployVApp" }) public void testReset() { // Power on VApp vApp = powerOn(vApp); @@ -276,7 +276,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertVAppStatus(vAppURI, Status.POWERED_ON); } - @Test(testName = "POST /vApp/{id}/action/undeploy", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/action/undeploy", dependsOnMethods = { "testDeployVApp" }) public void testUndeployVApp() { // Power on VApp vApp = powerOn(vApp); @@ -295,7 +295,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertVAppStatus(vAppURI, Status.POWERED_OFF); } - @Test(testName = "POST /vApp/{id}/power/action/powerOff", dependsOnMethods = { "testUndeployVApp" }) + @Test(description = "POST /vApp/{id}/power/action/powerOff", dependsOnMethods = { "testUndeployVApp" }) public void testPowerOffVApp() { // Power on VApp vApp = powerOn(vApp); @@ -311,7 +311,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertVAppStatus(vAppURI, Status.POWERED_OFF); } - @Test(testName = "POST /vApp/{id}/action/consolidate", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/action/consolidate", dependsOnMethods = { "testDeployVApp" }) public void testConsolidateVApp() { // Power on VApp vApp = powerOn(vApp); @@ -321,7 +321,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertTrue(retryTaskSuccess.apply(consolidateVApp), String.format(TASK_COMPLETE_TIMELY, "consolidateVApp")); } - @Test(testName = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testGetVApp" }) + @Test(description = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testGetVApp" }) public void testControlAccessUser() { ControlAccessParams params = ControlAccessParams.builder() .notSharedToEveryone() @@ -342,7 +342,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, params, String.format(ENTITY_EQUAL, "ControlAccessParams")); } - @Test(testName = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testControlAccessUser" }) + @Test(description = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testControlAccessUser" }) public void testControlAccessEveryone() { ControlAccessParams params = ControlAccessParams.builder() .sharedToEveryone() @@ -359,7 +359,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, params, String.format(ENTITY_EQUAL, "ControlAccessParams")); } - @Test(testName = "POST /vApp/{id}/action/discardSuspendedState", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/action/discardSuspendedState", dependsOnMethods = { "testDeployVApp" }) public void testDiscardSuspendedState() { // Suspend the VApp vApp = suspend(vAppURI); @@ -369,7 +369,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState")); } - @Test(testName = "POST /vApp/{id}/action/enterMaintenanceMode") + @Test(description = "POST /vApp/{id}/action/enterMaintenanceMode") public void testEnterMaintenanceMode() { // Do this to a new vApp, so don't mess up subsequent tests by making the vApp read-only VApp temp = instantiateVApp(); @@ -395,7 +395,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } } - @Test(testName = "POST /vApp/{id}/action/exitMaintenanceMode", dependsOnMethods = { "testEnterMaintenanceMode" }) + @Test(description = "POST /vApp/{id}/action/exitMaintenanceMode", dependsOnMethods = { "testEnterMaintenanceMode" }) public void testExitMaintenanceMode() { // Do this to a new vApp, so don't mess up subsequent tests by making the vApp read-only VApp temp = instantiateVApp(); @@ -421,7 +421,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } } - @Test(testName = "POST /vApp/{id}/action/installVMwareTools", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "POST /vApp/{id}/action/installVMwareTools", dependsOnMethods = { "testDeployVApp" }) public void testInstallVMwareTools() { // First ensure the vApp is powered n vApp = powerOn(vApp); @@ -434,7 +434,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { // FIXME "Could not bind object to request[method=POST, endpoint=https://mycloud.greenhousedata.com/api/vApp/vapp-e124f3f0-adb9-4268-ad49-e54fb27e40af/action/recomposeVApp, // headers={Accept=[application/vnd.vmware.vcloud.task+xml]}, payload=[content=true, contentMetadata=[contentDisposition=null, contentEncoding=null, contentLanguage=null, // contentLength=0, contentMD5=null, contentType=application/vnd.vmware.vcloud.recomposeVAppParams+xml], written=false]]: Could not marshall object" - @Test(testName = "POST /vApp/{id}/action/recomposeVApp", dependsOnMethods = { "testGetVApp" }) + @Test(description = "POST /vApp/{id}/action/recomposeVApp", dependsOnMethods = { "testGetVApp" }) public void testRecomposeVApp() { RecomposeVAppParams params = RecomposeVAppParams.builder().build(); @@ -444,7 +444,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } // NOTE This test is disabled, as it is not possible to look up datastores using the User API - @Test(testName = "POST /vApp/{id}/action/relocate", dependsOnMethods = { "testGetVApp" }) + @Test(description = "POST /vApp/{id}/action/relocate", dependsOnMethods = { "testGetVApp" }) public void testRelocate() { // Relocate to the last of the available datastores QueryResultRecords records = context.getApi().getQueryClient().queryAll("datastore"); @@ -456,7 +456,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertTrue(retryTaskSuccess.apply(relocate), String.format(TASK_COMPLETE_TIMELY, "relocate")); } - @Test(testName = "POST /vApp/{id}/action/upgradeHardwareVersion", dependsOnMethods = { "testGetVApp" }) + @Test(description = "POST /vApp/{id}/action/upgradeHardwareVersion", dependsOnMethods = { "testGetVApp" }) public void testUpgradeHardwareVersion() { // Power off VApp vApp = powerOff(vApp); @@ -466,7 +466,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertTrue(retryTaskSuccess.apply(upgradeHardwareVersion), String.format(TASK_COMPLETE_TIMELY, "upgradeHardwareVersion")); } - @Test(testName = "GET /vApp/{id}/controlAccess", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/controlAccess", dependsOnMethods = { "testGetVApp" }) public void testGetControlAccess() { // The method under test ControlAccessParams controlAccess = vAppClient.getControlAccess(vApp.getHref()); @@ -475,7 +475,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkControlAccessParams(controlAccess); } - @Test(testName = "GET /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetVApp" }) public void testGetGuestCustomizationSection() { getGuestCustomizationSection(new Function() { @Override @@ -485,7 +485,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { }); } - @Test(testName = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" }) + @Test(description = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" }) public void testModifyGuestCustomizationSection() { // Copy existing section and update fields GuestCustomizationSection oldSection = vAppClient.getGuestCustomizationSection(vm.getHref()); @@ -516,7 +516,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "GuestCustomizationSection")); } - @Test(testName = "GET /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetVApp" }) public void testGetLeaseSettingsSection() { // The method under test LeaseSettingsSection section = vAppClient.getLeaseSettingsSection(vApp.getHref()); @@ -525,7 +525,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkLeaseSettingsSection(section); } - @Test(testName = "PUT /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetLeaseSettingsSection" }) + @Test(description = "PUT /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetLeaseSettingsSection" }) public void testModifyLeaseSettingsSection() { // Copy existing section LeaseSettingsSection oldSection = vAppClient.getLeaseSettingsSection(vApp.getHref()); @@ -575,7 +575,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } // FIXME "Error: The requested operation on media "com.vmware.vcloud.entity.media:abfcb4b7-809f-4b50-a0aa-8c97bf09a5b0" is not supported in the current state." - @Test(testName = "PUT /vApp/{id}/media/action/insertMedia", dependsOnMethods = { "testGetVApp" }) + @Test(description = "PUT /vApp/{id}/media/action/insertMedia", dependsOnMethods = { "testGetVApp" }) public void testInsertMedia() { // Setup media params from configured media id MediaInsertOrEjectParams params = MediaInsertOrEjectParams.builder() @@ -587,7 +587,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertTrue(retryTaskSuccess.apply(insertMedia), String.format(TASK_COMPLETE_TIMELY, "insertMedia")); } - @Test(testName = "PUT /vApp/{id}/media/action/ejectMedia", dependsOnMethods = { "testInsertMedia" }) + @Test(description = "PUT /vApp/{id}/media/action/ejectMedia", dependsOnMethods = { "testInsertMedia" }) public void testEjectMedia() { // Setup media params from configured media id MediaInsertOrEjectParams params = MediaInsertOrEjectParams.builder() @@ -599,7 +599,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertTrue(retryTaskSuccess.apply(ejectMedia), String.format(TASK_COMPLETE_TIMELY, "ejectMedia")); } - @Test(testName = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" }) public void testGetNetworkConfigSection() { // The method under test NetworkConfigSection section = vAppClient.getNetworkConfigSection(vApp.getHref()); @@ -608,7 +608,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkNetworkConfigSection(section); } - @Test(testName = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" }) + @Test(description = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" }) public void testModifyNetworkConfigSection() { // Copy existing section and update fields NetworkConfigSection oldSection = vAppClient.getNetworkConfigSection(vApp.getHref()); @@ -632,7 +632,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "NetworkConfigSection")); } - @Test(testName = "GET /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetVApp" }) public void testGetNetworkConnectionSection() { getNetworkConnectionSection(new Function() { @Override @@ -643,7 +643,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } // FIXME "Task error: Unable to perform this action. Contact your cloud administrator." - @Test(testName = "PUT /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetNetworkConnectionSection" }) + @Test(description = "PUT /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetNetworkConnectionSection" }) public void testModifyNetworkConnectionSection() { // Look up a network in the Vdc Set networks = vdc.getAvailableNetworks(); @@ -675,7 +675,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "NetworkConnectionSection")); } - @Test(testName = "GET /vApp/{id}/networkSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/networkSection", dependsOnMethods = { "testGetVApp" }) public void testGetNetworkSection() { // The method under test NetworkSection section = vAppClient.getNetworkSection(vApp.getHref()); @@ -684,7 +684,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkNetworkSection(section); } - @Test(testName = "GET /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetVApp" }) public void testGetOperatingSystemSection() { // The method under test OperatingSystemSection section = vAppClient.getOperatingSystemSection(vm.getHref()); @@ -693,7 +693,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkOperatingSystemSection(section); } - @Test(testName = "PUT /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetOperatingSystemSection", "testModifyVirtualHardwareSection" }) + @Test(description = "PUT /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetOperatingSystemSection", "testModifyVirtualHardwareSection" }) public void testModifyOperatingSystemSection() { // Create new OperatingSystemSection OperatingSystemSection newSection = OperatingSystemSection.builder() @@ -716,7 +716,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified.getId(), newSection.getId()); } - @Test(testName = "GET /vApp/{id}/owner", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/owner", dependsOnMethods = { "testGetVApp" }) public void testGetOwner() { // The method under test Owner owner = vAppClient.getOwner(vApp.getHref()); @@ -725,7 +725,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkOwner(owner); } - @Test(testName = "PUT /vApp/{id}/owner", dependsOnMethods = { "testGetOwner" }) + @Test(description = "PUT /vApp/{id}/owner", dependsOnMethods = { "testGetOwner" }) public void testModifyOwner() { Owner newOwner = Owner.builder().user(Reference.builder().href(userURI).type(ADMIN_USER).build()).build(); @@ -742,7 +742,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified.getUser().getHref(), newOwner.getUser().getHref()); } - @Test(testName = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" }) public void testGetProductSections() { // The method under test ProductSectionList sectionList = vAppClient.getProductSections(vApp.getHref()); @@ -751,7 +751,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkProductSectionList(sectionList); } - @Test(testName = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" }) + @Test(description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" }) public void testModifyProductSections() { // Copy existing section and update fields ProductSectionList oldSections = vAppClient.getProductSections(vApp.getHref()); @@ -783,7 +783,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } // FIXME How do we force it to ask a question? - @Test(testName = "GET /vApp/{id}/question", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "GET /vApp/{id}/question", dependsOnMethods = { "testDeployVApp" }) public void testGetPendingQuestion() { // Power on VApp vApp = powerOn(vAppURI); @@ -797,7 +797,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkVmPendingQuestion(question); } - @Test(testName = "POST /vApp/{id}/question/action/answer", dependsOnMethods = { "testGetPendingQuestion" }) + @Test(description = "POST /vApp/{id}/question/action/answer", dependsOnMethods = { "testGetPendingQuestion" }) public void testAnswerQuestion() { // TODO check that the question has been answered (e.g. asking for getPendingQuestion does not // include our answered question). @@ -815,7 +815,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { vAppClient.answerQuestion(vm.getHref(), answer); } - @Test(testName = "GET /vApp/{id}/runtimeInfoSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/runtimeInfoSection", dependsOnMethods = { "testGetVApp" }) public void testGetRuntimeInfoSection() { // The method under test RuntimeInfoSection section = vAppClient.getRuntimeInfoSection(vm.getHref()); @@ -825,7 +825,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } // FIXME If still failing, consider escalating? - @Test(testName = "GET /vApp/{id}/screen", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "GET /vApp/{id}/screen", dependsOnMethods = { "testDeployVApp" }) public void testGetScreenImage() { // Power on VApp vApp = powerOn(vApp); @@ -842,7 +842,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { } } - @Test(testName = "GET /vApp/{id}/screen/action/acquireTicket", dependsOnMethods = { "testDeployVApp" }) + @Test(description = "GET /vApp/{id}/screen/action/acquireTicket", dependsOnMethods = { "testDeployVApp" }) public void testGetScreenTicket() { // Power on VApp vApp = powerOn(vApp); @@ -854,7 +854,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkScreenTicket(ticket); } - @Test(testName = "GET /vApp/{id}/startupSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/startupSection", dependsOnMethods = { "testGetVApp" }) public void testGetStartupSection() { // The method under test StartupSection section = vAppClient.getStartupSection(vApp.getHref()); @@ -863,7 +863,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkStartupSection(section); } - @Test(testName = "PUT /vApp/{id}/startupSection", dependsOnMethods = { "testGetStartupSection" }) + @Test(description = "PUT /vApp/{id}/startupSection", dependsOnMethods = { "testGetStartupSection" }) public void testModifyStartupSection() { // Copy existing section and update fields StartupSection oldSection = vAppClient.getStartupSection(vApp.getHref()); @@ -884,7 +884,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, newSection); } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVApp" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVApp" }) public void testGetVirtualHardwareSection() { // Method under test VirtualHardwareSection hardware = vAppClient.getVirtualHardwareSection(vm.getHref()); @@ -893,7 +893,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkVirtualHardwareSection(hardware); } - @Test(testName = "PUT /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "PUT /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testModifyVirtualHardwareSection() { // Power off VApp vApp = powerOff(vApp); @@ -941,7 +941,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modifiedSection, newSection); } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testGetVirtualHardwareSectionCpu() { // Method under test ResourceAllocationSettingData rasd = vAppClient.getVirtualHardwareSectionCpu(vm.getHref()); @@ -950,7 +950,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkResourceAllocationSettingData(rasd); } - @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" }) + @Test(description = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" }) public void testModifyVirtualHardwareSectionCpu() { // Copy existing section and update fields ResourceAllocationSettingData oldItem = vAppClient.getVirtualHardwareSectionCpu(vm.getHref()); @@ -975,7 +975,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, newItem); } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testGetVirtualHardwareSectionDisks() { // Method under test RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionDisks(vm.getHref()); @@ -984,7 +984,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkRasdItemsList(rasdItems); } - @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSectionDisks" }) + @Test(description = "PUT /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSectionDisks" }) public void testModifyVirtualHardwareSectionDisks() { // Copy the existing items list and modify the name of an item RasdItemsList oldSection = vAppClient.getVirtualHardwareSectionDisks(vm.getHref()); @@ -1020,7 +1020,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { // checkHasMatchingItem("virtualHardwareSection/disk", modified, item0InstanceId, item0ElementName); } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection/media", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection/media", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testGetVirtualHardwareSectionMedia() { // Method under test RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionMedia(vm.getHref()); @@ -1029,7 +1029,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkRasdItemsList(rasdItems); } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testGetVirtualHardwareSectionMemory() { // Method under test ResourceAllocationSettingData rasd = vAppClient.getVirtualHardwareSectionCpu(vm.getHref()); @@ -1038,7 +1038,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkResourceAllocationSettingData(rasd); } - @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" }) + @Test(description = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" }) public void testModifyVirtualHardwareSectionMemory() { ResourceAllocationSettingData origItem = vAppClient.getVirtualHardwareSectionMemory(vm.getHref()); ResourceAllocationSettingData newItem = origItem.toBuilder() @@ -1062,7 +1062,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified, newItem); } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testGetVirtualHardwareSectionNetworkCards() { // Method under test RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionNetworkCards(vm.getHref()); @@ -1071,7 +1071,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkRasdItemsList(rasdItems); } - @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSectionNetworkCards" }) + @Test(description = "PUT /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSectionNetworkCards" }) public void testModifyVirtualHardwareSectionNetworkCards() { RasdItemsList oldSection = vAppClient.getVirtualHardwareSectionNetworkCards(vm.getHref()); RasdItemsList newSection = oldSection.toBuilder().build(); @@ -1091,7 +1091,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { // See the description in testModifyVirtualHardwareSectionDisks } - @Test(testName = "GET /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSection" }) + @Test(description = "GET /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSection" }) public void testGetVirtualHardwareSectionSerialPorts() { // Method under test RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionSerialPorts(vm.getHref()); @@ -1100,7 +1100,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkRasdItemsList(rasdItems); } - @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSectionSerialPorts" }) + @Test(description = "PUT /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSectionSerialPorts" }) public void testModifyVirtualHardwareSectionSerialPorts() { RasdItemsList oldSection = vAppClient.getVirtualHardwareSectionSerialPorts(vm.getHref()); RasdItemsList newSection = oldSection.toBuilder().build(); @@ -1120,7 +1120,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { // See the description in testModifyVirtualHardwareSectionDisks } - @Test(testName = "PUT /vApp/{id}/metadata", dependsOnMethods = { "testGetVApp" }) + @Test(description = "PUT /vApp/{id}/metadata", dependsOnMethods = { "testGetVApp" }) public void testSetMetadataValue() { key = name("key-"); String value = name("value-"); @@ -1134,7 +1134,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkMetadataValueFor(VAPP, newMetadataValue, value); } - @Test(testName = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" }) + @Test(description = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" }) public void testGetMetadata() { // Call the method being tested Metadata metadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref()); @@ -1145,7 +1145,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()), String.format(NOT_EMPTY_OBJECT_FMT, "MetadataEntry", "vApp")); } - @Test(testName = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" }) + @Test(description = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" }) public void testGetOrgMetadataValue() { // Call the method being tested MetadataValue value = vAppClient.getMetadataClient().getMetadataValue(vApp.getHref(), key); @@ -1156,7 +1156,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(value.getValue(), expected, String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", expected, value.getValue())); } - @Test(testName = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }) + @Test(description = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }) public void testDeleteMetadataEntry() { // Delete the entry Task task = vAppClient.getMetadataClient().deleteMetadataEntry(vApp.getHref(), key); @@ -1169,7 +1169,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { checkMetadataKeyAbsentFor(VAPP, newMetadata, key); } - @Test(testName = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" }) + @Test(description = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" }) public void testMergeMetadata() { Metadata oldMetadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref()); Map oldMetadataMap = Checks.metadataToMap(oldMetadata); @@ -1197,7 +1197,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { /** * @see VAppClient#deleteVApp(URI) */ - @Test(testName = "DELETE /vApp/{id}") + @Test(description = "DELETE /vApp/{id}") public void testDeleteVApp() { // Create a temporary VApp to delete VApp temp = instantiateVApp(); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClientLiveTest.java index a8f0e58433..4e30f4bd91 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClientLiveTest.java @@ -96,7 +96,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { return clonedVappTemplate; } - @Test(testName = "GET /vAppTemplate/{id}") + @Test(description = "GET /vAppTemplate/{id}") public void testGetVAppTemplate() { vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI); @@ -104,7 +104,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(vAppTemplate.getHref(), vAppTemplateURI); } - @Test(testName = "GET /vAppTemplate/{id}/owner") + @Test(description = "GET /vAppTemplate/{id}/owner") public void testGetVAppTemplateOwner() { Owner owner = vAppTemplateClient.getOwnerOfVAppTemplate(vAppTemplateURI); @@ -112,21 +112,21 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(owner.getUser(), vAppTemplateClient.getVAppTemplate(vAppTemplateURI).getOwner().getUser()); } - @Test(testName = "GET /vAppTemplate/{id}/customizationSection") + @Test(description = "GET /vAppTemplate/{id}/customizationSection") public void testGetCustomizationSection() { CustomizationSection customizationSection = vAppTemplateClient.getVAppTemplateCustomizationSection(vAppTemplateURI); checkCustomizationSection(customizationSection); } - @Test(testName = "GET /vAppTemplate/{id}/productSections") + @Test(description = "GET /vAppTemplate/{id}/productSections") public void testGetProductSections() { ProductSectionList productSectionList = vAppTemplateClient.getProductSectionsForVAppTemplate(vAppTemplateURI); checkProductSectionList(productSectionList); } - @Test(testName = "PUT /vAppTemplate/{id}/productSections") + @Test(description = "PUT /vAppTemplate/{id}/productSections") public void testEditProductSections() { // TODO make a real modification @@ -140,7 +140,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { checkProductSectionList(modified); } - @Test(testName = "GET /vAppTemplate/{id}/guestCustomizationSection") + @Test(description = "GET /vAppTemplate/{id}/guestCustomizationSection") public void testGetGuestCustomizationSection() { getGuestCustomizationSection(new Function() { @Override @@ -150,7 +150,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { }); } - @Test(testName = "GET /vAppTemplate/{id}/leaseSettingsSection") + @Test(description = "GET /vAppTemplate/{id}/leaseSettingsSection") public void testGetLeaseSettingsSection() { // FIXME Wrong case for Vapp LeaseSettingsSection leaseSettingsSection = vAppTemplateClient.getVappTemplateLeaseSettingsSection(vAppTemplateURI); @@ -158,7 +158,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { checkLeaseSettingsSection(leaseSettingsSection); } - @Test(testName = "GET /vAppTemplate/{id}/metadata", dependsOnMethods = { "testEditMetadataValue" }) + @Test(description = "GET /vAppTemplate/{id}/metadata", dependsOnMethods = { "testEditMetadataValue" }) public void testGetVAppTemplateMetadata() { Metadata metadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI); @@ -166,7 +166,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { } // implicitly tested by testEditVAppTemplateMetadataValue, which first creates the metadata entry; otherwise no entry may exist - @Test(testName = "GET /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetVAppTemplateMetadata" }) + @Test(description = "GET /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetVAppTemplateMetadata" }) public void testGetMetadataValue() { Metadata metadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI); MetadataEntry entry = Iterables.get(metadata.getMetadataEntries(), 0); @@ -177,14 +177,14 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(val.getValue(), entry.getValue()); } - @Test(testName = "GET /vAppTemplate/{id}/networkConfigSection") + @Test(description = "GET /vAppTemplate/{id}/networkConfigSection") public void testGetVAppTemplateNetworkConfigSection() { NetworkConfigSection networkConfigSection = vAppTemplateClient.getVAppTemplateNetworkConfigSection(vAppTemplateURI); checkNetworkConfigSection(networkConfigSection); } - @Test(testName = "GET /vAppTemplate/{id}/networkConnectionSection") + @Test(description = "GET /vAppTemplate/{id}/networkConnectionSection") public void testGetNetworkConnectionSection() { getNetworkConnectionSection(new Function() { @Override @@ -194,21 +194,21 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { }); } - @Test(testName = "GET /vAppTemplate/{id}/networkSection") + @Test(description = "GET /vAppTemplate/{id}/networkSection") public void testGetVAppTemplateNetworkSection() { NetworkSection networkSection = vAppTemplateClient.getVAppTemplateNetworkSection(vAppTemplateURI); checkOvfNetworkSection(networkSection); } - @Test(testName = "GET /vAppTemplate/{id}/ovf") + @Test(description = "GET /vAppTemplate/{id}/ovf") public void testGetVAppTemplateOvf() { Envelope envelope = vAppTemplateClient.getVAppTemplateOvf(vAppTemplateURI); checkOvfEnvelope(envelope); } - @Test(testName = "PUT /vAppTemplate/{id}") + @Test(description = "PUT /vAppTemplate/{id}") public void testEditVAppTemplate() { String name = name("myname-"); String description = name("Description "); @@ -225,7 +225,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(newTemplate.getDescription(), description); } - @Test(testName = "POST /vAppTemplate/{id}/metadata", dependsOnMethods = { "testGetVAppTemplate" }) + @Test(description = "POST /vAppTemplate/{id}/metadata", dependsOnMethods = { "testGetVAppTemplate" }) public void testEditMetadata() { // TODO Cleanup after ourselves.. @@ -248,7 +248,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { checkMetadataFor("vAppTemplate", newMetadata, expectedMetadataMap); } - @Test(testName = "PUT /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testEditMetadata" }) + @Test(description = "PUT /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testEditMetadata" }) public void testEditMetadataValue() { // TODO Cleanup after ourselves.. @@ -263,7 +263,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(newMetadataValue.getValue(), metadataValue.getValue()); } - @Test(testName = "DELETE /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" }) + @Test(description = "DELETE /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" }) public void testDeleteVAppTemplateMetadataValue() { // First store a value String key = name("key-"); @@ -280,7 +280,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { checkMetadataKeyAbsentFor("vAppTemplate", newMetadata, key); } - @Test(testName = "PUT /vAppTemplate/{id}/guestCustomizationSection") + @Test(description = "PUT /vAppTemplate/{id}/guestCustomizationSection") public void testEditGuestCustomizationSection() { String computerName = name("n"); GuestCustomizationSection newSection = GuestCustomizationSection.builder() @@ -297,7 +297,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(modified.getComputerName(), computerName); } - @Test(testName = "PUT /vAppTemplate/{id}/customizationSection") + @Test(description = "PUT /vAppTemplate/{id}/customizationSection") public void testEditCustomizationSection() { boolean oldVal = vAppTemplateClient.getVAppTemplateCustomizationSection(vAppTemplateURI).isCustomizeOnInstantiate(); boolean newVal = !oldVal; @@ -315,7 +315,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { } // FIXME deploymentLeaseInSeconds returned is null - @Test(testName = "PUT /vAppTemplate/{id}/leaseSettingsSection") + @Test(description = "PUT /vAppTemplate/{id}/leaseSettingsSection") public void testEditLeaseSettingsSection() throws Exception { int deploymentLeaseInSeconds = random.nextInt(10000)+1; // NOTE use smallish number for storageLeaseInSeconds; it seems to be capped at 5184000? @@ -335,7 +335,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertEquals(newLeaseSettingsSection.getDeploymentLeaseInSeconds(), (Integer) deploymentLeaseInSeconds); } - @Test(testName = "PUT /vAppTemplate/{id}/networkConfigSection") + @Test(description = "PUT /vAppTemplate/{id}/networkConfigSection") public void testEditNetworkConfigSection() { // TODO What to modify? @@ -368,7 +368,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { // assertEquals(newVAppNetworkConfig.getNetworkName(), networkName); } - @Test(testName = "PUT /vAppTemplate/{id}/networkConnectionSection") + @Test(description = "PUT /vAppTemplate/{id}/networkConnectionSection") public void testEditNetworkConnectionSection() { // Look up a network in the Vdc Set networks = vdc.getAvailableNetworks(); @@ -391,7 +391,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { } // FIXME cloneVAppTemplate is giving back 500 error - @Test(testName = "DELETE /vAppTemplate/{id}", dependsOnMethods = { "testGetVAppTemplate" }) + @Test(description = "DELETE /vAppTemplate/{id}", dependsOnMethods = { "testGetVAppTemplate" }) public void testDeleteVAppTemplate() throws Exception { VAppTemplate clonedVappTemplate = cloneVAppTemplate(true); @@ -411,7 +411,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { } } - @Test(testName = "POST /vAppTemplate/{id}/action/disableDownload") + @Test(description = "POST /vAppTemplate/{id}/action/disableDownload") public void testDisableVAppTemplateDownload() throws Exception { vAppTemplateClient.disableDownloadVappTemplate(vAppTemplateURI); @@ -425,7 +425,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { // assertFalse(hasLinkMatchingRel(links, "download.*"), "Should not offer download link after disabling download: "+vAppTemplate); } - @Test(testName = "POST /vAppTemplate/{id}/action/enableDownload") + @Test(description = "POST /vAppTemplate/{id}/action/enableDownload") public void testEnableVAppTemplateDownload() throws Exception { // First disable so that enable really has some work to do... vAppTemplateClient.disableDownloadVappTemplate(vAppTemplateURI); @@ -452,7 +452,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { return false; } - @Test(testName = "POST /vAppTemplate/{id}/action/consolidate") + @Test(description = "POST /vAppTemplate/{id}/action/consolidate") public void testConsolidateVAppTemplate() throws Exception { final Task task = vAppTemplateClient.consolidateVappTemplate(vm.getHref()); assertTaskSucceedsLong(task); @@ -460,7 +460,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { // TODO Need assertion that command had effect } - @Test(testName = "POST /vAppTemplate/{id}/action/relocate") // FIXME Need a datastore reference + @Test(description = "POST /vAppTemplate/{id}/action/relocate") // FIXME Need a datastore reference public void testRelocateVAppTemplate() throws Exception { // TODO Need assertion that command had effect Reference dataStore = null; // FIXME @@ -472,7 +472,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { assertTaskSucceedsLong(task); } - @Test(testName = "GET /vAppTemplate/{id}/shadowVms") + @Test(description = "GET /vAppTemplate/{id}/shadowVms") public void testGetShadowVms() { References references = vAppTemplateClient.getShadowVms(vAppTemplateURI); @@ -481,7 +481,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest { // This failed previously, but is passing now. // However, it's not part of the official API so not necessary to assert it. - @Test(testName = "test completed task not included in vAppTemplate") + @Test(description = "test completed task not included in vAppTemplate") public void testCompletedTaskNotIncludedInVAppTemplate() throws Exception { // Kick off a task, and wait for it to complete vAppTemplateClient.disableDownloadVappTemplate(vAppTemplateURI); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VdcClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VdcClientLiveTest.java index 4214aae07e..0b628da2fc 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VdcClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VdcClientLiveTest.java @@ -119,7 +119,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC)); } - @Test(testName = "GET /vdc/{id}") + @Test(description = "GET /vdc/{id}") public void testGetVdc() { Vdc vdc = vdcClient.getVdc(vdcURI); assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC)); @@ -128,7 +128,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkVdc(vdc); } - @Test(testName = "POST /vdc/{id}/action/captureVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } ) + @Test(description = "POST /vdc/{id}/action/captureVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } ) public void testCaptureVApp() { String name = name("captured-"); @@ -151,7 +151,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { String.format(OBJ_FIELD_EQ, "VAppTemplate", "name", name, capturedVAppTemplate.getName())); } - @Test(testName = "POST /vdc/{id}/action/cloneVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } ) + @Test(description = "POST /vdc/{id}/action/cloneVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } ) public void testCloneVApp() { CloneVAppParams cloneVappParams = CloneVAppParams.builder() .source(instantiatedVApp.getHref()) @@ -179,7 +179,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkVApp(clonedVApp); } - @Test(testName = "POST /vdc/{id}/action/cloneVAppTemplate") + @Test(description = "POST /vdc/{id}/action/cloneVAppTemplate") public void testCloneVAppTemplate() { clonedVAppTemplate = vdcClient.cloneVAppTemplate(vdcURI, CloneVAppTemplateParams.builder() .source(vAppTemplateURI) @@ -192,7 +192,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkVAppTemplate(clonedVAppTemplate); } - @Test(testName = "POST /vdc/{id}/action/composeVApp") + @Test(description = "POST /vdc/{id}/action/composeVApp") public void testComposeVApp() { String name = name("composed-"); @@ -224,7 +224,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } // TODO Duplicates code in VAppClientLiveTest - @Test(testName = "POST /vdc/{id}/action/instantiateVAppTemplate") + @Test(description = "POST /vdc/{id}/action/instantiateVAppTemplate") public void testInstantiateVAppTemplate() { Vdc vdc = vdcClient.getVdc(vdcURI); @@ -275,7 +275,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkVApp(instantiatedVApp); } - @Test(testName = "POST /vdc/{id}/action/uploadVAppTemplate") + @Test(description = "POST /vdc/{id}/action/uploadVAppTemplate") public void testUploadVAppTemplate() { // TODO Should test all 4 stages of upload; currently doing only stage 1 here. // 1. creating empty vApp template entity @@ -307,13 +307,13 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { } - @Test(testName = "vdcClient admin metadata configuration", dependsOnMethods = { "testGetVdc" } ) + @Test(description = "vdcClient admin metadata configuration", dependsOnMethods = { "testGetVdc" } ) public void testSetupMetadata() { context.getApi().getAdminVdcClient().getMetadataClient().setMetadata(toAdminUri(vdcURI), "key", MetadataValue.builder().value("value").build()); } - @Test(testName = "GET /vdc/{id}/metadata", dependsOnMethods = { "testSetupMetadata" } ) + @Test(description = "GET /vdc/{id}/metadata", dependsOnMethods = { "testSetupMetadata" } ) public void testGetMetadata() { Metadata metadata = vdcClient.getMetadataClient().getMetadata(vdcURI); @@ -324,7 +324,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest { Checks.checkMetadataFor(VDC, metadata); } - @Test(testName = "GET /vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" } ) + @Test(description = "GET /vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" } ) public void testGetMetadataValue() { // First find a key Metadata metadata = vdcClient.getMetadataClient().getMetadata(vdcURI); From 9e860a2328741ee17e657cccc82c557c571c781c Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Tue, 27 Mar 2012 12:28:13 +0100 Subject: [PATCH 2/5] Issue 830: Use XmlElementWrapper annotation where possible --- .../director/v1_5/domain/AccessSettings.java | 122 ------------ .../director/v1_5/domain/AdminCatalog.java | 2 + .../vcloud/director/v1_5/domain/AdminOrg.java | 159 +++++++++------- .../director/v1_5/domain/CatalogItems.java | 130 ------------- .../director/v1_5/domain/CatalogType.java | 44 +++-- .../director/v1_5/domain/CatalogsList.java | 129 ------------- .../v1_5/domain/ControlAccessParams.java | 35 ++-- .../director/v1_5/domain/EntityType.java | 19 +- .../vcloud/director/v1_5/domain/Group.java | 52 +++--- .../director/v1_5/domain/GroupsList.java | 165 ---------------- .../vcloud/director/v1_5/domain/Networks.java | 172 ----------------- .../director/v1_5/domain/UsersList.java | 166 ----------------- .../vcloud/director/v1_5/domain/Vdcs.java | 176 ------------------ .../vcloud/director/v1_5/domain/Checks.java | 91 +++------ .../AdminCatalogClientExpectTest.java | 45 ++--- .../features/AdminOrgClientExpectTest.java | 17 +- .../features/CatalogClientExpectTest.java | 24 +-- .../v1_5/features/VAppClientLiveTest.java | 9 +- 18 files changed, 248 insertions(+), 1309 deletions(-) delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogItems.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogsList.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GroupsList.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Networks.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UsersList.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdcs.java diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java deleted file mode 100644 index 8d75f1dfd9..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.*; -import static com.google.common.base.Preconditions.*; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import com.google.common.base.Objects; -import com.google.common.collect.Lists; - -/** - * A list of access settings for a resource. - * - *
- * <complexType name="AccessSettings" />
- * 
- * - * @since 0.9 - */ -@XmlRootElement(name = "AccessSettings") -@XmlType(name = "AccessSettingsType") -public class AccessSettings { - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromAccessSettings(this); - } - - public static class Builder { - - private List accessSettings = Lists.newArrayList(); - - /** - * @see AccessSettings#getAccessSettings() - */ - public Builder accessSettings(List accessSettings) { - this.accessSettings = checkNotNull(accessSettings, "accessSettings"); - return this; - } - - /** - * @see AccessSettings#getAccessSettings() - */ - public Builder accessSetting(AccessSetting accessSetting) { - this.accessSettings.add(checkNotNull(accessSetting, "accessSetting")); - return this; - } - - public AccessSettings build() { - return new AccessSettings(accessSettings); - } - - public Builder fromAccessSettings(AccessSettings in) { - return accessSettings(in.getAccessSettings()); - } - } - - protected AccessSettings() { - // For JAXB and builder use - } - - public AccessSettings(List accessSettings) { - this.accessSettings = accessSettings; - } - - @XmlElement(name = "AccessSetting", required = true) - protected List accessSettings = Lists.newArrayList(); - - /** - * Gets the value of the accessSetting property. - */ - public List getAccessSettings() { - return accessSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - AccessSettings that = AccessSettings.class.cast(o); - return equal(this.accessSettings, that.accessSettings); - } - - @Override - public int hashCode() { - return Objects.hashCode(accessSettings); - } - - @Override - public String toString() { - return Objects.toStringHelper("").add("accessSettings", accessSettings).toString(); - } -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminCatalog.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminCatalog.java index f9d3170b76..3c0683066f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminCatalog.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminCatalog.java @@ -45,6 +45,7 @@ public class AdminCatalog extends CatalogType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromAdminCatalog(this); } @@ -54,6 +55,7 @@ public class AdminCatalog extends CatalogType { public static abstract class Builder> extends CatalogType.Builder { + @Override public AdminCatalog build() { return new AdminCatalog(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminOrg.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminOrg.java index 76a83f8cd0..4ab924e91e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminOrg.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AdminOrg.java @@ -19,15 +19,19 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Set; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; /** * The AdminOrg represents an administrative view of an organization. @@ -67,6 +71,7 @@ public class AdminOrg extends Org { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromAdminOrg(this); } @@ -77,11 +82,11 @@ public class AdminOrg extends Org { public static abstract class Builder> extends Org.Builder { private OrgSettings settings; - private UsersList users; - private GroupsList groups; - private CatalogsList catalogs; - private Vdcs vdcs; - private Networks networks; + private Set users = Sets.newLinkedHashSet(); + private Set groups = Sets.newLinkedHashSet(); + private Set catalogs = Sets.newLinkedHashSet(); + private Set vdcs = Sets.newLinkedHashSet(); + private Set networks = Sets.newLinkedHashSet(); /** * @see AdminOrg#getSettings() @@ -94,43 +99,82 @@ public class AdminOrg extends Org { /** * @see AdminOrg#getUsers() */ - public B users(UsersList users) { - this.users = users; + public B users(Iterable users) { + this.users = Sets.newLinkedHashSet(checkNotNull(users, "users")); + return self(); + } + + /** + * @see AdminOrg#getUsers() + */ + public B user(Reference user) { + users.add(checkNotNull(user, "user")); return self(); } /** * @see AdminOrg#getGroups() */ - public B groups(GroupsList groups) { - this.groups = groups; + public B groups(Iterable groups) { + this.groups = Sets.newLinkedHashSet(checkNotNull(groups, "groups")); + return self(); + } + + /** + * @see AdminOrg#getGroups() + */ + public B group(Reference group) { + groups.add(checkNotNull(group, "group")); return self(); } - /** * @see AdminOrg#getCatalogs() */ - public B catalogs(CatalogsList catalogs) { - this.catalogs = catalogs; + public B catalogs(Iterable catalogReferences) { + this.catalogs = Sets.newLinkedHashSet(checkNotNull(catalogs, "catalogs")); + return self(); + } + + /** + * @see AdminOrg#getCatalogs() + */ + public B catalog(Reference catalog) { + this.catalogs.add(checkNotNull(catalog, "catalog")); return self(); } - /** * @see AdminOrg#getVdcs() */ - public B vdcs(Vdcs vdcs) { - this.vdcs = vdcs; + public B vdcs(Iterable vdcs) { + this.vdcs = Sets.newLinkedHashSet(checkNotNull(vdcs, "vdcs")); return self(); } - + + /** + * @see AdminOrg#getVdcs() + */ + public B vdc(Reference vdc) { + this.vdcs.add(checkNotNull(vdc, "vdc")); + return self(); + } + /** * @see AdminOrg#getNetworks() */ - public B networks(Networks networks) { - this.networks = networks; + public B networks(Iterable networks) { + this.networks = Sets.newLinkedHashSet(checkNotNull(networks, "networks")); + return self(); + } + + /** + * @see AdminOrg#getNetworks() + */ + public B network(Reference network) { + this.networks.add(checkNotNull(network, "network")); return self(); } + @Override public AdminOrg build() { return new AdminOrg(this); } @@ -153,33 +197,33 @@ public class AdminOrg extends Org { protected AdminOrg(Builder builder) { super(builder); this.settings = builder.settings; - this.users = builder.users; - this.groups = builder.groups; - this.catalogs = builder.catalogs; - this.vdcs = builder.vdcs; - this.networks = builder.networks; + this.users = builder.users == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(builder.users); + this.groups = builder.groups == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(builder.groups); + this.catalogs = builder.catalogs == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(builder.catalogs); + this.vdcs = builder.vdcs == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(builder.vdcs); + this.networks = builder.networks == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(builder.networks); } @XmlElement(name = "Settings", required = true) private OrgSettings settings; - @XmlElement(name = "Users") - private UsersList users; - @XmlElement(name = "Groups") - private GroupsList groups; - @XmlElement(name = "Catalogs") - private CatalogsList catalogs; - @XmlElement(name = "Vdcs") - private Vdcs vdcs; - @XmlElement(name = "Networks") - private Networks networks; + @XmlElementWrapper(name = "Users") + @XmlElement(name = "UserReference") + protected Set users = Sets.newLinkedHashSet(); + @XmlElementWrapper(name = "Groups") + @XmlElement(name = "GroupReference") + protected Set groups = Sets.newLinkedHashSet(); + @XmlElementWrapper(name = "Catalogs") + @XmlElement(name = "CatalogReference") + private Set catalogs = Sets.newLinkedHashSet(); + @XmlElementWrapper(name = "Vdcs") + @XmlElement(name = "Vdc") + protected Set vdcs = Sets.newLinkedHashSet(); + @XmlElementWrapper(name = "Networks") + @XmlElement(name = "Network") + protected Set networks = Sets.newLinkedHashSet(); /** * Gets the value of the settings property. - * - * @return - * possible object is - * {@link OrgSettings } - * */ public OrgSettings getSettings() { return settings; @@ -187,61 +231,36 @@ public class AdminOrg extends Org { /** * Gets the value of the users property. - * - * @return - * possible object is - * {@link UsersList } - * */ - public UsersList getUsers() { + public Set getUsers() { return users; } /** * Gets the value of the groups property. - * - * @return - * possible object is - * {@link GroupsList } - * */ - public GroupsList getGroups() { + public Set getGroups() { return groups; } /** * Gets the value of the catalogs property. - * - * @return - * possible object is - * {@link CatalogsList } - * */ - public CatalogsList getCatalogs() { + public Set getCatalogs() { return catalogs; } /** * Gets the value of the vdcs property. - * - * @return - * possible object is - * {@link Vdcs } - * */ - public Vdcs getVdcs() { + public Set getVdcs() { return vdcs; } /** * Gets the value of the networks property. - * - * @return - * possible object is - * {@link Networks } - * */ - public Networks getNetworks() { + public Set getNetworks() { return networks; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogItems.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogItems.java deleted file mode 100644 index 6e0a09cff1..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogItems.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Collection; -import java.util.Collections; -import java.util.Set; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - -/** - * Represents a list of catalog item references. - *

- *

- * <complexType name="CatalogItemsType" />
- * 
- * - * @author grkvlt@apache.org - */ -@XmlRootElement(name = "CatalogItems") -public class CatalogItems { - - public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS; - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(); - } - - public static class Builder { - - private Set catalogItems = Sets.newLinkedHashSet(); - - /** - * @see CatalogItems#getCatalogItems() - */ - public Builder items(Collection catalogItems) { - this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems")); - return this; - } - - /** - * @see CatalogItems#getCatalogItems() - */ - public Builder item(Reference catalogItem) { - this.catalogItems.add(checkNotNull(catalogItem, "catalogItem")); - return this; - } - - public CatalogItems build() { - return new CatalogItems(catalogItems); - } - - public Builder fromCatalogItems(CatalogItems in) { - return items(in.getCatalogItems()); - } - } - - private CatalogItems() { - // For JAXB - } - - private CatalogItems(Set catalogItems) { - this.catalogItems = ImmutableSet.copyOf(catalogItems); - } - - @XmlElement(name = "CatalogItem") - private Set catalogItems = Sets.newLinkedHashSet(); - - /** - * Gets the value of the catalogItems property. - */ - public Set getCatalogItems() { - return Collections.unmodifiableSet(this.catalogItems); - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - CatalogItems that = CatalogItems.class.cast(o); - return equal(this.catalogItems, that.catalogItems); - } - - @Override - public int hashCode() { - return Objects.hashCode(catalogItems); - } - - @Override - public String toString() { - return string().toString(); - } - - protected ToStringHelper string() { - return Objects.toStringHelper("").add("catalogItems", catalogItems); - } -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogType.java index 8880d7e25e..91fe4de009 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogType.java @@ -19,16 +19,22 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Set; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; /** * Container for references to VappTemplate and Media objects. - *

+ * *

  * <complexType name="CatalogType" />
  * 
@@ -42,6 +48,7 @@ public class CatalogType extends EntityType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromCatalogType(this); } @@ -52,7 +59,7 @@ public class CatalogType extends EntityType { public static class Builder> extends EntityType.Builder { private Owner owner; - private CatalogItems catalogItems; + private Set catalogItems = Sets.newLinkedHashSet(); private Boolean isPublished; /** @@ -64,10 +71,18 @@ public class CatalogType extends EntityType { } /** - * @see CatalogType#getCatalogItems() + * @see CatalogItems#getCatalogItems() */ - public B catalogItems(CatalogItems catalogItems) { - this.catalogItems = catalogItems; + public B items(Iterable catalogItems) { + this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems")); + return self(); + } + + /** + * @see CatalogItems#getCatalogItems() + */ + public B item(Reference catalogItem) { + this.catalogItems.add(checkNotNull(catalogItem, "catalogItem")); return self(); } @@ -93,14 +108,14 @@ public class CatalogType extends EntityType { } public B fromCatalogType(CatalogType in) { - return fromEntityType(in).owner(in.getOwner()).catalogItems(in.getCatalogItems()).isPublished(in.isPublished()); + return fromEntityType(in).owner(in.getOwner()).items(in.getCatalogItems()).isPublished(in.isPublished()); } } protected CatalogType(Builder builder) { super(builder); this.owner = builder.owner; - this.catalogItems = builder.catalogItems; + this.catalogItems = builder.catalogItems == null || builder.catalogItems.isEmpty() ? null : ImmutableSet.copyOf(builder.catalogItems); this.isPublished = builder.isPublished; } @@ -110,8 +125,9 @@ public class CatalogType extends EntityType { @XmlElement(name = "Owner") private Owner owner; - @XmlElement(name = "CatalogItems") - private CatalogItems catalogItems; + @XmlElementWrapper(name = "CatalogItems") + @XmlElement(name = "CatalogItem") + private Set catalogItems; @XmlElement(name = "IsPublished") private Boolean isPublished; @@ -125,8 +141,8 @@ public class CatalogType extends EntityType { /** * Gets the value of the catalogItems property. */ - public CatalogItems getCatalogItems() { - return catalogItems; + public Set getCatalogItems() { + return catalogItems == null ? ImmutableSet.of() : ImmutableSet.copyOf(catalogItems); } /** @@ -145,19 +161,19 @@ public class CatalogType extends EntityType { CatalogType that = CatalogType.class.cast(o); return super.equals(that) && equal(this.owner, that.owner) && - equal(this.catalogItems, that.catalogItems) && + equal(this.getCatalogItems(), that.getCatalogItems()) && equal(this.isPublished, that.isPublished); } @Override public int hashCode() { - return Objects.hashCode(super.hashCode(), owner, catalogItems, catalogItems); + return Objects.hashCode(super.hashCode(), owner, getCatalogItems(), catalogItems); } @Override public ToStringHelper string() { return super.string().add("owner", owner) - .add("catalogItems", catalogItems) + .add("catalogItems", getCatalogItems()) .add("isPublished", isPublished); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogsList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogsList.java deleted file mode 100644 index ee0b2af588..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CatalogsList.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Collections; -import java.util.Set; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - -/** - * Container for ReferenceType elements that reference catalogs. - *

- *

- * <complexType name="CatalogsListType" />
- * 
- * - * @author grkvlt@apache.org - */ -@XmlRootElement(name = "CatalogsList") -public class CatalogsList { - - public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS; - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(); - } - - public static class Builder { - - private Set catalogReferences = Sets.newLinkedHashSet(); - - /** - * @see CatalogsList#getCatalogItems() - */ - public Builder catalogs(Set catalogReferences) { - this.catalogReferences = checkNotNull(catalogReferences, "catalogReferences"); - return this; - } - - /** - * @see CatalogsList#getCatalogItems() - */ - public Builder catalog(Reference catalog) { - this.catalogReferences.add(checkNotNull(catalog, "catalog")); - return this; - } - - public CatalogsList build() { - return new CatalogsList(catalogReferences); - } - - public Builder fromCatalogsList(CatalogsList in) { - return catalogs(in.getCatalogItems()); - } - } - - private CatalogsList() { - // for JAXB - } - - private CatalogsList(Set catalogReferences) { - this.catalogReferences = ImmutableSet.copyOf(checkNotNull(catalogReferences, "catalogReferences")); - } - - @XmlElement(name = "CatalogReference") - private Set catalogReferences = Sets.newLinkedHashSet(); - - /** - * Gets the value of the catalogReferences property. - */ - public Set getCatalogItems() { - return Collections.unmodifiableSet(this.catalogReferences); - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - CatalogsList that = CatalogsList.class.cast(o); - return equal(this.catalogReferences, that.catalogReferences); - } - - @Override - public int hashCode() { - return Objects.hashCode(catalogReferences); - } - - @Override - public String toString() { - return string().toString(); - } - - protected ToStringHelper string() { - return Objects.toStringHelper("").add("catalogReferences", catalogReferences); - } -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java index 7259eea2a3..6272246149 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java @@ -18,15 +18,19 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.*; +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Set; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; /** * Used to control access to resources. @@ -53,7 +57,7 @@ public class ControlAccessParams { private Boolean sharedToEveryone = Boolean.FALSE; private String everyoneAccessLevel; - private AccessSettings accessSettings; + private Set accessSettings = Sets.newLinkedHashSet(); /** * @see ControlAccessParams#getIsSharedToEveryone() @@ -90,8 +94,16 @@ public class ControlAccessParams { /** * @see ControlAccessParams#getAccessSettings() */ - public Builder accessSettings(AccessSettings accessSettings) { - this.accessSettings = accessSettings; + public Builder accessSettings(Iterable accessSettings) { + this.accessSettings = Sets.newLinkedHashSet(checkNotNull(accessSettings, "accessSettings")); + return this; + } + + /** + * @see ControlAccessParams#getAccessSettings() + */ + public Builder accessSetting(AccessSetting accessSetting) { + this.accessSettings.add(checkNotNull(accessSetting, "accessSetting")); return this; } @@ -109,18 +121,19 @@ public class ControlAccessParams { // For JAXB and builder use } - public ControlAccessParams(Boolean sharedToEveryone, String everyoneAccessLevel, AccessSettings accessSettings) { + public ControlAccessParams(Boolean sharedToEveryone, String everyoneAccessLevel, Iterable accessSettings) { this.sharedToEveryone = sharedToEveryone; this.everyoneAccessLevel = everyoneAccessLevel; - this.accessSettings = accessSettings; + this.accessSettings = accessSettings == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(accessSettings); } @XmlElement(name = "IsSharedToEveryone", required = true) protected Boolean sharedToEveryone; @XmlElement(name = "EveryoneAccessLevel") protected String everyoneAccessLevel; - @XmlElement(name = "AccessSettings") - protected AccessSettings accessSettings; + @XmlElementWrapper(name = "AccessSettings") + @XmlElement(name = "AccessSetting") + protected Set accessSettings = Sets.newLinkedHashSet(); /** * If true, this means that the resource is shared with everyone in the organization. @@ -143,7 +156,7 @@ public class ControlAccessParams { * * Required on create and modify if {@link #isSharedToEveryone()} is false. */ - public AccessSettings getAccessSettings() { + public Set getAccessSettings() { return accessSettings; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java index 970ee7d19c..20fa5a53ab 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java @@ -19,6 +19,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; import java.util.Collections; import java.util.Set; @@ -52,6 +53,7 @@ public class EntityType extends ResourceType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromEntityType(this); } @@ -62,7 +64,7 @@ public class EntityType extends ResourceType { public static abstract class Builder> extends ResourceType.Builder { private String description; - private Set tasks; + private Set tasks = Sets.newLinkedHashSet(); private String name; private String id; @@ -93,8 +95,16 @@ public class EntityType extends ResourceType { /** * @see EntityType#getTasks() */ - public B tasks(Set tasks) { - this.tasks = tasks; + public B tasks(Iterable tasks) { + this.tasks = Sets.newLinkedHashSet(checkNotNull(tasks, "tasks")); + return self(); + } + + /** + * @see EntityType#getTasks() + */ + public B task(Task task) { + this.tasks.add(checkNotNull(task, "task")); return self(); } @@ -105,7 +115,7 @@ public class EntityType extends ResourceType { public B fromEntityType(EntityType in) { return fromResourceType(in) - .description(in.getDescription()).tasks(Sets.newLinkedHashSet(in.getTasks())) + .description(in.getDescription()).tasks(in.getTasks()) .id(in.getId()).name(in.getName()); } } @@ -123,7 +133,6 @@ public class EntityType extends ResourceType { protected EntityType(Builder builder) { super(builder); this.description = builder.description; - // nullable so that jaxb wont persist empty collections this.tasks = builder.tasks == null || builder.tasks.isEmpty() ? null : ImmutableSet.copyOf(builder.tasks); this.id = builder.id; this.name = builder.name; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java index 0d49bb5156..790b0fa06d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java @@ -20,14 +20,20 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Set; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; /** @@ -69,6 +75,7 @@ public class Group extends EntityType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromGroup(this); } @@ -79,7 +86,7 @@ public class Group extends EntityType { public static abstract class Builder> extends EntityType.Builder { private String nameInSource; - private UsersList usersList; + private Set users = Sets.newLinkedHashSet(); private Reference role; /** @@ -91,10 +98,18 @@ public class Group extends EntityType { } /** - * @see Group#getUsersList() + * @see Group#getUsers() */ - public B usersList(UsersList usersList) { - this.usersList = usersList; + public B users(Iterable users) { + this.users = Sets.newLinkedHashSet(checkNotNull(users, "users")); + return self(); + } + + /** + * @see Group#getUsers() + */ + public B user(Reference user) { + users.add(checkNotNull(user, "user")); return self(); } @@ -106,6 +121,7 @@ public class Group extends EntityType { return self(); } + @Override public Group build() { return new Group(this); } @@ -113,7 +129,7 @@ public class Group extends EntityType { public B fromGroup(Group in) { return fromEntityType(in) .nameInSource(in.getNameInSource()) - .usersList(in.getUsersList()) + .users(in.getUsersList()) .role(in.getRole()); } } @@ -126,48 +142,34 @@ public class Group extends EntityType { protected Group(Builder builder) { super(builder); this.nameInSource = builder.nameInSource; - this.usersList = builder.usersList; + this.usersList = builder.users == null ? Sets.newLinkedHashSet() : ImmutableSet.copyOf(builder.users); this.role = builder.role; } @XmlElement(name = "NameInSource") protected String nameInSource; - @XmlElement(name = "UsersList") - protected UsersList usersList; + @XmlElementWrapper(name = "UsersList") + @XmlElement(name = "UserReference") + protected Set usersList = Sets.newLinkedHashSet(); @XmlElement(name = "Role") protected Reference role; /** * Gets the value of the nameInSource property. - * - * @return - * possible object is - * {@link String } - * */ public String getNameInSource() { return nameInSource; } /** - * Gets the value of the usersList property. - * - * @return - * possible object is - * {@link UsersList } - * + * Gets the value of the users property. */ - public UsersList getUsersList() { + public Set getUsersList() { return usersList; } /** * Gets the value of the role property. - * - * @return - * possible object is - * {@link Reference } - * */ public Reference getRole() { return role; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GroupsList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GroupsList.java deleted file mode 100644 index 6c644b4a18..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GroupsList.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableList; - - -/** - * - * Container for ReferenceType elements that reference groups. - * - * - *

Java class for GroupsList complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="GroupsList">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element name="GroupReference" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "GroupsList") -@XmlType(propOrder = { - "groups" -}) -public class GroupsList { - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromGroupsList(this); - } - - public static class Builder { - private List groups; - - /** - * @see GroupsList#getGroupReference() - */ - public Builder groups(List groups) { - this.groups = ImmutableList.copyOf(groups); - return this; - } - - /** - * @see GroupsList#getGroupReference() - */ - public Builder group(Reference group) { - groups.add(checkNotNull(group, "group")); - return this; - } - - public GroupsList build() { - return new GroupsList(groups); - } - - public Builder fromGroupsList(GroupsList in) { - return groups(in.getGroups()); - } - } - - private GroupsList() { - // For JAXB - } - - private GroupsList(List groups) { - this.groups = groups; - } - - @XmlElement(name = "GroupReference") - protected List groups; - - /** - * Gets the value of the groupReference property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the groupReference property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getGroupReference().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Reference } - * - * - */ - public List getGroups() { - if (groups == null) { - groups = new ArrayList(); - } - return this.groups; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - GroupsList that = GroupsList.class.cast(o); - return equal(groups, that.groups); - } - - @Override - public int hashCode() { - return Objects.hashCode(groups); - } - - @Override - public String toString() { - return Objects.toStringHelper("") - .add("groups", groups).toString(); - } - -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Networks.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Networks.java deleted file mode 100644 index 6509e9f213..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Networks.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - - -/** - * - * Container for ReferenceType elements that reference ExternalNetwork objects. - * This element is created by the server and is read only. - * - * - *

Java class for Networks complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Networks">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element name="Network" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Networks", propOrder = { - "networks" -}) -public class Networks { - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNetworks(this); - } - - public static class Builder { - - private List networks = Lists.newArrayList(); - - /** - * @see Networks#getNetwork() - */ - public Builder networks(List networks) { - this.networks = ImmutableList.copyOf(networks); - return this; - } - - /** - * @see Networks#getNetwork() - */ - public Builder network(Reference network) { - this.networks.add(checkNotNull(network, "network")); - return this; - } - - public Networks build() { - return new Networks(networks); - } - - - public Builder fromNetworks(Networks in) { - return networks(in.getNetwork()); - } - } - - private Networks() { - // For JAXB - } - - private Networks(List networks) { - this.networks = networks; - } - - @XmlElement(name = "Network") - protected List networks; - - /** - * Gets the value of the network property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the network property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getNetwork().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Reference } - * - * - */ - public List getNetwork() { - if (networks == null) { - networks = new ArrayList(); - } - return this.networks; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - Networks that = Networks.class.cast(o); - return equal(networks, that.networks); - } - - @Override - public int hashCode() { - return Objects.hashCode(networks); - } - - @Override - public String toString() { - return string().toString(); - } - - public ToStringHelper string() { - return Objects.toStringHelper("") - .add("networks", networks); - } - -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UsersList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UsersList.java deleted file mode 100644 index 26250eff5d..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UsersList.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - - -/** - * - * Container for ReferenceType elements that reference users. - * - * - *

Java class for UsersList complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="UsersList">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element name="UserReference" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "UsersList") -@XmlType(propOrder = { - "users" -}) -public class UsersList { - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromUsersList(this); - } - - public static class Builder { - private List users = Lists.newArrayList(); - - /** - * @see UsersList#getUsers() - */ - public Builder users(List users) { - this.users = ImmutableList.copyOf(users); - return this; - } - - /** - * @see UsersList#getUsers() - */ - public Builder user(Reference user) { - users.add(checkNotNull(user, "user")); - return this; - } - - public UsersList build() { - return new UsersList(users); - } - - public Builder fromUsersList(UsersList in) { - return users(in.getUsers()); - } - } - - private UsersList() { - // For JAXB and builder use - } - - private UsersList(List users) { - this.users = users; - } - - @XmlElement(name = "UserReference") - protected List users; - - /** - * Gets the value of the userReference property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the userReference property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getUserReference().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Reference } - * - * - */ - public List getUsers() { - if (users == null) { - users = new ArrayList(); - } - return this.users; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - UsersList that = UsersList.class.cast(o); - return equal(users, that.users); - } - - @Override - public int hashCode() { - return Objects.hashCode(users); - } - - @Override - public String toString() { - return Objects.toStringHelper("") - .add("userReference", users).toString(); - } - -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdcs.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdcs.java deleted file mode 100644 index 99f23f9ead..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdcs.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.jclouds.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - - -/** - * - * Represents a list of references to virtual data centers. - * - * - *

Java class for Vdcs complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Vdcs">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element name="Vdc" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "Vdcs") -@XmlType(propOrder = { - "vdcs" -}) -public class Vdcs { - - // FIXME Delete Vdcs, and use Set - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromVdcs(this); - } - - public static class Builder { - - private List vdcs = Lists.newArrayList(); - - /** - * @see Vdcs#getVdc() - */ - public Builder vdcs(List vdcs) { - this.vdcs = ImmutableList.copyOf(vdcs); - return this; - } - - /** - * @see Vdcs#getVdc() - */ - public Builder vdc(Reference vdc) { - this.vdcs.add(checkNotNull(vdc, "vdc")); - return this; - } - - public Vdcs build() { - return new Vdcs(vdcs); - } - - public Builder fromVdcs(Vdcs in) { - return vdcs(in.getVdcs()); - } - } - - private Vdcs() { - // For JAXB and builder use - } - - private Vdcs(List vdcs) { - this.vdcs = vdcs; - } - - - @XmlElement(name = "Vdc") - protected List vdcs; - - /** - * Gets the value of the vdc property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the vdc property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getVdc().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Reference } - * - * - */ - public List getVdcs() { - if (vdcs == null) { - vdcs = new ArrayList(); - } - return this.vdcs; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - Vdcs that = Vdcs.class.cast(o); - return equal(vdcs, that.vdcs); - } - - @Override - public int hashCode() { - return Objects.hashCode(vdcs); - } - - @Override - public String toString() { - return string().toString(); - } - - public ToStringHelper string() { - return Objects.toStringHelper("") - .add("vdcs", vdcs); - } - -} diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java index 659d53f85c..41a30749a4 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java @@ -68,6 +68,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecordType; import com.beust.jcommander.internal.Maps; import com.google.common.base.Splitter; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.net.InetAddresses; @@ -110,11 +111,18 @@ public class Checks { /** * Assumes the validTypes to be vcloud-specific types. * - * @see checkReferenceType(ReferenceType, Collection) + * @see #checkReferenceType(Reference, Collection) */ public static void checkReferenceType(Reference reference) { checkReferenceType(reference, VCloudDirectorMediaType.ALL); } + + /** + * @see #checkReferenceType(Reference, Collection) + */ + public static void checkReferenceType(Reference reference, String type) { + checkReferenceType(reference, ImmutableSet.of(type)); + } public static void checkReferenceType(Reference reference, Collection validTypes) { // Check required fields @@ -283,41 +291,26 @@ public class Checks { assertNotNull(org.getSettings(), String.format(NOT_NULL_OBJ_FIELD_FMT, "settings", "AdminOrg")); // optional - if (org.getGroups() != null) { - checkGroupsList(org.getGroups()); + for (Reference user : org.getUsers()) { + checkReferenceType(user, VCloudDirectorMediaType.ADMIN_USER); } - if (org.getCatalogs() != null) { - checkCatalogsList(org.getCatalogs()); + for (Reference group : org.getGroups()) { + checkReferenceType(group, VCloudDirectorMediaType.GROUP); } - if (org.getVdcs() != null) { - checkVdcs(org.getVdcs()); + for (Reference catalog : org.getCatalogs()) { + checkReferenceType(catalog, VCloudDirectorMediaType.ADMIN_CATALOG); } - if (org.getNetworks() != null) { - checkNetworks(org.getNetworks()); + for (Reference vdc : org.getVdcs()) { + checkReferenceType(vdc, VCloudDirectorMediaType.ADMIN_VDC); + } + for (Reference network : org.getNetworks()) { + checkReferenceType(network, VCloudDirectorMediaType.ADMIN_NETWORK); } // Check parent type checkOrg(org); } - public static void checkCatalogsList(CatalogsList catalogList) { - for (Reference catalogItem : catalogList.getCatalogItems()) { - checkReferenceType(catalogItem); - } - } - - public static void checkVdcs(Vdcs vdcs) { - for (Reference vdc : vdcs.getVdcs()) { - checkReferenceType(vdc); - } - } - - public static void checkNetworks(Networks networks) { - for (Reference network : networks.getNetwork()) { - checkReferenceType(network); - } - } - public static void checkAdminCatalog(AdminCatalog catalog) { // Check parent type checkCatalogType(catalog); @@ -327,11 +320,8 @@ public class Checks { // Check optional elements/attributes Owner owner = catalog.getOwner(); if (owner != null) checkOwner(owner); - CatalogItems catalogItems = catalog.getCatalogItems(); - if (catalogItems != null) { - for (Reference catalogItemReference : catalogItems.getCatalogItems()) { - checkReferenceType(catalogItemReference); - } + for (Reference catalogItemReference : catalog.getCatalogItems()) { + checkReferenceType(catalogItemReference, VCloudDirectorMediaType.CATALOG_ITEM); } // NOTE isPublished cannot be checked @@ -695,16 +685,9 @@ public class Checks { if (params.isSharedToEveryone()) { assertNotNull(params.getEveryoneAccessLevel(), String.format(OBJ_FIELD_REQ, "ControlAccessParams", "EveryoneAccessLevel")); } else { - AccessSettings accessSettings = params.getAccessSettings(); - checkAccessSettings(accessSettings); - } - } - - public static void checkAccessSettings(AccessSettings accessSettings) { - if (accessSettings != null && accessSettings.getAccessSettings() != null) { - for (AccessSetting setting : accessSettings.getAccessSettings()) { - checkAccessSetting(setting); - } + for (AccessSetting setting : params.getAccessSettings()) { + checkAccessSetting(setting); + } } } @@ -778,37 +761,19 @@ public class Checks { checkResourceEntityType(media); } - public static void checkGroupsList(GroupsList groupsList) { - // Check optional fields - if (groupsList.getGroups() != null) { - for (Reference group : groupsList.getGroups()) { - checkReferenceType(group); - } - } - } - public static void checkGroup(Group group) { // Check optional fields // NOTE nameInSource cannot be checked - if (group.getUsersList() != null) { - checkUsersList(group.getUsersList()); + for (Reference user : group.getUsersList()) { + checkReferenceType(user, VCloudDirectorMediaType.USER); } if (group.getRole() != null) { - checkReferenceType(group.getRole()); + checkReferenceType(group.getRole(), VCloudDirectorMediaType.ROLE); } // parent type checkEntityType(group); } - - public static void checkUsersList(UsersList usersList) { - // Check optional fields - if (usersList.getUsers() != null) { - for (Reference user : usersList.getUsers()) { - checkReferenceType(user); - } - } - } public static void checkOrgSettings(OrgSettings settings) { // Check optional fields diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java index 9921d41933..3ce56c12fc 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java @@ -25,7 +25,6 @@ import java.net.URI; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; -import org.jclouds.vcloud.director.v1_5.domain.CatalogItems; import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; @@ -37,7 +36,7 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableSet; /** - * Test the {@link CatalogClient} by observing its side effects. + * Test the {@link AdminCatalogClient} by observing its side effects. * * @author grkvlt@apache.org */ @@ -289,8 +288,6 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx .build()) .build()) .build()) - .catalogItems(CatalogItems.builder() - .build()) .isPublished(false) .build(); } @@ -337,27 +334,25 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx .build()) .description("Testing") .owner(owner()) - .catalogItems(CatalogItems.builder() - .item(Reference.builder() - .type("application/vnd.vmware.vcloud.catalogItem+xml") - .name("image") - .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/67a469a1-aafe-4b5b-bb31-a6202ad8961f")) - .build()) - .item(Reference.builder() - .type("application/vnd.vmware.vcloud.catalogItem+xml") - .name("ubuntu10") - .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df")) - .build()) - .item(Reference.builder() - .type("application/vnd.vmware.vcloud.catalogItem+xml") - .name("imageTesting") - .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939")) - .build()) - .item(Reference.builder() - .type("application/vnd.vmware.vcloud.catalogItem+xml") - .name("TestCase") - .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/f7598606-aea4-41d7-8f67-2090e28e7876")) - .build()) + .item(Reference.builder() + .type("application/vnd.vmware.vcloud.catalogItem+xml") + .name("image") + .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/67a469a1-aafe-4b5b-bb31-a6202ad8961f")) + .build()) + .item(Reference.builder() + .type("application/vnd.vmware.vcloud.catalogItem+xml") + .name("ubuntu10") + .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df")) + .build()) + .item(Reference.builder() + .type("application/vnd.vmware.vcloud.catalogItem+xml") + .name("imageTesting") + .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939")) + .build()) + .item(Reference.builder() + .type("application/vnd.vmware.vcloud.catalogItem+xml") + .name("TestCase") + .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/f7598606-aea4-41d7-8f67-2090e28e7876")) .build()) .isPublished(false) .build(); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientExpectTest.java index f2cd65ddf8..a98e91110d 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClientExpectTest.java @@ -25,10 +25,7 @@ import java.net.URI; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminOrg; -import org.jclouds.vcloud.director.v1_5.domain.CatalogsList; -import org.jclouds.vcloud.director.v1_5.domain.GroupsList; import org.jclouds.vcloud.director.v1_5.domain.Link; -import org.jclouds.vcloud.director.v1_5.domain.Networks; import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings; @@ -38,13 +35,11 @@ import org.jclouds.vcloud.director.v1_5.domain.OrgSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings; import org.jclouds.vcloud.director.v1_5.domain.Reference; import org.jclouds.vcloud.director.v1_5.domain.SmtpServerSettings; -import org.jclouds.vcloud.director.v1_5.domain.UsersList; -import org.jclouds.vcloud.director.v1_5.domain.Vdcs; import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest; import org.testng.annotations.Test; /** - * Test the {@link GroupClient} by observing its side effects. + * Test the {@link AdminOrgClient} by observing its side effects. * * @author danikov */ @@ -126,7 +121,6 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect .fullName("JClouds") .isEnabled(true) .settings(settings()) - .users(UsersList.builder() .user(Reference.builder() .type("application/vnd.vmware.admin.user+xml") .name("adam.lowe@cloudsoftcorp.com") @@ -152,10 +146,6 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect .name("adk@cloudsoftcorp.com") .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/user/e9eb1b29-0404-4c5e-8ef7-e584acc51da9")) .build()) - .build()) - .groups(GroupsList.builder() - .build()) - .catalogs(CatalogsList.builder() .catalog(Reference.builder() .type("application/vnd.vmware.admin.catalog+xml") .name("QunyingTestCatalog") @@ -176,15 +166,11 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect .name("test") .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/catalog/b7289d54-4ca4-497f-9a93-2d4afc97e3da")) .build()) - .build()) - .vdcs(Vdcs.builder() .vdc(Reference.builder() .type("application/vnd.vmware.vcloud.vdc+xml") .name("Cluster01-JClouds") .href(URI.create("https://vcloudbeta.bluelock.com/api/vdc/d16d333b-e3c0-4176-845d-a5ee6392df07")) .build()) - .build()) - .networks(Networks.builder() .network(Reference.builder() .type("application/vnd.vmware.admin.network+xml") .name("ilsolation01-Jclouds") @@ -195,7 +181,6 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect .name("internet01-Jclouds") .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/network/55a677cf-ab3f-48ae-b880-fab90421980c")) .build()) - .build()) .build(); } diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientExpectTest.java index 2d202cdc6a..a1883fedbc 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/CatalogClientExpectTest.java @@ -27,7 +27,6 @@ import org.jclouds.http.HttpResponse; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; -import org.jclouds.vcloud.director.v1_5.domain.CatalogItems; import org.jclouds.vcloud.director.v1_5.domain.CatalogType; import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.Metadata; @@ -376,7 +375,6 @@ public class CatalogClientExpectTest extends BaseVCloudDirectorRestClientExpectT assertEquals(client.getCatalogClient().getCatalogItemMetadataClient().deleteMetadataEntry(catalogItemURI, "KEY"), expected); } - @SuppressWarnings("unchecked") public static final CatalogType catalog() { return CatalogType.builder() .name("QunyingTestCatalog") @@ -398,18 +396,16 @@ public class CatalogClientExpectTest extends BaseVCloudDirectorRestClientExpectT .type("application/vnd.vmware.vcloud.metadata+xml") .href(URI.create("https://vcloudbeta.bluelock.com/api/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/metadata")) .build()) - .catalogItems(CatalogItems.builder() - .item(Reference.builder() - .type("application/vnd.vmware.vcloud.catalogItem+xml") - .name("ubuntu10") - .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df")) - .build()) - .item(Reference.builder() - .type("application/vnd.vmware.vcloud.catalogItem+xml") - .name("imageTesting") - .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939")) - .build()) - .build()) + .item(Reference.builder() + .type("application/vnd.vmware.vcloud.catalogItem+xml") + .name("ubuntu10") + .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df")) + .build()) + .item(Reference.builder() + .type("application/vnd.vmware.vcloud.catalogItem+xml") + .name("imageTesting") + .href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939")) + .build()) .description("Testing") .isPublished(false) .build(); diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java index f076865a66..dd8406b2b6 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java @@ -64,7 +64,6 @@ import java.util.concurrent.TimeUnit; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.domain.AccessSetting; -import org.jclouds.vcloud.director.v1_5.domain.AccessSettings; import org.jclouds.vcloud.director.v1_5.domain.Checks; import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams; import org.jclouds.vcloud.director.v1_5.domain.DeployVAppParams; @@ -325,11 +324,9 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest { public void testControlAccessUser() { ControlAccessParams params = ControlAccessParams.builder() .notSharedToEveryone() - .accessSettings(AccessSettings.builder() - .accessSetting(AccessSetting.builder() - .subject(Reference.builder().href(userURI).type(ADMIN_USER).build()) - .accessLevel("ReadOnly") - .build()) + .accessSetting(AccessSetting.builder() + .subject(Reference.builder().href(userURI).type(ADMIN_USER).build()) + .accessLevel("ReadOnly") .build()) .build(); From 8443bbe8f27bd0b04edc8b111e7648fb9024d446 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Tue, 27 Mar 2012 12:28:38 +0100 Subject: [PATCH 3/5] Issue 830: Tidy up domain object imports and remove unnecessary annotations --- .../director/v1_5/domain/AccessSetting.java | 5 +--- .../v1_5/domain/CaptureVAppParams.java | 11 +++----- .../v1_5/domain/CustomOrgLdapSettings.java | 19 +++---------- .../v1_5/domain/DeployVAppParams.java | 4 +-- .../director/v1_5/domain/EntityType.java | 1 - .../director/v1_5/domain/ExternalNetwork.java | 20 +++----------- .../vcloud/director/v1_5/domain/Group.java | 19 +++---------- .../v1_5/domain/InstantiateOvfParams.java | 3 --- .../v1_5/domain/InstantiationParams.java | 4 +-- .../v1_5/domain/NetworkConnectionSection.java | 1 - .../v1_5/domain/OrgEmailSettings.java | 21 ++++----------- .../v1_5/domain/OrgGeneralSettings.java | 17 ++---------- .../v1_5/domain/OrgLdapGroupAttributes.java | 19 +++---------- .../director/v1_5/domain/OrgLdapSettings.java | 27 ++++++------------- .../v1_5/domain/OrgLdapUserAttributes.java | 19 +++---------- .../v1_5/domain/OrgLeaseSettings.java | 21 ++++----------- .../domain/OrgPasswordPolicySettings.java | 9 +++---- .../director/v1_5/domain/OrgSettings.java | 17 ++---------- .../domain/OrgVAppTemplateLeaseSettings.java | 21 ++++----------- .../v1_5/domain/PublishCatalogParams.java | 19 +++---------- .../director/v1_5/domain/References.java | 23 ++++------------ .../v1_5/domain/SmtpServerSettings.java | 23 ++++------------ .../director/v1_5/domain/StaticRoute.java | 13 +++------ .../director/v1_5/domain/VAppChildren.java | 7 ++--- .../director/v1_5/domain/VAppTemplate.java | 7 ----- .../director/v1_5/domain/VMWareTools.java | 4 +-- .../vcloud/director/v1_5/domain/Vm.java | 1 - .../v1_5/domain/VmQuestionAnswer.java | 19 +++---------- .../v1_5/domain/VmQuestionAnswerChoice.java | 17 ++---------- .../director/v1_5/domain/package-info.java | 2 +- 30 files changed, 78 insertions(+), 315 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java index 5c2225a069..9030f3bdcb 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java @@ -18,15 +18,12 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.*; +import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; - import com.google.common.base.Objects; /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CaptureVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CaptureVAppParams.java index 496ac063a4..342d59fa9c 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CaptureVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CaptureVAppParams.java @@ -31,14 +31,7 @@ import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; -import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; -import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; @@ -73,10 +66,12 @@ import com.google.common.collect.Sets; }) @XmlRootElement(name = "CaptureVAppParams") public class CaptureVAppParams extends ParamsType { + public static Builder builder() { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromCaptureVAppParams(this); } @@ -87,7 +82,7 @@ public class CaptureVAppParams extends ParamsType { public static abstract class Builder> extends ParamsType.Builder { private Reference source; - private Set sections = ImmutableSet.of(); + private Set sections = Sets.newLinkedHashSet(); /** * @see CaptureVAppParams#getSource() diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomOrgLdapSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomOrgLdapSettings.java index aa3b75d18e..680948a69e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomOrgLdapSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomOrgLdapSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; @@ -24,25 +23,16 @@ import static com.google.common.base.Objects.equal; import java.util.Arrays; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Used when OrgLdapMode=CUSTOM to define connection details for - * the organization's LDAP service. + * Used when OrgLdapMode=CUSTOM to define connection details for + * the organization's LDAP service. * - * - *

Java class for CustomOrgLdapSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * *

  * <complexType name="CustomOrgLdapSettings">
  *   <complexContent>
@@ -68,10 +58,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CustomOrgLdapSettings", propOrder = { "hostName", "port", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java index 533e2bfc73..367e33428c 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java @@ -18,10 +18,8 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.*; +import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java index 20fa5a53ab..ad0f55efb0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java @@ -21,7 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; -import java.util.Collections; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ExternalNetwork.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ExternalNetwork.java index 7eb2992f44..bd05d84056 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ExternalNetwork.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ExternalNetwork.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,29 +16,18 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - - /** - * - * Admin representation of external network. - * - * - *

Java class for ExternalNetwork complex type. - * - *

The following schema fragment specifies the expected content contained within this class. + * Admin representation of external network. * *

  * <complexType name="ExternalNetwork">
@@ -52,10 +41,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "ExternalNetwork") @XmlType(propOrder = { "providerInfo" @@ -65,6 +51,7 @@ public class ExternalNetwork extends Network { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return new ConcreteBuilder().fromExternalNetwork(this); } @@ -80,6 +67,7 @@ public class ExternalNetwork extends Network { return self(); } + @Override public ExternalNetwork build() { return new ExternalNetwork(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java index 790b0fa06d..08fb5bd2ef 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Group.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; @@ -24,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.util.Set; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; @@ -35,16 +32,9 @@ import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; - /** - * - * Represents group in the system. - * - * - *

Java class for Group complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Represents group in the system. + * *

  * <complexType name="Group">
  *   <complexContent>
@@ -59,10 +49,7 @@ import com.google.common.collect.Sets;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "Group") @XmlType(propOrder = { "nameInSource", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java index 482d474bee..2640106f52 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java @@ -20,8 +20,6 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @@ -38,7 +36,6 @@ import com.google.common.base.Objects.ToStringHelper; * * @author grkvlt@apache.org */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InstantiateOvfParams") public class InstantiateOvfParams extends VAppCreationParamsType { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java index bd6800f73f..036c622e53 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java @@ -18,8 +18,8 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.*; -import static com.google.common.base.Preconditions.*; +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; import java.util.Collections; import java.util.Set; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java index 6277b4a0c4..7cbd25ccaa 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java @@ -22,7 +22,6 @@ import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; import java.net.URI; -import java.util.Collections; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java index bad677580c..9ea7f3e9e9 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; @@ -24,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @@ -34,16 +31,9 @@ import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; import com.google.common.collect.ImmutableList; - /** - * - * Defines the email settings for an organization. - * - * - *

Java class for OrgEmailSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Defines the email settings for an organization. + * *

  * <complexType name="OrgEmailSettings">
  *   <complexContent>
@@ -62,10 +52,7 @@ import com.google.common.collect.ImmutableList;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OrgEmailSettings") @XmlType(propOrder = { "isDefaultSmtpServer", @@ -82,6 +69,7 @@ public class OrgEmailSettings extends ResourceType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromOrgEmailSettings(this); } @@ -163,6 +151,7 @@ public class OrgEmailSettings extends ResourceType { return self(); } + @Override public OrgEmailSettings build() { return new OrgEmailSettings(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgGeneralSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgGeneralSettings.java index 254cd03e82..ffb4d39a12 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgGeneralSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgGeneralSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,13 +16,10 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @@ -30,15 +27,8 @@ import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Defines general org settings. - * - * - *

Java class for OrgGeneralSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. + * Defines general org settings. * *

  * <complexType name="OrgGeneralSettings">
@@ -56,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "GeneralOrgSettings") @XmlType(propOrder = { "canPublishCatalogs", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapGroupAttributes.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapGroupAttributes.java index 93384b4ac6..db8a3b56cc 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapGroupAttributes.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapGroupAttributes.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,29 +16,19 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Defines how a group is imported from LDAP. - * - * - *

Java class for OrgLdapGroupAttributes complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Defines how a group is imported from LDAP. + * *

  * <complexType name="OrgLdapGroupAttributes">
  *   <complexContent>
@@ -56,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OrgLdapGroupAttributes", propOrder = { "objectClass", "objectIdentifier", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapSettings.java index 60f2cad079..f5e01a827a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; @@ -24,25 +23,15 @@ import static com.google.common.base.Objects.equal; import java.util.Arrays; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - - /** - * - * Base settings for LDAP connection - * - * - *

Java class for OrgLdapSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Base settings for LDAP connection + * *

  * <complexType name="OrgLdapSettings">
  *   <complexContent>
@@ -57,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OrgLdapSettings") @XmlType(propOrder = { "ldapMode", @@ -68,14 +54,15 @@ import com.google.common.base.Objects.ToStringHelper; "customOrgLdapSettings" }) public class OrgLdapSettings extends ResourceType { + public static final class LdapMode { public static final String NONE = "NONE"; public static final String SYSTEM = "SYSTEM"; public static final String CUSTOM = "CUSTOM"; /** - * All acceptable {@link OrgLdapSettings#getLdapMode()} values. - *

+ * All acceptable {@link #getLdapMode()} values. + * * This list must be updated whenever a new mode is added. */ public static final List ALL = Arrays.asList( @@ -87,6 +74,7 @@ public class OrgLdapSettings extends ResourceType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromOrgLdapSettings(this); } @@ -124,6 +112,7 @@ public class OrgLdapSettings extends ResourceType { return self(); } + @Override public OrgLdapSettings build() { return new OrgLdapSettings(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapUserAttributes.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapUserAttributes.java index 7216f2df15..dd945b1b98 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapUserAttributes.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLdapUserAttributes.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,29 +16,19 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Defines how LDAP attributes are used when importing a user. - * - * - *

Java class for OrgLdapUserAttributes complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Defines how LDAP attributes are used when importing a user. + * *

  * <complexType name="OrgLdapUserAttributes">
  *   <complexContent>
@@ -60,10 +50,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OrgLdapUserAttributes", propOrder = { "objectClass", "objectIdentifier", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLeaseSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLeaseSettings.java index 225caa2e35..9082f11771 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLeaseSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgLeaseSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,13 +16,10 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @@ -30,16 +27,9 @@ import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Defines default lease durations and policies for an organization. - * - * - *

Java class for OrgLeaseSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Defines default lease durations and policies for an organization. + * *

  * <complexType name="OrgLeaseSettings">
  *   <complexContent>
@@ -54,10 +44,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "VAppLeaseSettings") @XmlType(propOrder = { "deleteOnStorageLeaseExpiration", @@ -69,6 +56,7 @@ public class OrgLeaseSettings extends ResourceType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromOrgLeaseSettings(this); } @@ -106,6 +94,7 @@ public class OrgLeaseSettings extends ResourceType { return self(); } + @Override public OrgLeaseSettings build() { return new OrgLeaseSettings(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java index bca070421d..a19d74caff 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,13 +16,10 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @@ -30,7 +27,6 @@ import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** * Java class for OrgPasswordPolicySettings complex type. * @@ -38,7 +34,6 @@ import com.google.common.base.Objects.ToStringHelper; * <complexType name="OrgPasswordPolicySettings" /> * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OrgPasswordPolicySettings") @XmlType(propOrder = { "accountLockoutEnabled", @@ -50,6 +45,7 @@ public class OrgPasswordPolicySettings extends ResourceType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromOrgPasswordPolicySettings(this); } @@ -87,6 +83,7 @@ public class OrgPasswordPolicySettings extends ResourceType { return self(); } + @Override public OrgPasswordPolicySettings build() { return new OrgPasswordPolicySettings(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgSettings.java index 385cdf75f5..3bdc674082 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,32 +16,22 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - - /** - * * Describes various settings for some organization. * This type establishes quotas and policies for the organization. * It also contains elements that specify the details of * how the organization connects to LDAP and email services. - * - *

Java class for OrgSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * *

  * <complexType name="OrgSettings">
  *   <complexContent>
@@ -59,10 +49,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OrgSettings") @XmlType(propOrder = { "generalSettings", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgVAppTemplateLeaseSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgVAppTemplateLeaseSettings.java index eed2b68f37..e649d87a29 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgVAppTemplateLeaseSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgVAppTemplateLeaseSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,13 +16,10 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @@ -30,16 +27,9 @@ import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Defines default lease policies for vAppTemplate on organization level. - * - * - *

Java class for OrgVAppTemplateLeaseSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Defines default lease policies for vAppTemplate on organization level. + * *

  * <complexType name="OrgVAppTemplateLeaseSettings">
  *   <complexContent>
@@ -53,10 +43,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OrgVAppTemplateLeaseSettings") @XmlType(propOrder = { "deleteOnStorageLeaseExpiration", @@ -67,6 +54,7 @@ public class OrgVAppTemplateLeaseSettings extends ResourceType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromOrgVAppTemplateLeaseSettings(this); } @@ -96,6 +84,7 @@ public class OrgVAppTemplateLeaseSettings extends ResourceType { } + @Override public OrgVAppTemplateLeaseSettings build() { return new OrgVAppTemplateLeaseSettings(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/PublishCatalogParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/PublishCatalogParams.java index e65f5a865f..2436f06bee 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/PublishCatalogParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/PublishCatalogParams.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,29 +16,19 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; - /** - * - * Parameters used when publishing catalogs. - * - * - *

Java class for PublishCatalogParams complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Parameters used when publishing catalogs. + * *

  * <complexType name="PublishCatalogParams">
  *   <complexContent>
@@ -51,10 +41,7 @@ import com.google.common.base.Objects;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "PublishCatalogParams") @XmlType(propOrder = { "isPublished" diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/References.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/References.java index 195328a726..f47bbf9a1d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/References.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/References.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,17 +16,12 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; import java.util.Set; -import javax.lang.model.type.ReferenceType; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @@ -37,16 +32,9 @@ import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; import com.google.common.collect.Sets; - /** - * - * This is the container for returned elements in referenceView - * - * - *

Java class for References complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * This is the container for returned elements in referenceView + * *

  * <complexType name="References">
  *   <complexContent>
@@ -59,10 +47,7 @@ import com.google.common.collect.Sets;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "References") @XmlType(propOrder = { "references" @@ -72,6 +57,7 @@ public class References extends ContainerType { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return new ConcreteBuilder().fromReferences(this); } @@ -94,6 +80,7 @@ public class References extends ContainerType { return self(); } + @Override public References build() { return new References(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SmtpServerSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SmtpServerSettings.java index 4ab6dd17f1..02a06a7b53 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SmtpServerSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SmtpServerSettings.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,31 +16,21 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; - /** - * - * Specifies connection details for the organization s SMTP server. - * If IsDefaultSmtpServer (in OrgEmailSettings) is false, the SmtpServerSettings - * element is taken into account. - * - * - *

Java class for SmtpServerSettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * + * Specifies connection details for the organization s SMTP server. + * If IsDefaultSmtpServer (in OrgEmailSettings) is false, the SmtpServerSettings + * element is taken into account. + * *

  * <complexType name="SmtpServerSettings">
  *   <complexContent>
@@ -56,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SmtpServerSettings", propOrder = { "useAuthentication", "host", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/StaticRoute.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/StaticRoute.java index e898b9017c..75e7b80ff5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/StaticRoute.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/StaticRoute.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,25 +16,19 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; - /** - *

Java class for StaticRoute complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * Java class for StaticRoute complex type. + * *

  * <complexType name="StaticRoute">
  *   <complexContent>
@@ -51,7 +45,6 @@ import com.google.common.base.Objects;
  * </complexType>
  * 
*/ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StaticRoute", propOrder = { "name", "network", diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java index b6389f62e1..2e4995ec08 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java @@ -18,13 +18,11 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.*; -import static com.google.common.base.Preconditions.*; +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @@ -40,7 +38,6 @@ import com.google.common.collect.Lists; * * @author grkvlt@apache.org */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "VAppChildren") public class VAppChildren { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppTemplate.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppTemplate.java index e63f91f5b7..2ccca7f212 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppTemplate.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppTemplate.java @@ -29,14 +29,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; -import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; -import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java index 7eed6795de..a49f2486e8 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java @@ -18,10 +18,8 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.*; +import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java index 214b58452d..a7d71d3bd7 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java @@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.jclouds.vcloud.director.v1_5.domain.ovf.environment.EnvironmentType; -import org.omg.CORBA.Environment; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java index edff39b489..8efc6e09cd 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,28 +16,18 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; - /** - * - * Represents a VM answer to a question when the VM is in a stuck - * (WAITING_FOR_INPUT) state. - * - * - *

Java class for VmQuestionAnswer complex type. - * - *

The following schema fragment specifies the expected content contained within this class. + * Represents a VM answer to a question when the VM is in a stuck + * {@link ResourceEntityType.Status#WAITING_FOR_INPUT} state. * *

  * <complexType name="VmQuestionAnswer">
@@ -51,10 +41,7 @@ import com.google.common.base.Objects;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "VmQuestionAnswer", propOrder = { "choiceId", "questionId" diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java index fe598ff8e8..5ffd7aceda 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,27 +16,17 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; - /** - * - * Represents a pair of ID and text of an answer choice of a VM question. - * - * - *

Java class for VmQuestionAnswerChoice complex type. - * - *

The following schema fragment specifies the expected content contained within this class. + * Represents a pair of ID and text of an answer choice of a VM question. * *

  * <complexType name="VmQuestionAnswerChoice">
@@ -50,10 +40,7 @@ import com.google.common.base.Objects;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ -@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "VmQuestionAnswerChoice", propOrder = { "id", "text" diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/package-info.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/package-info.java index 9e9fbb8cf9..d479475fde 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/package-info.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/package-info.java @@ -31,8 +31,8 @@ package org.jclouds.vcloud.director.v1_5.domain; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_ENV_NS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; From 680a202b203f9094b864c08d003d7954ac9b0e60 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Tue, 27 Mar 2012 13:20:55 +0100 Subject: [PATCH 4/5] Issue 830: Tidy up client imports and javadoc --- .../features/AdminCatalogAsyncClient.java | 1 - .../v1_5/features/AdminCatalogClient.java | 4 - .../v1_5/features/AdminOrgAsyncClient.java | 3 +- .../v1_5/features/AdminOrgClient.java | 3 +- .../v1_5/features/AdminVdcAsyncClient.java | 4 +- .../v1_5/features/AdminVdcClient.java | 7 +- .../v1_5/features/CatalogAsyncClient.java | 1 - .../director/v1_5/features/CatalogClient.java | 2 - .../v1_5/features/MediaAsyncClient.java | 1 - .../director/v1_5/features/MediaClient.java | 5 +- .../v1_5/features/MetadataAsyncClient.java | 6 +- .../v1_5/features/MetadataClient.java | 8 +- .../v1_5/features/NetworkAsyncClient.java | 2 - .../director/v1_5/features/NetworkClient.java | 5 +- .../director/v1_5/features/OrgClient.java | 3 +- .../director/v1_5/features/QueryClient.java | 2 +- .../v1_5/features/UploadAsyncClient.java | 2 +- .../director/v1_5/features/UploadClient.java | 3 +- .../v1_5/features/UserAsyncClient.java | 3 +- .../director/v1_5/features/UserClient.java | 2 +- .../features/VAppTemplateAsyncClient.java | 59 ------------- .../v1_5/features/VAppTemplateClient.java | 40 +++++---- .../v1_5/features/VdcAsyncClient.java | 1 - .../director/v1_5/features/VdcClient.java | 84 ++++++++++++------- .../AdminCatalogClientExpectTest.java | 14 +--- 25 files changed, 99 insertions(+), 166 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java index 71e7572a8b..27f84b6090 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java @@ -37,7 +37,6 @@ import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java index 6ffa9cde0e..f3e13d4f13 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java @@ -22,13 +22,10 @@ import java.net.URI; import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; -import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; -import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; /** * Provides synchronous access to {@link AdminCatalog} objects. @@ -36,7 +33,6 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; * @see AdminCatalogAsyncClient * @author danikov */ -@RequestFilters(AddVCloudAuthorizationToRequest.class) @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public interface AdminCatalogClient extends CatalogClient { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java index f5da05318b..b31dfd9fe2 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java @@ -48,7 +48,7 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see GroupClient + * @see AdminOrgClient * @author danikov */ @RequestFilters(AddVCloudAuthorizationToRequest.class) @@ -57,6 +57,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient { /** * @see AdminOrgClient#getOrg(URI) */ + @Override @GET @Consumes @JAXBResponseParser diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java index 1c300fe022..8c64647aae 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java @@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.AdminOrg; -import org.jclouds.vcloud.director.v1_5.domain.Group; import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings; @@ -34,7 +33,7 @@ import org.jclouds.vcloud.director.v1_5.domain.OrgSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings; /** - * Provides synchronous access to {@link Group} objects. + * Provides synchronous access to {@link Org} objects. * * @see GroupAsyncClient * @author danikov diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java index 4f2126f936..c22adc0ac5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java @@ -36,7 +36,6 @@ import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminVdc; import org.jclouds.vcloud.director.v1_5.domain.Task; -import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writeable; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; @@ -48,8 +47,6 @@ import com.google.common.util.concurrent.ListenableFuture; */ @RequestFilters(AddVCloudAuthorizationToRequest.class) public interface AdminVdcAsyncClient extends VdcAsyncClient { - - // TODO Should we use MetadataClient? @GET @Consumes @@ -88,6 +85,7 @@ public interface AdminVdcAsyncClient extends VdcAsyncClient { /** * @return asynchronous access to {@link Writeable} features */ + @Override @Delegate MetadataAsyncClient.Writeable getMetadataClient(); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java index 0959d89bd2..bc291c6fbd 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java @@ -26,14 +26,11 @@ import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.vcloud.director.v1_5.domain.AdminVdc; import org.jclouds.vcloud.director.v1_5.domain.Task; -import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writeable; /** - * Provides synchronous access to Network. - *

+ * Provides synchronous access to {@link AdminVdc}. * - * @see NetworkAsyncClient - * @see + * @see AdminVdcAsyncClient * @author danikov */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java index 4d9353c5fa..e4f456ef11 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java @@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogType; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java index d62832ec9d..d5e4e53aad 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java @@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; -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.CatalogType; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; /** * Provides synchronous access to {@link Catalog} objects. diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java index adf8306799..f335b2f9c5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java @@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams; import org.jclouds.vcloud.director.v1_5.domain.Media; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java index b5445757f3..6180e9f33e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java @@ -25,16 +25,13 @@ import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams; import org.jclouds.vcloud.director.v1_5.domain.Media; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.Task; /** - * Provides synchronous access to Media. - *

+ * Provides synchronous access to {@link Media}. * * @see MediaAsyncClient - * @see * @author danikov */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java index f523df49ab..d6bcc422b0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java @@ -45,13 +45,14 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - - * @see NetworkClient + * @see MetadataClient * @author danikov */ public interface MetadataAsyncClient { + @RequestFilters(AddVCloudAuthorizationToRequest.class) public static interface Readable extends MetadataAsyncClient { + /** * @see MetadataClient.Readable#getMetadata(URISupplier) */ @@ -75,6 +76,7 @@ public interface MetadataAsyncClient { @RequestFilters(AddVCloudAuthorizationToRequest.class) public static interface Writeable extends Readable { + /** * @see MetadataClient.Writable#mergeMetadata(URI, Metadata)) */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java index 3c6688db8c..71f3b45fda 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java @@ -27,19 +27,16 @@ import org.jclouds.vcloud.director.v1_5.domain.MetadataValue; import org.jclouds.vcloud.director.v1_5.domain.Task; /** - * Provides synchronous access to Upload. - *

+ * Provides synchronous access to {@linkl Metadata}. * * @see MetadataAsyncClient - * @see * @author danikov */ public interface MetadataClient { - // FIXME Correct spelling of Writeable -> Writable - @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public static interface Readable extends MetadataClient { + /** * Retrieves an list of metadata * @@ -57,6 +54,7 @@ public interface MetadataClient { @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public static interface Writeable extends Readable { + /** * Merges the metadata for a media with the information provided. * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java index 2ad64d8ee7..5615ac6818 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java @@ -28,7 +28,6 @@ import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Network; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; @@ -36,7 +35,6 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see NetworkClient * @author danikov */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java index d1570f2470..95131d43d9 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java @@ -23,15 +23,12 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Network; /** - * Provides synchronous access to Network. - *

+ * Provides synchronous access to {@link Network}. * * @see NetworkAsyncClient - * @see * @author danikov */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java index 4e937948f9..b2d226cd71 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java @@ -28,8 +28,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Org; import org.jclouds.vcloud.director.v1_5.domain.OrgList; /** - * Provides synchronous access to Org. - *

+ * Provides synchronous access to {@link Org}. * * @see OrgAsyncClient * @author Adrian Cole diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java index f4a6097ece..106ebf6100 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java @@ -28,7 +28,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords; import org.jclouds.vcloud.director.v1_5.domain.query.VAppReferences; /** - * Provides synchronous access to The REST API query interface. + * Provides synchronous access to the REST API query interface. * * @see QueryAsyncClient * @author grkvlt@apache.org diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java index fecd69710e..28f0cc9dd0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java @@ -30,12 +30,12 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import com.google.common.util.concurrent.ListenableFuture; /** - * * @see UploadClient * @author danikov */ @RequestFilters(AddVCloudAuthorizationToRequest.class) public interface UploadAsyncClient { + /** * @see UploadClient#put */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java index 4311cda021..4ce8fb4285 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java @@ -25,8 +25,7 @@ import org.jclouds.concurrent.Timeout; import org.jclouds.io.Payload; /** - * Provides synchronous access to Upload. - *

+ * Provides synchronous access to upload. * * @see UploadAsyncClient * @author danikov diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java index 82c41560b3..426109f69a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java @@ -42,11 +42,12 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see GroupClient + * @see UserClient * @author danikov */ @RequestFilters(AddVCloudAuthorizationToRequest.class) public interface UserAsyncClient { + /** * @see UserClient#createUser(URI, User) */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java index 350e03af21..0c2392a165 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java @@ -22,7 +22,6 @@ import java.net.URI; import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; -import org.jclouds.vcloud.director.v1_5.domain.Group; import org.jclouds.vcloud.director.v1_5.domain.User; /** @@ -33,6 +32,7 @@ import org.jclouds.vcloud.director.v1_5.domain.User; */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public interface UserClient { + /** * Creates or imports a user in an organization. The user could be enabled or disabled. * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java index d2c400c474..1874c2686a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java @@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.features; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.CUSTOMIZATION_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.LEASE_SETTINGS_SECTION; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA_ENTRY; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONFIG_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_SECTION; @@ -40,7 +38,6 @@ import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import org.jclouds.rest.annotations.BinderParam; @@ -53,8 +50,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; -import org.jclouds.vcloud.director.v1_5.domain.MetadataValue; import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection; import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection; import org.jclouds.vcloud.director.v1_5.domain.Owner; @@ -214,60 +209,6 @@ public interface VAppTemplateAsyncClient { ListenableFuture editVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI, @BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection); - /** - * @see VAppTemplateClient#getVAppTemplateMetadata(URI) - */ - @GET - @Consumes(METADATA) - @Path("/metadata") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture getVAppTemplateMetadata(@EndpointParam URI templateURI); - - @POST - @Produces(METADATA) - @Consumes(TASK) - @Path("/metadata") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture editVAppTemplateMetadata(@EndpointParam URI templateURI, - @BinderParam(BindToXMLPayload.class) Metadata metadata); - - /** - * @see VAppTemplateClient#getVAppTemplateMetadataValue(URI, String) - */ - @GET - @Consumes(METADATA_ENTRY) - @Path("/metadata/{key}") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture getVAppTemplateMetadataValue(@EndpointParam URI templateURI, - @PathParam("key") String key); - - /** - * @see VAppTemplateClient#editVAppTemplateMetadataValue(URI, String, org.jclouds.vcloud.director.v1_5.domain.MetadataValue) - */ - @PUT - @Produces(METADATA_ENTRY) - @Consumes(TASK) - @Path("/metadata/{key}") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture editVAppTemplateMetadataValue(@EndpointParam URI templateURI, - @PathParam("key") String key, - @BinderParam(BindToXMLPayload.class) MetadataValue value); - - /** - * @see VAppTemplateClient#deleteVAppTemplateMetadataValue(URI, String) - */ - @DELETE - @Consumes(TASK) - @Path("/metadata/{key}") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture deleteVAppTemplateMetadataValue(@EndpointParam URI templateURI, - @PathParam("key") String key); - /** * @see VAppTemplateClient#getVAppTemplateNetworkConfigSection(URI) */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java index 68bb19dd3d..7e6d72949d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java @@ -26,7 +26,6 @@ import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection; import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection; import org.jclouds.vcloud.director.v1_5.domain.Owner; @@ -39,7 +38,7 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.Envelope; import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; /** - * Provides synchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} objects. + * Provides synchronous access to {@link VAppTemplate} objects. * * @author Adam Lowe * @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient @@ -49,15 +48,24 @@ public interface VAppTemplateClient { /** * Retrieves a vApp template (can be used also to retrieve a VM from a vApp Template). - * The vApp could be in one of these statues: FAILED_CREATION(-1) - Transient entity state, - * e.g., model object is created but the corresponding VC backing does not exist yet. This - * is further sub-categorized in the respective entities. UNRESOLVED(0) - Entity is whole, - * e.g., VM creation is complete and all the required model objects and VC backings are created. - * RESOLVED(1) - Entity is resolved. UNKNOWN(6) - Entity state could not be retrieved from - * the inventory, e.g., VM power state is null. POWERED_OFF(8) - All VMs of the vApp template - * are powered off. MIXED(10) - vApp template status is set to MIXED when the VMs in the - * vApp are in different power states. * + * The vApp could be in one of these statues: + *

*
     * GET /vAppTemplate/{id}
     * 
@@ -236,17 +244,7 @@ public interface VAppTemplateClient { NetworkConfigSection getVAppTemplateNetworkConfigSection(URI templateUri); /** - * Modifies the network config section of a vApp. There are three general types of vApp - * networks which could be configured from this section. They are specified by the element - * value in /. isolated - this is a vApp network which is not connected to any external - * organization network and is used only to connect VMs internally in a vApp. In this - * network you could configure only its element of /. bridged - this is a vApp network - * which is directly connected to an external organization network. In this network you - * should configure only the element of /. In this case the element is inherit from the - * parent network. natRouted - this is a vApp network which is NAT routed to an external - * organization network. In this network you could configure the and also you should - * specify and the element of /. When the network is NAT routed you could specify DHCP, - * firewall rules and NAT rules, for fine-grained configuration of your network. + * Modifies the network config section of a vApp. * *
     * PUT /vAppTemplate/{id}/networkConfigSection
diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java
index 0fb42dc06b..7883701d11 100644
--- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java
+++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java
@@ -41,7 +41,6 @@ import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
 import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
 import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType;
 import org.jclouds.vcloud.director.v1_5.domain.Media;
-import org.jclouds.vcloud.director.v1_5.domain.Metadata;
 import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
 import org.jclouds.vcloud.director.v1_5.domain.VApp;
 import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java
index 1370411731..787e0b06e2 100644
--- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java
+++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java
@@ -54,8 +54,11 @@ public interface VdcClient {
    Vdc getVdc(URI vdcUri);
    
    /**
-    * Captures a vApp into vApp template. 
-    * The status of vApp template will be in UNRESOLVED(0) until the capture task is finished.
+    * Captures a vApp into vApp template.
+    *
+    * The status of vApp template will be in
+    * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
+    * until the capture task is finished.
     * 
     * @return a VApp resource which will contain a task. 
     * The user should should wait for this task to finish to be able to use the vApp.
@@ -64,7 +67,9 @@ public interface VdcClient {
    
    /**
     * Clones a media into new one. 
-    * The status of the returned media is UNRESOLVED(0) until the task for cloning finish.
+    * The status of the returned media is
+    * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
+    * until the task for cloning finish.
     * 
     * @return a Media resource which will contain a task. 
     * The user should monitor the contained task status in order to check when it is completed.
@@ -80,8 +85,11 @@ public interface VdcClient {
    VApp cloneVApp(URI vdcUri, CloneVAppParams params);
    
    /**
-    * Clones a vApp template into new one. 
-    * The status of vApp template will be in UNRESOLVED(0) until the clone task is finished.
+    * Clones a vApp template into new one.
+    *
+    * The status of vApp template will be in
+    * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
+    * until the clone task is finished.
     * 
     * @return a VAppTemplate resource which will contain a task. 
     * The user should should wait for this task to finish to be able to use the VAppTemplate.
@@ -89,23 +97,32 @@ public interface VdcClient {
    VAppTemplate cloneVAppTemplate(URI vdcUri, CloneVAppTemplateParams params);
    
    /**
-    * Composes a new vApp using VMs from other vApps or vApp templates. The vCloud API supports 
-    * composing a vApp from any combination of vApp templates, vApps, or virtual machines. 
-    * When you compose a vApp, all children of each composition source become peers in the 
-    * Children collection of the composed vApp. To compose a vApp, a client makes a compose 
-    * vApp request whose body is a ComposeVAppParams element, includes the following information: 
-    * - An InstantiationParams element that applies to the composed vApp itself and any vApp 
-    * templates referenced in Item elements. - A SourcedItem element for each virtual machine, 
-    * vApp, or vAppTemplate to include in the composition. Each SourcedItem can contain the 
-    * following elements: - A required Source element whose href attribute value is a reference 
-    * to a vApp template, vApp, or VM to include in the composition. If the Source element 
-    * references a VM, the Item must also include an InstantiationParams element specific to 
-    * that VM. - An optional NetworkAssignment element that specifies how the network connections 
-    * of child VM elements are mapped to vApp networks in the parent. - If any of the composition 
-    * items is subject to a EULA, the ComposeVAppParams element must include an AllEULAsAccepted 
-    * element that has a value of true, indicating that you accept the EULA. Otherwise, composition 
-    * fails. The composed vApp must be deployed and powered on before it can be used. The status 
-    * of vApp will be UNRESOLVED(0) until the compose task is finished.
+    * Composes a new vApp using VMs from other vApps or vApp templates.
+    *
+    * The vCloud API supports composing a vApp from any combination of vApp templates, vApps,
+    * or virtual machines. When you compose a vApp, all children of each composition source
+    * become peers in the Children collection of the composed vApp. To compose a vApp, a client
+    * makes a compose vApp request whose body is a ComposeVAppParams element, includes the
+    * following information: 
+    * 
    + *
  • An InstantiationParams element that applies to the composed vApp itself and any vApp + * templates referenced in Item elements. + *
  • A SourcedItem element for each virtual machine, vApp, or vAppTemplate to include in + * the composition. Each SourcedItem can contain the following elements: + *
      + *
    • A required Source element whose href attribute value is a reference + * to a vApp template, vApp, or VM to include in the composition. If the Source element + * references a VM, the Item must also include an InstantiationParams element specific to + * that VM. + *
    • An optional NetworkAssignment element that specifies how the network connections + * of child VM elements are mapped to vApp networks in the parent. + *
    + *
  • If any of the composition items is subject to a EULA, the ComposeVAppParams element + * must include an AllEULAsAccepted element that has a value of true, indicating that you + * accept the EULA. Otherwise, composition fails. The composed vApp must be deployed and + * powered on before it can be used. The status of vApp will be + * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)} + * until the compose task is finished. * * @return a VApp resource which will contain a task. * The user should should wait for this task to finish to be able to use the vApp. @@ -114,7 +131,10 @@ public interface VdcClient { /** * Instantiate a vApp template into a new vApp. - * The status of vApp will be in UNRESOLVED(0) until the instantiate task is finished. + * + * The status of vApp will be in + * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)} + * until the instantiate task is finished. * *
         * POST /vdc/{id}/action/instantiateVAppTemplate
    @@ -126,13 +146,17 @@ public interface VdcClient {
        VApp instantiateVApp(URI vdcUri, InstantiateVAppParamsType params);
        
        /**
    -    * Uploading vApp template to a vDC. The operation is separate on several steps: 
    -    * 1. creating empty vApp template entity 
    -    * 2. uploading an OVF of vApp template 
    -    * 3. uploading disks described from the OVF 
    -    * 4. finishing task for uploading 
    -    * The status of vApp template will be NOT_READY(0) until the ovf and all disks are uploaded 
    -    * to the transfer site. After this a task will run on the vApp template uploading.
    +    * Uploading vApp template to a vDC.
    +    *
    +    * The operation is separate on several steps:
    +    * 
      + *
    1. creating empty vApp template entity + *
    2. uploading an OVF of vApp template + *
    3. uploading disks described from the OVF + *
    4. finishing task for uploading + *
    + * The status of vApp template will be {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#NOT_READY NOT_READY(0)} + * until the ovf and all disks are uploaded to the transfer site. After this a task will run on the vApp template uploading. * * Note that the empty vApp template's getFiles() returns a file of size -1 after step one above, * because the descriptor.ovf does not yet exist. diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java index 3ce56c12fc..d14f1c6a9c 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java @@ -46,7 +46,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx private Reference orgRef = Reference.builder() .type("application/vnd.vmware.vcloud.catalog+xml") .name("QunyingTestCatalog") - .href(URI.create(endpoint + "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")) + .href(URI.create(endpoint + "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0")) .build(); private Reference catalogRef = Reference.builder() @@ -59,7 +59,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx public void testCreateCatalog() { VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer() - .apiCommand("POST", "/admin/org/???/catalogs") + .apiCommand("POST", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/catalogs") .xmlFilePayload("/catalog/admin/createCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG) .acceptMedia(VCloudDirectorMediaType.ADMIN_CATALOG) .httpRequestBuilder().build(), @@ -70,16 +70,10 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx AdminCatalog source = createCatalogSource(); AdminCatalog expected = createCatalog(); - assertEquals(client.getAdminCatalogClient().createCatalog(catalogRef.getHref(), source), expected); + assertEquals(client.getAdminCatalogClient().createCatalog(orgRef.getHref(), source), expected); } - // FIXME temporarily disabling this test due to JAXB error: - // javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.vmware.com/vcloud/v1.5", local:"AdminCatalog"). - // Expected elements are <{http://www.vmware.com/vcloud/v1.5}Catalog>,<{http://www.vmware.com/vcloud/v1.5}CatalogItems>, - // <{http://www.vmware.com/vcloud/v1.5}CatalogReference>,<{http://www.vmware.com/vcloud/v1.5}Error>, - // <{http://www.vmware.com/vcloud/v1.5}Link>,<{http://www.vmware.com/vcloud/v1.5}Owner>, - // <{http://www.vmware.com/vcloud/v1.5}Task> - @Test(enabled = false) + @Test public void testGetCatalog() { VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer() From 9bc2640601b8678622247b4a4df33827ff6b2734 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Tue, 27 Mar 2012 12:38:12 +0100 Subject: [PATCH 5/5] Issue 830: Make RasdItemsList implement Set --- .../director/v1_5/domain/RasdItemsList.java | 92 +++++++++++++++++-- 1 file changed, 85 insertions(+), 7 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java index a3d432879b..8f8a444699 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java @@ -21,7 +21,9 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; -import java.util.List; +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -31,7 +33,7 @@ import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; -import com.google.common.collect.Lists; +import com.google.common.collect.Sets; /** * Represents a list of RASD items. @@ -44,12 +46,13 @@ import com.google.common.collect.Lists; */ @XmlRootElement(name = "RasdItemsList") @XmlType(name = "RasdItemsList") -public class RasdItemsList extends ResourceType { +public class RasdItemsList extends ResourceType implements Set { public static Builder builder() { return new ConcreteBuilder(); } + @Override public Builder toBuilder() { return builder().fromRasdItemsList(this); } @@ -59,12 +62,12 @@ public class RasdItemsList extends ResourceType { public static abstract class Builder> extends ResourceType.Builder { - private List items = Lists.newArrayList(); + private Set items = Sets.newLinkedHashSet(); /** * @see RasdItemsList#getItems() */ - public B items(List items) { + public B items(Set items) { this.items = checkNotNull(items, "items"); return self(); } @@ -98,12 +101,12 @@ public class RasdItemsList extends ResourceType { } @XmlElement(name = "Item") - protected List items = Lists.newArrayList(); + protected Set items = Sets.newLinkedHashSet(); /** * A RASD item content. */ - public List getItems() { + public Set getItems() { return items; } @@ -127,4 +130,79 @@ public class RasdItemsList extends ResourceType { return super.string().add("items", items); } + /** + * The delegate always returns a {@link Set} even if {@link #items} is {@literal null}. + * + * The delegated {@link Set} is used by the methods implementing its interface. + *

    + * NOTE Annoying lack of multiple inheritance for using ForwardingList! + */ + private Set delegate() { + return getItems(); + } + + @Override + public boolean add(ResourceAllocationSettingData arg0) { + return delegate().add(arg0); + } + + @Override + public boolean addAll(Collection arg0) { + return delegate().addAll(arg0); + } + + @Override + public void clear() { + delegate().clear(); + } + + @Override + public boolean contains(Object arg0) { + return delegate().contains(arg0); + } + + @Override + public boolean containsAll(Collection arg0) { + return delegate().containsAll(arg0); + } + + @Override + public boolean isEmpty() { + return delegate().isEmpty(); + } + + @Override + public Iterator iterator() { + return delegate().iterator(); + } + + @Override + public boolean remove(Object arg0) { + return delegate().remove(arg0); + } + + @Override + public boolean removeAll(Collection arg0) { + return delegate().removeAll(arg0); + } + + @Override + public boolean retainAll(Collection arg0) { + return delegate().retainAll(arg0); + } + + @Override + public int size() { + return delegate().size(); + } + + @Override + public Object[] toArray() { + return delegate().toArray(); + } + + @Override + public T[] toArray(T[] arg0) { + return delegate().toArray(arg0); + } }