mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
12.54.2013 7c1607d6b7e3cdc3094072425c3ed9641c28731e
opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
@@ -221,6 +221,13 @@
  public static boolean SERVER_STARTED = false;
  /**
   * This is used to store the schema as it was before starting the fake server
   * (for example, it could have been the real schema) so test tearDown can set
   * it back.
   */
  private static Schema schemaBeforeStartingFakeServer;
  /**
   * The LDAP port the server is bound to on start.
   */
  private static int serverLdapPort;
@@ -256,9 +263,13 @@
   * <p>
   * This method is trying hard to provide sensible defaults and core data you
   * would expect from a normal install, including AttributeTypes, etc.
   *
   * @see #shutdownFakeServer() Matching method that must be called in the test
   *      tear down.
   */
  public static void startFakeServer()
  {
    schemaBeforeStartingFakeServer = DirectoryServer.getSchema();
    DirectoryServer.setSchema(initializeInMemory(new Schema()));
  }
@@ -822,6 +833,16 @@
  }
  /**
   * Undo all the setup done by #startFakeServer().
   *
   * @see #startFakeServer() Matching method that starts the fake server
   */
  public static void shutdownFakeServer()
  {
    DirectoryServer.setSchema(schemaBeforeStartingFakeServer);
  }
  /**
   * Shut down the server, if it has been started.
   * @param reason The reason for the shutdown.
   */
opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/AciBodyTest.java
@@ -30,6 +30,7 @@
import org.opends.server.DirectoryServerTestCase;
import org.opends.server.TestCaseUtils;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -44,6 +45,12 @@
    TestCaseUtils.startFakeServer();
  }
  @AfterClass
  public void tearDown()
  {
    TestCaseUtils.shutdownFakeServer();
  }
  @DataProvider(name = "validAcis")
  public Object[][] getValidAcis()
  {