minor bugfix + skeletal code for groups/LDAP

This commit is contained in:
danikov 2012-03-22 11:48:49 +00:00
parent 18562f5dbb
commit d4b03f0119
2 changed files with 13 additions and 1 deletions

View File

@ -19,6 +19,7 @@
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static com.google.common.base.Objects.equal; 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_DEL;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_EQ; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_EQ;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_UPDATABLE; 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", @Test(testName = "POST /admin/catalog/{id}/action/publish",
dependsOnMethods = { "testUpdateCatalog" } ) // FIXME: fails with a 403 dependsOnMethods = { "testUpdateCatalog" } ) // FIXME: fails with a 403
public void testPublishCatalog() { public void testPublishCatalog() {
assertNotNull(catalog, String.format(NOT_NULL_OBJ_FMT, "Catalog"));
assertTrue(!catalog.isPublished(), String.format(OBJ_FIELD_EQ, assertTrue(!catalog.isPublished(), String.format(OBJ_FIELD_EQ,
CATALOG, "isPublished", false, catalog.isPublished())); CATALOG, "isPublished", false, catalog.isPublished()));

View File

@ -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.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.domain.Checks; 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.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.domain.Reference;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest; import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
@ -52,11 +53,20 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest {
*/ */
private Reference groupRef; private Reference groupRef;
private Group group; private Group group;
private OrgLdapSettings oldLdapSettings, newLdapSettings;
@Override @Override
@BeforeClass(inheritGroups = true) @BeforeClass(inheritGroups = true)
public void setupRequiredClients() { public void setupRequiredClients() {
groupClient = context.getApi().getGroupClient(); 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") @Test(testName = "POST /admin/org/{id}/groups")