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

Nicolas Capponi
23.23.2014 b9fd53230703d3d4f135f27e4fd1597a220c906e
Launch tests with file-based changelog by default
2 files modified
40 ■■■■■ changed files
opendj3-server-dev/build.xml 4 ●●●● patch | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java 36 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/build.xml
@@ -2209,7 +2209,7 @@
    <echo message="      Value must be one of: JE, LOG." />
    <echo message="      JE: use berkeley DB JE as implementation." />
    <echo message="      LOG: use log file as implementation." />
    <echo message="      Default value is JE" />
    <echo message="      Default value is LOG" />
    <echo message=""/>
    <echo message="  -Dtest.diff.srcpath=src/server/org/opends/server/core"/>
    <echo message="      for example includes only the classes in"/>
@@ -2290,7 +2290,7 @@
    <!-- This sets org.opends.test.replicationDbImpl if and only if it's not
         already set. -->
    <condition property="org.opends.test.replicationDbImpl" value="JE">
    <condition property="org.opends.test.replicationDbImpl" value="LOG">
      <not>
        <isset property="org.opends.test.replicationDbImpl" />
      </not>
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
@@ -34,6 +34,7 @@
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.DereferenceAliasesPolicy;
import org.forgerock.opendj.ldap.ModificationType;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.ldap.SearchScope;
@@ -46,6 +47,7 @@
import org.opends.server.core.DeleteOperation;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchListener;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.replication.common.ServerState;
import org.opends.server.replication.plugin.*;
@@ -78,6 +80,9 @@
  /** The tracer object for the debug logger */
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  private static final Set<String> ALL_ATTRIBUTES = newSet("*", "+");
  private static final List<Control> NO_CONTROL = null;
  /**
   * This is the generation id matching the memory test backend with its initial
   * root entry o=test created. This matches the backend obtained calling:
@@ -108,7 +113,7 @@
  private static final String REPLICATION_DB_IMPL_PROPERTY = "org.opends.test.replicationDbImpl";
  public static ReplicationDBImplementation replicationDbImplementation = ReplicationDBImplementation.valueOf(
      System.getProperty(REPLICATION_DB_IMPL_PROPERTY, ReplicationDBImplementation.JE.name()));
      System.getProperty(REPLICATION_DB_IMPL_PROPERTY, ReplicationDBImplementation.LOG.name()));
  /**
   * Replication monitor stats
@@ -931,6 +936,35 @@
    return null;
  }
  /**
   * Performs an internal search, waiting for at most 3 seconds for expected result code and expected
   * number of entries.
   */
  protected InternalSearchOperation waitForSearchResult(String dn, SearchScope scope, String filter,
      ResultCode expectedResultCode, int expectedNbEntries) throws Exception
  {
    InternalSearchOperation searchOp = null;
    int sizeLimitZero = 0;
    int timeLimitZero = 0;
    boolean typesOnlyFalse = false;
    InternalSearchListener noSearchListener = null;
    int count = 0;
    do
    {
      Thread.sleep(10);
      searchOp = connection.processSearch(dn, scope, DereferenceAliasesPolicy.NEVER, sizeLimitZero,
          timeLimitZero, typesOnlyFalse, filter, ALL_ATTRIBUTES, NO_CONTROL, noSearchListener);
      count++;
      System.out.println(searchOp.getResultCode() + " " + searchOp.getSearchEntries().size());
    }
    while (count < 300 && searchOp.getResultCode() != expectedResultCode &&
        searchOp.getSearchEntries().size() != expectedNbEntries);
    final List<SearchResultEntry> entries = searchOp.getSearchEntries();
    Assertions.assertThat(entries).hasSize(expectedNbEntries);
    return searchOp;
  }
  protected static void setReplicationDBImplementation(ReplicationDBImplementation impl)
  {
    replicationDbImplementation = impl;