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

Jean-Noel Rouvignac
21.59.2013 87609733c25b55663815e9e953849c083c4f6149
OPENDJ-889 Regression: access logger not logging replayed synchronization operations when it should be

Code review: matthew


AbstractTextAccessLogPublisher.java:
Fixed the bug by coming back a bit to what the old code was doing (it is not totally comparable).

AbstractTextAccessLogPublisherTest.java:
Updated the test.
2 files modified
22 ■■■■ changed files
opends/src/server/org/opends/server/loggers/AbstractTextAccessLogPublisher.java 12 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java 10 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
@@ -1069,9 +1069,15 @@
     */
    boolean isLoggable(final Operation operation)
    {
      return !((suppressInternalOperations && operation.isInnerOperation())
          || (suppressSynchronizationOperations
              && operation.isSynchronizationOperation()));
      if (operation.isSynchronizationOperation())
      {
        return !suppressSynchronizationOperations;
      }
      else if (operation.isInnerOperation())
      {
        return !suppressInternalOperations;
      }
      return true;
    }
  }
opends/tests/unit-tests-testng/src/server/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java
@@ -42,10 +42,14 @@
  @DataProvider(name = "isLoggableData")
  public Object[][] getIsLoggableData()
  {
    // when suppress is set to true and the corresponding operation is set to
    // When suppress is set to true and the corresponding operation is set to
    // true too, then the operation is not loggable.
    // You can read the array like this: read two by two from line start, if
    // both are true in a pair, then the expected result is false (not loggable)
    // both are true in a pair, then the expected result is false (not
    // loggable).
    // There is just one exception: when the operation is a synchronization
    // operation and we do not suppress synchronization operation, then we
    // return true regardless of whether this is an internal operation
    return new Object[][] {
      { true, true, true, true, false },
      { true, true, true, false, false },
@@ -55,7 +59,7 @@
      { true, false, true, false, true },
      { true, false, false, true, true },
      { true, false, false, false, true },
      { false, true, true, true, false },
      { false, true, true, true, true },
      { false, true, true, false, true },
      { false, true, false, true, true },
      { false, true, false, false, true },