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/api/PasswordValidatorTestCase.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/api/PasswordValidatorTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/api/PasswordValidatorTestCase.java
index 391e501..bc4cd83 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/api/PasswordValidatorTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/api/PasswordValidatorTestCase.java
@@ -34,6 +34,7 @@
 
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
+import org.testng.annotations.AfterClass;
 
 import org.opends.server.TestCaseUtils;
 import org.opends.server.core.AddOperation;
@@ -78,7 +79,18 @@
   public void startServer()
          throws Exception
   {
-    TestCaseUtils.startServer();
+    TestCaseUtils.restartServer();
+  }
+
+
+
+  /**
+   * Drops static references to allow garbage collection. 
+   */
+  @AfterClass
+  public void shutdown()
+  {
+    TestPasswordValidator.clearInstanceAfterTests();
   }
 
 
@@ -267,7 +279,7 @@
 
     Set<ByteString> currentPasswords =
          TestPasswordValidator.getLastCurrentPasswords();
-    assertTrue(currentPasswords.isEmpty());
+    assertTrue(currentPasswords.isEmpty(), "currentPasswords=" + currentPasswords);
   }
 
 

--
Gitblit v1.10.0