From 738bf70d921471e9fce48fe37fcc15d951081253 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 19 Jul 2007 08:55:15 +0000
Subject: [PATCH] Add support for deregistering relations from managed object definitions and use it in unit tests for better cleanup after tests have completed (previously admin framework unit tests were leaving mock relations registered with the root configuration).
---
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/LDAPClientTest.java | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/LDAPClientTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/LDAPClientTest.java
index 69f031a..1fb6f8f 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/LDAPClientTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/LDAPClientTest.java
@@ -45,6 +45,7 @@
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.MockLDAPProfile;
+import org.opends.server.admin.TestCfg;
import org.opends.server.admin.TestChildCfgClient;
import org.opends.server.admin.TestChildCfgDefn;
import org.opends.server.admin.TestParentCfgClient;
@@ -280,6 +281,7 @@
@AfterClass
public void tearDown() {
LDAPProfile.getInstance().popWrapper();
+ TestCfg.cleanup();
}
@@ -814,8 +816,7 @@
CommunicationException {
ManagedObject<RootCfgClient> root = context
.getRootConfigurationManagedObject();
- return root.createChild(
- org.opends.server.admin.TestCfg.RD_TEST_ONE_TO_MANY_PARENT,
+ return root.createChild(TestCfg.getTestOneToManyParentRelationDefinition(),
TestParentCfgDefn.getInstance(), name, null).getConfiguration();
}
@@ -829,9 +830,8 @@
CommunicationException {
ManagedObject<RootCfgClient> root = context
.getRootConfigurationManagedObject();
- return root.getChild(
- org.opends.server.admin.TestCfg.RD_TEST_ONE_TO_MANY_PARENT, name)
- .getConfiguration();
+ return root.getChild(TestCfg.getTestOneToManyParentRelationDefinition(),
+ name).getConfiguration();
}
@@ -842,8 +842,7 @@
CommunicationException {
ManagedObject<RootCfgClient> root = context
.getRootConfigurationManagedObject();
- return root
- .listChildren(org.opends.server.admin.TestCfg.RD_TEST_ONE_TO_MANY_PARENT);
+ return root.listChildren(TestCfg.getTestOneToManyParentRelationDefinition());
}
@@ -855,7 +854,6 @@
CommunicationException {
ManagedObject<RootCfgClient> root = context
.getRootConfigurationManagedObject();
- root.removeChild(
- org.opends.server.admin.TestCfg.RD_TEST_ONE_TO_MANY_PARENT, name);
+ root.removeChild(TestCfg.getTestOneToManyParentRelationDefinition(), name);
}
}
--
Gitblit v1.10.0