From 04673fe2f2003091298cd343ee9031bdbe943990 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Sat, 23 Nov 2013 21:33:00 +0000
Subject: [PATCH] Add AfterClass cleanup to make sure tests are not impacting further downstream tests. This issue was detected on the Cloudbees instance using JDK8 EA

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java |    8 ++++++++
 opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/SSFTestCase.java  |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/SSFTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/SSFTestCase.java
index 1673616..150f06e 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/SSFTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/SSFTestCase.java
@@ -100,6 +100,8 @@
 
     @BeforeClass
     public void setupClass() throws Exception {
+//      TestCaseUtils.restartServer();
+      TestCaseUtils.initializeTestBackend(true);
       TestCaseUtils.dsconfig(
               "create-password-policy",
               "--type", "password-policy",
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java
index 2d73f00..d7954cc 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java
@@ -106,6 +106,8 @@
   public void tearDown() throws Exception {
     clearConfigEntries();
     TestCaseUtils.clearJEBackend(false,"userRoot", "dc=example,dc=com");
+    clearAcis("o=test");
+    TestCaseUtils.clearMemoryBackend(TestCaseUtils.TEST_BACKEND_ID);
   }
 
 
@@ -726,6 +728,12 @@
     }
   }
 
+  private void clearAcis(String suffix) throws Exception
+  {
+    deleteAttrsFromEntry(DN.decode("ou=People," + suffix), "aci");
+    deleteAttrsFromEntry(DN.decode("ou=People1," + suffix), "aci");
+  }
+
   /**
    * Remove the attributes specified by the attribute type strings from the
    * entry corresponding to the dn argument.

--
Gitblit v1.10.0