From d4b03f0119b4ce393bc6958f835940d704bf2fe0 Mon Sep 17 00:00:00 2001 From: danikov Date: Thu, 22 Mar 2012 11:48:49 +0000 Subject: [PATCH] minor bugfix + skeletal code for groups/LDAP --- .../v1_5/features/AdminCatalogClientLiveTest.java | 2 ++ .../director/v1_5/features/GroupClientLiveTest.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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 06bc0300b7..63851f3d2e 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 @@ -19,6 +19,7 @@ package org.jclouds.vcloud.director.v1_5.features; import static com.google.common.base.Objects.equal; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.NOT_NULL_OBJ_FMT; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_DEL; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_EQ; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_UPDATABLE; @@ -173,6 +174,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest @Test(testName = "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")); assertTrue(!catalog.isPublished(), String.format(OBJ_FIELD_EQ, CATALOG, "isPublished", false, catalog.isPublished())); 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 caa7495d62..7d09f64010 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 @@ -26,6 +26,7 @@ import static org.testng.Assert.fail; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.domain.Checks; import org.jclouds.vcloud.director.v1_5.domain.Group; +import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings; import org.jclouds.vcloud.director.v1_5.domain.Reference; import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest; import org.testng.annotations.BeforeClass; @@ -52,11 +53,20 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest { */ private Reference groupRef; private Group group; - + private OrgLdapSettings oldLdapSettings, newLdapSettings; + @Override @BeforeClass(inheritGroups = true) public void setupRequiredClients() { groupClient = context.getApi().getGroupClient(); + Reference orgRef = null; + + // TODO: requisite LDAP settings +// oldLdapSettings = context.getApi().getAdminOrgClient().getLdapSettings(orgRef.getHref()); +// OrgLdapSettings newLdapSettings = oldLdapSettings.toBuilder() +// .ldapMode(OrgLdapSettings.LdapMode.SYSTEM) +// .build(); +// context.getApi().getAdminOrgClient().updateLdapSettings(newLdapSettings); } @Test(testName = "POST /admin/org/{id}/groups")