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

Jean-Noel Rouvignac
11.29.2013 ea16c22c6b725367e499b31054497246b67ca703
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
@@ -721,10 +721,10 @@
    return new ReplSessionSecurity(null, null, null, true);
  }
  protected void executeTask(Entry taskEntry) throws Exception
  protected void executeTask(Entry taskEntry, long maxWaitTimeInMillis) throws Exception
  {
    addTask(taskEntry, ResultCode.SUCCESS, null);
    waitTaskState(taskEntry, TaskState.COMPLETED_SUCCESSFULLY, null);
    waitTaskState(taskEntry, TaskState.COMPLETED_SUCCESSFULLY, maxWaitTimeInMillis, null);
  }
  /**
@@ -757,7 +757,7 @@
    }
    else
    {
      waitTaskState(taskEntry, TaskState.RUNNING, null);
      waitTaskState(taskEntry, TaskState.RUNNING, 20000, null);
    }
    // Entry will be removed at the end of the test
@@ -767,13 +767,13 @@
  }
  protected void waitTaskState(Entry taskEntry, TaskState expectedTaskState,
      Message expectedMessage) throws Exception
      long maxWaitTimeInMillis, Message expectedMessage) throws Exception
  {
    TaskState taskState = null;
    int cpt=40;
    long startTime = System.currentTimeMillis();
    SearchFilter filter = SearchFilter.createFilterFromString("(objectclass=*)");
    Entry resultEntry = null;
    TaskState taskState = null;
    do
    {
      InternalSearchOperation searchOperation =
@@ -786,13 +786,12 @@
      String stateString = resultEntry.getAttributeValue(taskStateType, DECODER);
      taskState = TaskState.fromString(stateString);
      Thread.sleep(500);
      cpt--;
      Thread.sleep(100);
    }
    while (taskState != expectedTaskState
        && taskState != TaskState.STOPPED_BY_ERROR
        && taskState != TaskState.COMPLETED_SUCCESSFULLY
        && cpt > 0);
        && (System.currentTimeMillis() - startTime < maxWaitTimeInMillis));
    // Check that the task contains some log messages.
    AttributeType logMessagesType =