From d30d857423de7afd4c96919232af420739cede6f Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 28 Sep 2007 18:23:35 +0000
Subject: [PATCH] Attempt to fix current JDK1.5 failures in ValidateCfgDefn tests: allow test configuration definitions to not register themselves with the TopCfgDefn. Previously, test definitions would register themselves with the TopCfgDefn and then deregister themselves during their tear down phase. However, this didn't seem to be working as expected on JDK1.5 for some reason, and was causing the ValidateCfgDefn tests to fail.
---
opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java | 30 ++----------------------------
1 files changed, 2 insertions(+), 28 deletions(-)
diff --git a/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java b/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java
index da3bc07..7903cc6 100644
--- a/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java
+++ b/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java
@@ -43,7 +43,6 @@
import org.opends.messages.Message;
import org.opends.server.admin.DefinitionDecodingException.Reason;
-import org.opends.server.util.Validator;
@@ -107,22 +106,11 @@
* @param parent
* The parent definition, or <code>null</code> if there
* is no parent (only the {@link TopCfgDefn} should have a
- * <code>null</code> parent}.
+ * <code>null</code> parent, unless the definition is
+ * being used for testing).
*/
protected AbstractManagedObjectDefinition(String name,
AbstractManagedObjectDefinition<? super C, ? super S> parent) {
- // Perform sanity checks.
- if (this.getClass() == TopCfgDefn.class) {
- Validator.ensureTrue(name.equals("top"),
- "TopCfgDefn should have the name 'top'");
- Validator.ensureTrue(parent == null,
- "TopCfgDefn should not have a parent");
- } else {
- Validator.ensureTrue(!name.equals("top"),
- "Only the TopCfgDefn should have the name 'top'");
- Validator.ensureTrue(parent != null, "No parent defined");
- }
-
this.name = name;
this.parent = parent;
this.constraints = new LinkedList<Constraint>();
@@ -842,20 +830,6 @@
/**
- * Deregister this managed object definition from its parent.
- * <p>
- * This method <b>must not</b> be called by applications and is
- * only intended for internal testing.
- */
- final void deregisterFromParent() {
- if (parent != null) {
- parent.children.remove(name);
- }
- }
-
-
-
- /**
* Deregister a relation definition from the managed object
* definition.
* <p>
--
Gitblit v1.10.0