From a5ce1b53bf9304c08bb51639b48bb77085cd62b3 Mon Sep 17 00:00:00 2001
From: davidely <davidely@localhost>
Date: Sun, 02 Sep 2007 04:00:42 +0000
Subject: [PATCH] There are several improvements to the unit test framework in this commit.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java
index 67fef94..c0a3f01 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java
@@ -97,15 +97,7 @@
                    PasswordValidatorCfg configuration)
          throws InitializationException
   {
-    if (instance == null)
-    {
-      instance = this;
-    }
-    else
-    {
-      throw new InitializationException(Message.raw(
-           "Cannot configure more than one TestPasswordValidator instance"));
-    }
+    instance = this;
 
     lastNewPassword      = null;
     lastCurrentPasswords = null;
@@ -155,6 +147,18 @@
 
 
   /**
+   * Clears the instance after the tests so that it's memory can be reclaimed.
+   * This can actually be quite a bit of memory since it references the
+   * Schema, ConfigEntryS, etc
+   */
+  public static void clearInstanceAfterTests()
+  {
+    instance = null;
+  }
+
+
+
+  /**
    * Retrieves the last <CODE>newPassword</CODE> value provided to the
    * <CODE>passwordIsAcceptable</CODE> method.
    *

--
Gitblit v1.10.0