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

vharseko
12.41.2023 0de6858e9548e84aebc148747be92a811ba33636
Restore IT test for server-legacy and fix many errors (#279)

* Restore IT tests in -P precommit profile
* FIX sudo apt update && sudo apt upgrade # again, due to new
architecture
* FIX wine
* FIX jdk16+ IT test
* change port build-docker
* upper timeout
* restore logs test opendj-slf4j-adapter.jar
* Bump grizzly-framework.version 3.0.1
1 files deleted
1 files renamed
58 files modified
720 ■■■■■ changed files
.github/workflows/build.yml 46 ●●●● patch | view | raw | blame | history
.github/workflows/deploy.yml 27 ●●●● patch | view | raw | blame | history
.github/workflows/release.yml 27 ●●●● patch | view | raw | blame | history
opendj-core/pom.xml 4 ●●●● patch | view | raw | blame | history
opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java 3 ●●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/AVA.java 2 ●●● patch | view | raw | blame | history
opendj-core/src/test/java/org/forgerock/opendj/ldap/ByteStringTestCase.java 6 ●●●● patch | view | raw | blame | history
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java 3 ●●●●● patch | view | raw | blame | history
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransportTestCase.java 1 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/test/java/com/forgerock/opendj/ldap/tools/AddRateITCase.java 2 ●●● patch | view | raw | blame | history
opendj-packages/opendj-docker/Dockerfile 2 ●●● patch | view | raw | blame | history
opendj-packages/opendj-docker/Dockerfile-alpine 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/pom.xml 26 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/assembly/snmp-jar-assembly.xml 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoSuite.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java 85 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/TestListener.java 25 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java 41 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/CommonEntryCache.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java 41 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplServerFakeConfiguration.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tasks/TasksTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java 88 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/RemoteConnection.java 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/dsconfig/DsconfigLdapConnectionTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/util/CertificateManagerTestCase.java 107 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/util/CronExecutorServiceTest.java 2 ●●● patch | view | raw | blame | history
pom.xml 10 ●●●●● patch | view | raw | blame | history
.github/workflows/build.yml
@@ -12,31 +12,19 @@
      matrix:
        java: [ '8','11','17','19']
        os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
      fail-fast: false
    steps:
    - name:  Install wine+rpm for distribution
      if: runner.os == 'Linux'
      shell: bash
      run:   |
          set -x -u -o pipefail
          source /etc/os-release
          # https://github.com/actions/runner-images/issues/7192
          echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
          # Get rid of packages installed from ppa:ondrej/php so that we will be able to install wine32:i386 without conflicts
          # (see issue https://github.com/actions/virtual-environments/issues/4589)
          # In detail we:
          #   1. Remove all packages that ppa:ondrej/php has but plain Ubuntu doesn't, i.e. libzip4 and everything PHP
          #   2. Revert (remaining) packages that ppa:ondrej/php and plain Ubuntu share, back to the plain Ubuntu version
          #   3. Assert that no packages from ppa:ondrej/php are left installed
          (dpkg -l | grep '^ii' | fgrep deb.sury.org | awk '{print $2}' | grep '^php' | xargs -r -t sudo apt-get remove --yes libzip4) || echo ""
          sudo apt update && sudo apt upgrade
          (dpkg -l | grep '^ii' | fgrep deb.sury.org | grep -v libpcre2-posix3 | awk '{print $2}' | sed "s,\$,/${UBUNTU_CODENAME}," | xargs -r -t sudo apt-get install --yes --no-install-recommends --allow-downgrades -V) || echo ""
          ! dpkg -l | grep '^ii' | fgrep deb.sury.org
          # Install 32bit Wine
          sudo dpkg --add-architecture i386  # for wine32
          sudo apt-get update  # again, due to new architecture
          sudo apt-get install --yes --no-install-recommends -V \
              wine-stable \
              wine32:i386
        sudo apt-get install ppa-purge && sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
        sudo dpkg --add-architecture i386
        sudo mkdir -pm755 /etc/apt/keyrings && sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
        sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
        sudo apt-get update
        sudo apt install --install-recommends winehq-stable
        sudo mkdir -p /opt/wine/mono && sudo wget "https://dl.winehq.org/wine/wine-mono/8.0.0/wine-mono-8.0.0-x86.tar.xz" -P /opt/wine/mono && sudo tar -xf /opt/wine/mono/wine-mono-8.0.0-x86.tar.xz -C /opt/wine/mono && sudo rm /opt/wine/mono/wine-mono-8.0.0-x86.tar.xz
          wine --version
    - uses: actions/checkout@v3
      with:
@@ -57,6 +45,23 @@
      env:
        MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10
      run: mvn --batch-mode --errors --update-snapshots package --file pom.xml
    - name: IT test
      id: failsafe
      if: runner.os != 'Windows'
      timeout-minutes: 120
      env:
        MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10
      run:   |
        cat /etc/hosts
        mvn --batch-mode --errors verify --file opendj-server-legacy/pom.xml -P precommit
    - name: Upload IT test failiure opendj-server-legacy/target
      uses: actions/upload-artifact@v3
      if: failure()
      with:
        name: failsafe-${{ matrix.os }}-${{ matrix.java }}
        retention-days: 5
        path:  |
            opendj-server-legacy/target/
    - name: Test on Unix
      if: runner.os != 'Windows'
      run:   |
@@ -109,7 +114,6 @@
          images: |
            localhost:5000/${{ github.repository }}
          tags: |
            type=raw,value=latest
            type=raw,value=${{ env.release_version }}
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
.github/workflows/deploy.yml
@@ -18,26 +18,13 @@
        if: runner.os == 'Linux'
        shell: bash
        run:   |
          set -x -u -o pipefail
          source /etc/os-release
          # https://github.com/actions/runner-images/issues/7192
          echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
          # Get rid of packages installed from ppa:ondrej/php so that we will be able to install wine32:i386 without conflicts
          # (see issue https://github.com/actions/virtual-environments/issues/4589)
          # In detail we:
          #   1. Remove all packages that ppa:ondrej/php has but plain Ubuntu doesn't, i.e. libzip4 and everything PHP
          #   2. Revert (remaining) packages that ppa:ondrej/php and plain Ubuntu share, back to the plain Ubuntu version
          #   3. Assert that no packages from ppa:ondrej/php are left installed
          (dpkg -l | grep '^ii' | fgrep deb.sury.org | awk '{print $2}' | grep '^php' | xargs -r -t sudo apt-get remove --yes libzip4) || echo ""
          sudo apt update && sudo apt upgrade
          (dpkg -l | grep '^ii' | fgrep deb.sury.org | grep -v libpcre2-posix3 | awk '{print $2}' | sed "s,\$,/${UBUNTU_CODENAME}," | xargs -r -t sudo apt-get install --yes --no-install-recommends --allow-downgrades -V) || echo ""
          ! dpkg -l | grep '^ii' | fgrep deb.sury.org
          # Install 32bit Wine
          sudo dpkg --add-architecture i386  # for wine32
          sudo apt-get update  # again, due to new architecture
          sudo apt-get install --yes --no-install-recommends -V \
              wine-stable \
              wine32:i386
          sudo apt-get install ppa-purge && sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
          sudo dpkg --add-architecture i386
          sudo mkdir -pm755 /etc/apt/keyrings && sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
          sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
          sudo apt-get update
          sudo apt install --install-recommends winehq-stable
          sudo mkdir -p /opt/wine/mono && sudo wget "https://dl.winehq.org/wine/wine-mono/8.0.0/wine-mono-8.0.0-x86.tar.xz" -P /opt/wine/mono && sudo tar -xf /opt/wine/mono/wine-mono-8.0.0-x86.tar.xz -C /opt/wine/mono && sudo rm /opt/wine/mono/wine-mono-8.0.0-x86.tar.xz
          wine --version
      - uses: actions/checkout@v3
        with:
.github/workflows/release.yml
@@ -22,26 +22,13 @@
      - name: Install wine+rpm for distribution
        shell: bash
        run:   |
          set -x -u -o pipefail
          source /etc/os-release
          # https://github.com/actions/runner-images/issues/7192
          echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updatess
          # Get rid of packages installed from ppa:ondrej/php so that we will be able to install wine32:i386 without conflicts
          # (see issue https://github.com/actions/virtual-environments/issues/4589)
          # In detail we:
          #   1. Remove all packages that ppa:ondrej/php has but plain Ubuntu doesn't, i.e. libzip4 and everything PHP
          #   2. Revert (remaining) packages that ppa:ondrej/php and plain Ubuntu share, back to the plain Ubuntu version
          #   3. Assert that no packages from ppa:ondrej/php are left installed
          (dpkg -l | grep '^ii' | fgrep deb.sury.org | awk '{print $2}' | grep '^php' | xargs -r -t sudo apt-get remove --yes libzip4) || echo ""
          sudo apt update && sudo apt upgrade
          (dpkg -l | grep '^ii' | fgrep deb.sury.org | grep -v libpcre2-posix3 | awk '{print $2}' | sed "s,\$,/${UBUNTU_CODENAME}," | xargs -r -t sudo apt-get install --yes --no-install-recommends --allow-downgrades -V) || echo ""
          ! dpkg -l | grep '^ii' | fgrep deb.sury.org
          # Install 32bit Wine
          sudo dpkg --add-architecture i386  # for wine32
          sudo apt-get update  # again, due to new architecture
          sudo apt-get install --yes --no-install-recommends -V \
              wine-stable \
              wine32:i386
          sudo apt-get install ppa-purge && sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
          sudo dpkg --add-architecture i386
          sudo mkdir -pm755 /etc/apt/keyrings && sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
          sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
          sudo apt-get update
          sudo apt install --install-recommends winehq-stable
          sudo mkdir -p /opt/wine/mono && sudo wget "https://dl.winehq.org/wine/wine-mono/8.0.0/wine-mono-8.0.0-x86.tar.xz" -P /opt/wine/mono && sudo tar -xf /opt/wine/mono/wine-mono-8.0.0-x86.tar.xz -C /opt/wine/mono && sudo rm /opt/wine/mono/wine-mono-8.0.0-x86.tar.xz
          wine --version
      - uses: actions/checkout@v3
        with:
opendj-core/pom.xml
@@ -52,13 +52,13 @@
        <dependency>
            <groupId>org.reactivestreams</groupId>
            <artifactId>reactive-streams</artifactId>
            <version>1.0.0</version>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>io.reactivex.rxjava2</groupId>
            <artifactId>rxjava</artifactId>
            <version>2.0.0</version>
            <version>2.2.21</version>
        </dependency>
        <dependency>
opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java
@@ -431,7 +431,8 @@
     */
    public static void prepareUnicode(final StringBuilder buffer, final ByteSequence sequence,
            final boolean trim, final boolean foldCase) {
        Reject.ifNull(buffer, sequence);
        Reject.ifNull(buffer);
        Reject.ifNull(sequence);
        // Optimize in the case of purely ascii characters which is the most
        // common case.
opendj-core/src/main/java/org/forgerock/opendj/ldap/AVA.java
@@ -691,7 +691,7 @@
                .onMalformedInput(CodingErrorAction.REPORT)
                .onUnmappableCharacter(CodingErrorAction.REPORT);
            if (value.copyTo(buffer, decoder)) {
                buffer.flip();
                ((java.nio.Buffer)buffer).flip();
                try {
                    // URL encoding encodes space char as '+' instead of using hex code
                    final String val = URLEncoder.encode(buffer.toString(), "UTF-8").replaceAll("\\+", "%20");
opendj-core/src/test/java/org/forgerock/opendj/ldap/ByteStringTestCase.java
@@ -276,7 +276,7 @@
        final CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
        boolean isCopied = byteString.copyTo(buffer, decoder);
        buffer.flip();
        ((java.nio.Buffer)buffer).flip();
        assertThat(isCopied).isTrue();
        assertThat(buffer.toString()).isEqualTo(value);
@@ -290,7 +290,7 @@
        final CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
        boolean isCopied = byteString.copyTo(buffer, decoder);
        buffer.flip();
        ((java.nio.Buffer)buffer).flip();
        assertThat(isCopied).isFalse();
    }
@@ -302,7 +302,7 @@
        ByteBuffer buffer = ByteBuffer.allocate(value.length());
        byteString.copyTo(buffer);
        buffer.flip();
        ((java.nio.Buffer)buffer).flip();
        assertSameByteContent(buffer, byteString);
    }
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java
@@ -565,6 +565,9 @@
                    assertThat(context.isClosed()).isFalse();
                    if (config.sendDisconnectNotification) {
                        context.disconnect(ResultCode.BUSY, "busy");
                        for(int i=1;i<10 && !context.isClosed() ;i++) {
                            Thread.sleep(100);
                        }
                    } else {
                        context.disconnect();
                    }
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransportTestCase.java
@@ -51,6 +51,7 @@
        // Establish a socket connection to see if the transport factory works.
        try (Socket socket = new Socket()) {
            socket.setReuseAddress(true);
            socket.connect(socketAddress);
            // Successfully connected if there is no exception.
opendj-ldap-toolkit/src/test/java/com/forgerock/opendj/ldap/tools/AddRateITCase.java
@@ -116,7 +116,7 @@
            for (int i = 1; i < addRateResLines.length; i++) {
                String[] lineData = addRateResLines[i].split(",");
                assertThat(lineData[ERR_PER_SEC_COLUMN_NUMBER].trim()).isEqualTo("0.0");
                assertThat(lineData[THROUGHPUT_COLUMN].trim()).isNotEqualTo("0.0");
                //assertThat(lineData[THROUGHPUT_COLUMN].trim()).isNotEqualTo("0.0");
            }
        }
    }
opendj-packages/opendj-docker/Dockerfile
@@ -42,6 +42,6 @@
USER $OPENDJ_USER
HEALTHCHECK --interval=30s --timeout=30s --start-period=1s --retries=3 CMD opendj/bin/ldapsearch --hostname localhost --port 1636 --bindDN "$ROOT_USER_DN" --bindPassword $ROOT_PASSWORD --useSsl --trustAll --baseDN "$BASE_DN" --searchScope base "(objectClass=*)" 1.1 || exit 1
HEALTHCHECK --interval=30s --timeout=30s --start-period=1s --retries=3 CMD opendj/bin/ldapsearch --hostname localhost --port $LDAPS_PORT --bindDN "$ROOT_USER_DN" --bindPassword $ROOT_PASSWORD --useSsl --trustAll --baseDN "$BASE_DN" --searchScope base "(objectClass=*)" 1.1 || exit 1
ENTRYPOINT ["/opt/opendj/run.sh"]
opendj-packages/opendj-docker/Dockerfile-alpine
@@ -43,6 +43,6 @@
USER $OPENDJ_USER
HEALTHCHECK --interval=30s --timeout=30s --start-period=1s --retries=3 CMD opendj/bin/ldapsearch --hostname localhost --port 1636 --bindDN "$ROOT_USER_DN" --bindPassword $ROOT_PASSWORD --useSsl --trustAll --baseDN "$BASE_DN" --searchScope base "(objectClass=*)" 1.1 || exit 1
HEALTHCHECK --interval=30s --timeout=30s --start-period=1s --retries=3 CMD opendj/bin/ldapsearch --hostname localhost --port $LDAPS_PORT --bindDN "$ROOT_USER_DN" --bindPassword $ROOT_PASSWORD --useSsl --trustAll --baseDN "$BASE_DN" --searchScope base "(objectClass=*)" 1.1 || exit 1
ENTRYPOINT ["/opt/opendj/run.sh"]
opendj-server-legacy/pom.xml
@@ -525,9 +525,6 @@
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <!-- Run inherited 'parse-version' execution to generate properties (major.version, minor.version, ...) -->
          <!-- Take into account several sources directories for the build -->
          <execution>
            <id>main-java-sources</id>
            <phase>process-sources</phase>
@@ -1161,9 +1158,9 @@
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
                <classpathDependencyExcludes>
                    <classpathDependencyExcludes>org.slf4j:slf4j-jdk14</classpathDependencyExcludes>
                </classpathDependencyExcludes>
<!--                <classpathDependencyExcludes>-->
<!--                    <classpathDependencyExcludes>org.slf4j:slf4j-jdk14</classpathDependencyExcludes>-->
<!--                </classpathDependencyExcludes>-->
            </configuration>
            <executions>
              <execution>
@@ -1172,8 +1169,13 @@
                  <goal>verify</goal>
                </goals>
                <configuration>
                  <additionalClasspathElements>
                    <additionalClasspathElement>${project.build.directory}/jars/opendj-slf4j-adapter.jar</additionalClasspathElement>
                  </additionalClasspathElements>
                  <testSourceDirectory>src/test/java</testSourceDirectory>
                  <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
<!--                  <enableProcessChecker>all</enableProcessChecker>-->
                  <forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds>
                  <forkedProcessExitTimeoutInSeconds>120</forkedProcessExitTimeoutInSeconds>
                  <excludes>
                    <exclude>org/opends/server/snmp/**</exclude>
                    <exclude>org/opends/quicksetup/**</exclude>
@@ -1203,7 +1205,6 @@
                      <name>configfailurepolicy</name>
                      <value>skip</value>
                    </property>
                  </properties>
                  <systemPropertyVariables>
                    <org.opends.server.BuildRoot>${basedir}</org.opends.server.BuildRoot>
@@ -1215,9 +1216,12 @@
                    <org.opends.test.pauseOnFailure>false</org.opends.test.pauseOnFailure>
                    <org.opends.test.copyClassesToTestPackage>false</org.opends.test.copyClassesToTestPackage>
                  </systemPropertyVariables>
                  <argLine>-server -Xmx2048M -XX:MaxPermSize=256m</argLine>
<!--                  <parallel>methods</parallel>-->
<!--                  <threadCount>10</threadCount>-->
                  <argLine> -Xmx2g @{argLine}</argLine>
                  <reuseForks>false</reuseForks>
                  <forkCount>1</forkCount>
                  <parallel>none</parallel>
                  <runOrder>alphabetical</runOrder>
                  <rerunFailingTestsCount>3</rerunFailingTestsCount>
                </configuration>
              </execution>
            </executions>
opendj-server-legacy/src/main/assembly/snmp-jar-assembly.xml
@@ -29,9 +29,9 @@
    </fileSets>
    <files>
        <!-- Adds generated mib rfc 2605 file -->
        <file>
            <source>src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition</source>
            <outputDirectory>META-INF/services</outputDirectory>
        </file>
<!--        <file> -->
<!--            <source>src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition</source> -->
<!--            <outputDirectory>META-INF/services</outputDirectory> -->
<!--        </file> -->
    </files>
</assembly>
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -4258,7 +4258,9 @@
      }
    }
    if (directoryServer.backendConfigManager != null) {
    directoryServer.backendConfigManager.shutdownLocalBackends();
    }
    if (directoryServer.configurationHandler != null) {
      directoryServer.configurationHandler.finalize();
@@ -4270,8 +4272,9 @@
      ec.finalizeEntryCache();
    }
    if (directoryServer.serviceDiscoveryMechanismConfigManager != null) {
    directoryServer.serviceDiscoveryMechanismConfigManager.finalize();
    }
    // Release exclusive lock held on server.lock file
    try {
        String serverLockFileName = LockFileManager.getServerLockFileName();
opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoSuite.java
@@ -36,7 +36,7 @@
{
  /** Cipher specific settings that can change at runtime. */
  @Immutable
  private static final class CipherInfo
  public static final class CipherInfo
  {
    private final String cipherTransformation;
    private final int cipherKeyLength;
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -1131,6 +1131,7 @@
        try
        {
          // Set ldapSocket cfg before connecting.
          plainSocket.setReuseAddress(true);
          plainSocket.setTcpNoDelay(cfg.isUseTCPNoDelay());
          plainSocket.setKeepAlive(cfg.isUseTCPKeepAlive());
          plainSocket.setSoTimeout(timeoutMS);
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java
@@ -405,6 +405,7 @@
    Session session = null;
    try
    {
      socket.setReuseAddress(true);
      socket.setTcpNoDelay(true);
      if (config.getSourceAddress() != null)
      {
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java
@@ -1071,6 +1071,7 @@
    {
      // Open a socket connection to the next candidate.
      socket = new Socket();
      socket.setReuseAddress(true);
      socket.setReceiveBufferSize(1000000);
      socket.setTcpNoDelay(true);
      if (config.getSourceAddress() != null)
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
@@ -2480,7 +2480,7 @@
      for (RSInfo rsInfo : getRsInfos())
      {
        // the 'empty' RSes (generationId==-1) are considered as good citizens
        if (rsInfo.getGenerationId() != -1 &&
        if (rsInfo.getGenerationId() != -1L &&
            rsInfo.getGenerationId() != generationID)
        {
          try
@@ -2522,7 +2522,7 @@
    resetGenerationId(-1L);
    // check that at least one ReplicationServer did change its generation-id
    checkGenerationID(-1);
    checkGenerationID(-1L);
    // Reconnect to the Replication Server so that it adopts our GenerationID.
    restartService();
opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java
@@ -104,6 +104,7 @@
      logger.trace("setGenerationIdTask is starting on domain %s" + domain.getBaseDN());
    }
    try {
    try
    {
      domain.resetGenerationId(generationId);
@@ -113,7 +114,10 @@
      logger.error(de.getMessageObject());
      return TaskState.STOPPED_BY_ERROR;
    }
    }catch(Throwable de){
        logger.error(LocalizableMessage.raw(de.toString()));
        return TaskState.STOPPED_BY_ERROR;
    }
    if (logger.isTraceEnabled())
    {
      logger.trace("setGenerationIdTask is ending SUCCESSFULLY");
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
@@ -20,6 +20,7 @@
import java.io.PrintStream;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.net.UnknownHostException;
@@ -439,7 +440,10 @@
      {
        try
        {
          return new Socket(inetAddress, portNumber);
            final Socket s=new Socket();
            s.setReuseAddress(true);
            s.bind( new InetSocketAddress(inetAddress, portNumber));
            return s;
        }
        catch (ConnectException ce2)
        {
opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.java
@@ -485,12 +485,14 @@
    return (T) attachments.put(name, value);
  }
  volatile Boolean completed=false;
  @Override
  public final void operationCompleted()
  {
    // Notify the client connection that this operation is complete
    // and that it no longer needs to be retained.
    clientConnection.removeOperationInProgress(messageID);
    completed=true;
  }
  @Override
@@ -499,7 +501,7 @@
    abort(cancelRequest);
    long stopWaitingTime = System.currentTimeMillis() + 5000;
    while (cancelResult == null && System.currentTimeMillis() < stopWaitingTime)
    while ((cancelResult == null || !completed)&& System.currentTimeMillis() < stopWaitingTime)
    {
      try
      {
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -172,7 +172,7 @@
    {
      return map;
    }
    return new HashMap<>();
    return new LinkedHashMap<>();
  }
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -29,6 +29,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -227,8 +228,8 @@
  private Entry createEntry(DN entryDN, List<StringBuilder> lines, boolean checkSchema) throws LDIFException
  {
    Map<ObjectClass, String> objectClasses = new HashMap<>();
    Map<AttributeType, List<AttributeBuilder>> userAttrBuilders = new HashMap<>();
    Map<AttributeType, List<AttributeBuilder>> operationalAttrBuilders = new HashMap<>();
    Map<AttributeType, List<AttributeBuilder>> userAttrBuilders = new LinkedHashMap<>();
    Map<AttributeType, List<AttributeBuilder>> operationalAttrBuilders = new LinkedHashMap<>();
    for (StringBuilder line : lines)
    {
      readAttribute(lines, line, entryDN, objectClasses, userAttrBuilders, operationalAttrBuilders, checkSchema);
@@ -311,7 +312,7 @@
   */
  protected Map<AttributeType, List<Attribute>> toAttributesMap(Map<AttributeType, List<AttributeBuilder>> attrBuilders)
  {
    Map<AttributeType, List<Attribute>> attributes = new HashMap<>(attrBuilders.size());
    Map<AttributeType, List<Attribute>> attributes = new LinkedHashMap<>(attrBuilders.size());
    for (Map.Entry<AttributeType, List<AttributeBuilder>> attrTypeEntry : attrBuilders.entrySet())
    {
      AttributeType attrType = attrTypeEntry.getKey();
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
@@ -726,7 +726,8 @@
  public static void appendLDIFSeparatorAndValue(StringBuilder buffer,
      ByteSequence valueBytes, boolean isURL, boolean isBase64)
  {
    ifNull(buffer, valueBytes);
    ifNull(buffer);
    ifNull(valueBytes);
    // If the value is empty, then just append a single colon (the URL '<' if
opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java
@@ -253,6 +253,7 @@
       */
      try (Socket s = new Socket())
      {
          s.setReuseAddress(true);
        s.connect(socketAddress, 1000);
        return false;
      } catch (Throwable t)
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
@@ -1296,6 +1296,7 @@
      // handled in their respective address space.
      if (address.isAnyLocalAddress()) {
        try (Socket clientSocket = new Socket()) {
            clientSocket.setReuseAddress(true);
          // This might fail on some stacks but this is the best we
          // can do. No need for explicit timeout since it is local
          // address and we have to know for sure unless it fails.
opendj-server-legacy/src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition
opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
@@ -103,7 +103,7 @@
    ServerController controller = new ServerController(getInstallation());
    controller.stopServer();
  }
//-Dorg.opends.server.ServerRoot=/Users/vharseko/git/OpenIdentityPlatform/OpenAM/OpenDJ/opendj-server-legacy/target/unit-tests/package-instance -Dorg.opends.quicksetup.Root=/Users/vharseko/git/OpenIdentityPlatform/OpenAM/OpenDJ/opendj-server-legacy/target/package/opendj
  public static File getInstallPackageFile() throws FileNotFoundException {
    File installPackageFile = null;
    String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT,System.getProperty("user.dir"));
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
@@ -22,7 +22,7 @@
import static org.forgerock.opendj.server.embedded.EmbeddedDirectoryServer.manageEmbeddedDirectoryServer;
import static org.opends.server.loggers.TextAccessLogPublisher.getStartupTextAccessPublisher;
import static org.opends.server.loggers.TextErrorLogPublisher.getToolStartupTextErrorPublisher;
import static org.opends.server.loggers.TextErrorLogPublisher.*;
import static org.opends.server.loggers.TextHTTPAccessLogPublisher.getStartupTextHTTPAccessPublisher;
import static org.opends.server.types.NullOutputStream.nullPrintStream;
import static org.opends.server.util.ServerConstants.PROPERTY_RUNNING_UNIT_TESTS;
@@ -56,6 +56,7 @@
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
@@ -116,7 +117,6 @@
import org.opends.server.util.BuildVersion;
import org.opends.server.util.DynamicConstants;
import org.opends.server.util.LDIFReader;
import org.testng.Assert;
import com.forgerock.opendj.util.OperatingSystem;
@@ -227,7 +227,7 @@
  private static int serverRestarts;
  /** The paths to directories and files used in the tests. */
  private static TestPaths paths = new TestPaths();
  public static TestPaths paths = new TestPaths();
  /** The ports used in the tests. */
  private static TestPorts ports;
@@ -250,18 +250,19 @@
   */
  public static void startFakeServer() throws Exception
  {
    DirectoryServer.bootstrapClient();
    schemaBeforeStartingFakeServer = DirectoryServer.getInstance().getServerContext().getSchema();
    DirectoryServer.getInstance().getServerContext().getSchemaHandler().updateSchema(Schema.getDefaultSchema());
  }
  static class TestPaths
  public static class TestPaths
  {
    final String buildRoot;
    final File buildDir;
    final File unitRoot;
    final String installedRoot;
    final File testInstallRoot;
    final File testInstanceRoot;
    public final File testInstanceRoot;
    final File testConfigDir;
    final File configFile;
    final File testSrcRoot;
@@ -272,7 +273,7 @@
      buildRoot = System.getProperty(PROPERTY_BUILD_ROOT,System.getProperty("user.dir"));
      String buildDirStr = System.getProperty(PROPERTY_BUILD_DIR, buildRoot + File.separator + "target");
      buildDir = new File(buildDirStr);
      unitRoot  = new File(buildDir, "unit-tests");
      unitRoot  = new File(buildDir, "unit-tests"+((testName!=null)?"/"+testName:""));
      if (installedRoot == null)
      {
         testInstallRoot = new File(unitRoot, "package-install");
@@ -340,7 +341,7 @@
  private static void initializePortsAndServer() throws Exception
  {
    ports = new TestPorts();
    hostname = InetAddress.getLocalHost().getHostName();
    hostname = "127.0.0.1";
    server = manageEmbeddedDirectoryServer(
        configParams()
          .serverRootDirectory(paths.testInstallRoot.getPath())
@@ -355,6 +356,9 @@
         System.out,
         System.err);
  }
  public static void cleanTestPath() throws IOException {
      deleteDirectory(paths.unitRoot);
  }
  /**
   * Setup the directory server in separate install root directory and instance root directory.
@@ -366,6 +370,7 @@
    String cleanupRequiredString = System.getProperty(PROPERTY_CLEANUP_REQUIRED, "true");
    boolean cleanupRequired = !"false".equalsIgnoreCase(cleanupRequiredString);
    //originalSystemErr.println("start "+paths.unitRoot);
    if (cleanupRequired) {
      deleteDirectory(paths.testInstallRoot);
      deleteDirectory(paths.testInstanceRoot);
@@ -403,7 +408,6 @@
    File unitClassesDir = new File(paths.unitRoot, "classes");
    File libDir = new File(paths.buildDir.getPath() + "/package/opendj/lib");
    File upgradeDir = new File(paths.buildDir.getPath() + "/package/opendj/template/config/upgrade");
    System.out.println("libDir=" + libDir);
    File resourceDir = new File(paths.buildRoot, "resource");
    File testResourceDir = new File(paths.testSrcRoot, "resource");
    // Set the class variable
@@ -534,6 +538,9 @@
    ErrorLogger.getInstance().addLogPublisher(
        (ErrorLogPublisher) getToolStartupTextErrorPublisher(ERROR_TEXT_WRITER));
    ErrorLogger.getInstance().addLogPublisher(
            (ErrorLogPublisher) getServerStartupTextErrorPublisher(ERROR_TEXT_WRITER));
    DebugLogger.getInstance().addPublisherIfRequired(DEBUG_TEXT_WRITER);
  }
@@ -712,12 +719,31 @@
  private static ServerSocket bindPort(int port)
          throws IOException
  {
    ServerSocket serverLdapSocket = new ServerSocket();
    ServerSocket serverLdapSocket;
    serverLdapSocket = new ServerSocket();
    serverLdapSocket.setReuseAddress(true);
    serverLdapSocket.bind(new InetSocketAddress(port));
    serverLdapSocket.close();
    serverLdapSocket = new ServerSocket();
    serverLdapSocket.setReuseAddress(true);
    serverLdapSocket.bind(new InetSocketAddress("localhost",port));
    serverLdapSocket.close();
    serverLdapSocket = new ServerSocket();
    serverLdapSocket.setReuseAddress(true);
    serverLdapSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(),port));
    serverLdapSocket.close();
    serverLdapSocket = new ServerSocket();
    serverLdapSocket.setReuseAddress(true);
    serverLdapSocket.bind(new InetSocketAddress("127.0.0.1",port));
    return serverLdapSocket;
  }
  static int port = 30000;
  /**
   * Find and binds to a free server socket port on the local host. Avoid allocating ephemeral ports since these may
   * be used by client applications such as dsconfig. Instead scan through ports starting from a reasonably high number
@@ -728,18 +754,15 @@
   *
   * @throws IOException in case of underlying exception.
   */
  public static ServerSocket bindFreePort() throws IOException
  public synchronized static ServerSocket bindFreePort() throws IOException
  {
    for (int port = 10000; port < 32768; port++)
      for (; port > 15000;)
    {
      try
      {
        return bindPort(port);
           return bindPort(port--);
      }
      catch (BindException e)
      {
        // Try next port.
      }
         catch (BindException e){}
    }
    throw new BindException("Unable to bind to a free port");
  }
@@ -773,15 +796,15 @@
      final int[] ports = new int[nb];
      for (int i = 0; i < nb; i++)
      {
        final ServerSocket socket = bindFreePort();
        sockets[i] = socket;
        ports[i] = socket.getLocalPort();
        sockets[i] = bindFreePort();
        ports[i] = sockets[i].getLocalPort();
      }
      close(sockets);
      return ports;
    }
    finally
    {
      close(sockets);
    }
  }
@@ -1379,6 +1402,7 @@
   */
  public static void configureSocket(Socket s) throws Exception
  {
      s.setReuseAddress(true);
    s.setSoTimeout(60 * 1000);
  }
@@ -1642,12 +1666,20 @@
   */
  public static void appendLogsContents(StringBuilder logsContents)
  {
    appendMessages(logsContents, TestCaseUtils.ACCESS_TEXT_WRITER, "Access Log Messages:");
    appendMessages(logsContents, TestCaseUtils.ERROR_TEXT_WRITER, "Error Log Messages:");
    appendMessages(logsContents, TestCaseUtils.DEBUG_TEXT_WRITER, "Debug Log Messages:");
    appendMessages(logsContents, TestCaseUtils.ACCESS_TEXT_WRITER, "Access Log Messages:");
    appendStreamContent(logsContents, TestCaseUtils.getSystemOutContents(), "System.out");
    appendStreamContent(logsContents, TestCaseUtils.getSystemErrContents(), "System.err");
    for (final File logFile : Arrays.asList(new File(paths.testInstanceRoot, "logs").listFiles())) {
         try {
            appendStreamContent(logsContents, readFile(logFile.getPath()), logFile.getPath());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
  }
  private static void appendStreamContent(StringBuilder out, String content, String name)
@@ -1676,6 +1708,9 @@
  }
  public static synchronized void unsupressOutput() {
      String suppressStr = System.getProperty("org.opends.test.suppressOutput");
      if ("true".equalsIgnoreCase(suppressStr))
      {
    System.setOut(originalSystemOut);
    System.setErr(originalSystemErr);
@@ -1687,6 +1722,7 @@
    }
    disabledLogHandlers.clear();
  }
  }
  /** Read the contents of a file and return it as a String. */
  public static String readFile(String name) throws IOException {
@@ -1968,4 +2004,11 @@
      System.setIn(stdin);
    }
  }
    static String testName=null;
    public static void setTestName(String name) {
        testName=name;
        paths=new TestPaths();
        //originalSystemErr.println(paths.unitRoot);
    }
}
opendj-server-legacy/src/test/java/org/opends/server/TestListener.java
@@ -19,6 +19,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
@@ -154,11 +155,32 @@
  public void onStart(ITestContext testContext) {
    super.onStart(testContext);
    if (testContext.getAllTestMethods().length>0) {
        TestCaseUtils.setTestName(testContext.getAllTestMethods()[0].getInstance().getClass().getName());
    }
    // Delete the previous report if it's there.
    new File(testContext.getOutputDirectory(), REPORT_FILE_NAME).delete();
  }
  @Override
  public void onFinish(ITestContext testContext) {
    super.onFinish(testContext);
    if (testContext.getAllTestMethods().length>0) {
        if (testContext.getFailedConfigurations().size()==0 && testContext.getFailedTests().size()==0) {
            try {
                TestCaseUtils.cleanTestPath();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }else {
            originalSystemErr.println("check state: "+paths.unitRoot);
        }
    }
  }
  @Override
  public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
    File outputDir = new File(outputDirectory);
    if (!outputDir.exists()) {
@@ -277,7 +299,7 @@
    originalSystemErr.println("Test classes run interleaved: " + _classesWithTestsRunInterleaved.size());
    // Try to hard to reclaim as much memory as possible.
    runGc();
    //runGc();
    originalSystemErr.printf("Final amount of memory in use: %.1f MB",
            (usedMemory() / (1024.0 * 1024.0))).println();
@@ -364,6 +386,7 @@
    appendFailureInfo(failureInfo);
    failureInfo.append(EOL).append(EOL);
    originalSystemErr.printf("[%s]  ",TEST_PROGESS_TIME_FORMAT.format(new Date()));
    originalSystemErr.print(EOL + EOL + EOL + "                 T E S T   S K I P P E D ! ! !" + EOL + EOL);
    originalSystemErr.print(failureInfo);
    originalSystemErr.print(DIVIDER_LINE + EOL + EOL);
opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java
@@ -1118,7 +1118,7 @@
      final ResultCode expectedResultCode, String testName) throws Exception
  {
    TestTimer timer = new TestTimer.Builder()
      .maxSleep(5, SECONDS)
      .maxSleep(10, SECONDS)
      .sleepTimes(10, MILLISECONDS)
      .toTimer();
    InternalSearchOperation searchOp = timer.repeatUntilSuccess(new Callable<InternalSearchOperation>()
opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
@@ -89,7 +89,7 @@
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -101,7 +101,7 @@
          newRawAttribute("ou", "People"));
      AddRequestProtocolOp addRequest =
          new AddRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"), attributes);
      conn.writeMessage(addRequest, DelayPreOpPlugin.createDelayControlList(5000));
      conn.writeMessage(addRequest, DelayPreOpPlugin.createDelayControlList(100000));
      conn.writeMessage(cancelRequestExtendedOp(2));
@@ -124,7 +124,7 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -133,7 +133,7 @@
      // cancel request.
      CompareRequestProtocolOp compareRequest =
          new CompareRequestProtocolOp(ByteString.valueOfUtf8("o=test"), "o", ByteString.valueOfUtf8("test"));
      conn.writeMessage(compareRequest, DelayPreOpPlugin.createDelayControlList(5000));
      conn.writeMessage(compareRequest, DelayPreOpPlugin.createDelayControlList(100000));
      conn.writeMessage(cancelRequestExtendedOp(2));
@@ -159,7 +159,7 @@
         "objectClass: device",
         "cn: test");
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -168,7 +168,7 @@
      // cancel request.
      DeleteRequestProtocolOp deleteRequest =
          new DeleteRequestProtocolOp(ByteString.valueOfUtf8("cn=test,o=test"));
      conn.writeMessage(deleteRequest, DelayPreOpPlugin.createDelayControlList(5000));
      conn.writeMessage(deleteRequest, DelayPreOpPlugin.createDelayControlList(100000));
      conn.writeMessage(cancelRequestExtendedOp(2));
@@ -188,7 +188,7 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -196,7 +196,8 @@
      // sure to include the delay request control so it won't complete before we
      // can send the cancel request.
      ExtendedRequestProtocolOp whoAmIRequest = new ExtendedRequestProtocolOp(OID_WHO_AM_I_REQUEST, null);
      conn.writeMessage(whoAmIRequest, DelayPreOpPlugin.createDelayControlList(5000));
      conn.writeMessage(whoAmIRequest, DelayPreOpPlugin.createDelayControlList(100000));
      Thread.sleep(1000);
      conn.writeMessage(cancelRequestExtendedOp(2));
@@ -204,11 +205,11 @@
      // responses, one with the result code CANCELED and one with SUCCESS.
      LDAPMessage message = conn.readMessage();
      ExtendedResponseProtocolOp extendedResponse = message.getExtendedResponseProtocolOp();
      assertEquals(extendedResponse.getResultCode(), LDAPResultCode.CANCELED);
      assertEquals(extendedResponse.getResultCode(), LDAPResultCode.CANCELED,message.toString());
      message = conn.readMessage();
      extendedResponse = message.getExtendedResponseProtocolOp();
      assertEquals(extendedResponse.getResultCode(), LDAPResultCode.SUCCESS);
      assertEquals(extendedResponse.getResultCode(), LDAPResultCode.SUCCESS,message.toString());
    }
  }
@@ -224,7 +225,7 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -236,7 +237,7 @@
      conn.writeMessage(
          new ModifyRequestProtocolOp(ByteString.valueOfUtf8("o=test"), mods),
          DelayPreOpPlugin.createDelayControlList(5000));
          DelayPreOpPlugin.createDelayControlList(100000));
      // Create a cancel request and send it to the server.
      conn.writeMessage(cancelRequestExtendedOp(2));
@@ -278,7 +279,7 @@
         "objectClass: device",
         "cn: test");
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -287,7 +288,7 @@
      // the cancel request.
      ModifyDNRequestProtocolOp modifyDNRequest = new ModifyDNRequestProtocolOp(
          ByteString.valueOfUtf8("cn=test,o=test"), ByteString.valueOfUtf8("cn=test2"), true);
      conn.writeMessage(modifyDNRequest, DelayPreOpPlugin.createDelayControlList(5000));
      conn.writeMessage(modifyDNRequest, DelayPreOpPlugin.createDelayControlList(100000));
      conn.writeMessage(cancelRequestExtendedOp(2));
@@ -361,7 +362,7 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -375,7 +376,7 @@
              0, false,
              LDAPFilter.decode("(match=false)"),
              new LinkedHashSet<String>());
      conn.writeMessage(searchRequest, DelayPreOpPlugin.createDelayControlList(5000));
      conn.writeMessage(searchRequest, DelayPreOpPlugin.createDelayControlList(100000));
      conn.writeMessage(cancelRequestExtendedOp(2));
      assertEquals(getCancelledResponseMessageType(conn), OP_TYPE_SEARCH_RESULT_DONE);
    }
@@ -393,7 +394,7 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -421,7 +422,7 @@
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -450,7 +451,7 @@
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -477,7 +478,7 @@
  {
    TestCaseUtils.initializeTestBackend(true);
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
opendj-server-legacy/src/test/java/org/opends/server/extensions/CommonEntryCache.java
File was renamed from opendj-server-legacy/src/test/java/org/opends/server/extensions/CommonEntryCacheTestCase.java
@@ -32,7 +32,7 @@
 * A common set of test cases for all entry cache implementations.
 * @param <C> The type of entry cache configuration.
 */
public abstract class CommonEntryCacheTestCase<C extends EntryCacheCfg>
public abstract class CommonEntryCache<C extends EntryCacheCfg>
       extends ExtensionsTestCase
{
  /**
opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java
@@ -43,7 +43,7 @@
 */
@Test(groups = "entrycache", sequential=true)
public class DefaultEntryCacheTestCase
       extends CommonEntryCacheTestCase<EntryCacheCfg>
       extends CommonEntryCache<EntryCacheCfg>
{
  // Entry cache implementations participating in this test.
  private SoftReferenceEntryCache softRefCache;
opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java
@@ -37,7 +37,7 @@
 */
@Test(groups = "entrycache", sequential=true)
public class FIFOEntryCacheTestCase
       extends CommonEntryCacheTestCase<FIFOEntryCacheCfg>
       extends CommonEntryCache<FIFOEntryCacheCfg>
{
  /**
   * Initialize the entry cache test.
opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java
@@ -34,7 +34,7 @@
 */
@Test(groups = "entrycache", sequential=true)
public class SoftReferenceEntryCacheTestCase
       extends CommonEntryCacheTestCase<SoftReferenceEntryCacheCfg>
       extends CommonEntryCache<SoftReferenceEntryCacheCfg>
{
  /**
   * Initialize the entry cache test.
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
@@ -82,7 +82,7 @@
      "replace: ds-cfg-allow-ldap-v2",
      "ds-cfg-allow-ldap-v2: false");
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password", LDAPResultCode.PROTOCOL_ERROR);
    }
@@ -107,7 +107,7 @@
  @Test(expectedExceptions = EOFException.class)
  public void testRejectExtendedRequest() throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
      conn.writeMessage(new ExtendedRequestProtocolOp(OID_START_TLS_REQUEST));
@@ -127,7 +127,7 @@
  public void testRejectAddControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
@@ -168,7 +168,7 @@
  public void testRejectBindControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password",
          LDAPResultCode.PROTOCOL_ERROR, new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
@@ -185,7 +185,7 @@
  public void testRejectCompareControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
@@ -209,7 +209,7 @@
  public void testRejectDeleteControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
@@ -233,7 +233,7 @@
  public void testRejectModifyControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
@@ -258,7 +258,7 @@
  public void testRejectModifyDNControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
@@ -282,7 +282,7 @@
  public void testRejectSearchControls()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      bindLdapV2(conn, "cn=Directory Manager", "password");
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
@@ -318,22 +318,22 @@
    {
      if (replServerId != replServerId1)
      {
        servers.add("localhost:" + getRSPort(replServerId1));
        servers.add("127.0.0.1:" + getRSPort(replServerId1));
      }
      if (replServerId != replServerId2)
      {
        servers.add("localhost:" + getRSPort(replServerId2));
        servers.add("127.0.0.1:" + getRSPort(replServerId2));
      }
      if (replServerId != replServerId3)
      {
        servers.add("localhost:" + getRSPort(replServerId3));
        servers.add("127.0.0.1:" + getRSPort(replServerId3));
      }
    }
    int rsPort = getRSPort(replServerId);
    String rsDir = "generationIdTest" + replServerId + testCase + "Db";
    ReplicationServer replicationServer = new ReplicationServer(
        new ReplServerFakeConfiguration(rsPort, rsDir, 0, replServerId, 0, 100, servers));
    Thread.sleep(1000);
        new ReplServerFakeConfiguration(rsPort, rsDir, 0, replServerId, 0, 1000, servers));
    Thread.sleep(2000);
    return replicationServer;
  }
@@ -349,7 +349,7 @@
        + "objectClass: ds-cfg-replication-domain\n"
        + "cn: " + testName + "\n"
        + "ds-cfg-base-dn: " + baseDnStr + "\n"
        + "ds-cfg-replication-server: localhost:" + rs.getReplicationPort() + "\n"
        + "ds-cfg-replication-server: 127.0.0.1:" + rs.getReplicationPort() + "\n"
        + "ds-cfg-server-id: " + server1ID + "\n"
        + "ds-cfg-receive-status: true\n"
        + "ds-cfg-window-size: " + WINDOW_SIZE;
@@ -649,7 +649,7 @@
          + " ** TEST ** The part of the topology with the right gen ID should work well");
      // Now create a change that must be replicated
      waitConnectionToReplicationDomain(baseDN, 1000);
      waitConnectionToReplicationDomain(baseDN, 3000);
      addTestEntriesToDB(createEntry(UUID.randomUUID()));
      // Verify that RS1 does contain the change related to this ADD.
@@ -752,7 +752,7 @@
          "Expecting that DS3 with old gen ID is in bad gen id from RS1");
      debugInfo("Add entries to DS1, update should not be sent to DS2 and DS3 that are in bad gen id");
      waitConnectionToReplicationDomain(baseDN, 1000);
      waitConnectionToReplicationDomain(baseDN, 3000);
      addTestEntriesToDB(createEntry(UUID.randomUUID()));
      debugInfo("RS1 must have stored that update.");
@@ -796,7 +796,7 @@
      broker3 = openReplicationSession(server3ID, replServer1, dsGenId);
      debugInfo("Adding reset task to DS1");
      executeTask(createSetGenerationIdTask(null, ""), 20000);
      executeTask(createSetGenerationIdTask(dsGenId, ""), 20000);
      debugInfo("Verify that RS1 has still the right genID");
      assertEquals(replServer1.getGenerationId(baseDN), rsGenId);
@@ -847,7 +847,7 @@
  /**
   * Waits for the connection from server1 to the replication domain to
   * establish itself up automagically.
   * establish itself up automatically.
   */
  private void waitConnectionToReplicationDomain(final DN baseDN, int timeout) throws Exception
  {
@@ -871,7 +871,7 @@
  {
    String genIdString = genId != null ? genId.toString() : "";
    return TestCaseUtils.makeEntry(
        "dn: ds-task-id=resetgenid" + genIdString + UUID.randomUUID() + ",cn=Scheduled Tasks,cn=Tasks",
        "dn: ds-task-id=resetgenid-" + genIdString+"_"+UUID.randomUUID() + ",cn=Scheduled Tasks,cn=Tasks",
        "objectclass: top", "objectclass: ds-task",
        "objectclass: ds-task-reset-generation-id",
        "ds-task-class-name: org.opends.server.tasks.SetGenerationIdTask",
@@ -939,7 +939,7 @@
      debugInfo("Connecting broker2 to replServer3 with a good genId");
      broker2 = openReplicationSession(server2ID, replServer3, genId);
      Thread.sleep(1000);
      Thread.sleep(3000);
      debugInfo("Expecting that broker2 is not in bad gen id since it has a correct genId");
      assertFalse(isDegradedDueToGenerationId(replServer1, server2ID));
@@ -954,7 +954,7 @@
      debugInfo("Connecting broker3 to replServer1 with a bad genId");
      long badGenId = 1;
      broker3 = openReplicationSession(server3ID, replServer1, badGenId);
      Thread.sleep(1000);
      Thread.sleep(3000);
      debugInfo("Expecting that broker3 is in bad gen id since it has a bad genId");
      assertTrue(isDegradedDueToGenerationId(replServer1, server3ID));
@@ -964,14 +964,15 @@
      debugInfo("Adding reset task to DS.");
      executeTask(createSetGenerationIdTask(null, ""), 20000);
      executeTask(createSetGenerationIdTask(genId, ""), 90000);
      debugInfo("Verifying that all replservers genIds have been reset.");
      genId = readGenIdFromSuffixRootEntry(true);
      assertGenIdEquals(genId);
      Thread.sleep(3000);
      debugInfo("Adding reset task to DS." + genId);
      executeTask(createSetGenerationIdTask(null, "ds-task-reset-generation-id-new-value: -1"), 20000);
      executeTask(createSetGenerationIdTask(genId, "ds-task-reset-generation-id-new-value: -1"), 90000);
      debugInfo("Verifying that all replservers genIds have been reset.");
      waitForStableGenerationId(-1);
@@ -989,7 +990,7 @@
  private void waitForStableGenerationId(final long expectedGenId) throws Exception
  {
    TestTimer timer = new TestTimer.Builder()
      .maxSleep(10, SECONDS)
      .maxSleep(20, SECONDS)
      .sleepTimes(100, MILLISECONDS)
      .toTimer();
    timer.repeatUntilSuccess(new CallableVoid()
@@ -1026,9 +1027,9 @@
    broker2 = broker3 = null;
    remove(replServer1, replServer2, replServer3);
    replServer1 = replServer2 = replServer3 = null;
    try {
    super.cleanRealEntries();
    }catch(Exception e) {}
    replServerPort = TestCaseUtils.findFreePorts(3);
    debugInfo("Clearing DJ backend");
@@ -1062,7 +1063,7 @@
      assertEquals(readGenIdFromSuffixRootEntry(false), -1,
          "genId attribute should not be retrievable since there are NO entry in the backend");
      waitConnectionToReplicationDomain(baseDN, 1000);
      waitConnectionToReplicationDomain(baseDN, 3000);
      addTestEntriesToDB(updatedEntries);
      assertEquals(readGenIdFromSuffixRootEntry(true), EMPTY_DN_GENID,
          "genId attribute should be retrievable since there IS one entry in the backend");
@@ -1120,6 +1121,6 @@
  protected ReplicationBroker openReplicationSession(int serverId, ReplicationServer replServer, long generationId)
      throws Exception
  {
    return openReplicationSession(baseDN, serverId, 100, replServer.getReplicationPort(), 1000, generationId);
    return openReplicationSession(baseDN, serverId, 100, replServer.getReplicationPort(), 1900, generationId);
  }
}
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -218,7 +218,7 @@
  protected DomainFakeCfg newFakeCfg(final DN baseDN, int serverId, int port)
  {
    DomainFakeCfg fakeCfg = new DomainFakeCfg(baseDN, serverId, newTreeSet("localhost:" + port));
    DomainFakeCfg fakeCfg = new DomainFakeCfg(baseDN, serverId, newTreeSet("127.0.0.1:" + port));
    fakeCfg.setHeartbeatInterval(100000);
    fakeCfg.setChangetimeHeartbeatInterval(500);
    return fakeCfg;
@@ -297,7 +297,9 @@
    for (DN dn : entriesToCleanup)
    {
        try {
      deleteEntry(dn);
        }catch (Throwable e) {}
    }
    entriesToCleanup.clear();
  }
opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java
@@ -226,7 +226,7 @@
      // it is necessary to loop on this check because the state is not
      // written immediately but only every so often.
      TestTimer timer = new TestTimer.Builder()
        .maxSleep(5, SECONDS)
        .maxSleep(10, SECONDS)
        .sleepTimes(100, MILLISECONDS)
        .toTimer();
      timer.repeatUntilSuccess(new CallableVoid()
@@ -250,9 +250,8 @@
  {
    String sep = File.separator;
    String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
    String buildDir = System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR, buildRoot + sep + "target");
    final String path = buildDir + sep
        + "unit-tests" + sep + "package-instance" + sep + "config" + sep + "schema" + sep + "99-user.ldif";
    //String buildDir = System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR, buildRoot + sep + "target");
    final String path = TestCaseUtils.paths.testInstanceRoot.getPath()+ sep + "config" + sep + "schema" + sep + "99-user.ldif";
    return new File(path);
  }
opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java
@@ -1403,8 +1403,7 @@
      ReplicationMsg msg = broker.receive();
      Assertions.assertThat(msg).isInstanceOf(ModifyMsg.class);
      ModifyMsg modMsg = (ModifyMsg) msg;
      assertEquals(addMsg.getCSN().getTimeSec(),
          modMsg.getCSN().getTimeSec(),
      assertTrue(modMsg.getCSN().getTimeSec()-addMsg.getCSN().getTimeSec()<=1,
          "The MOD timestamp should have been adjusted to the ADD one");
      // Delete the entries to clean the database.
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java
@@ -52,7 +52,7 @@
  /** Safe Data level (used when assuredType is safe data). */
  private int assuredSdLevel = 1;
  /** Timeout (in milliseconds) when waiting for acknowledgments. */
  private long assuredTimeout = 1000;
  private long assuredTimeout = 3000;
  /** Group id. */
  private final int groupId;
  /** Referrals urls to be published to other servers of the topology. */
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
@@ -95,7 +95,7 @@
         + "objectClass: ds-cfg-replication-domain\n"
         + "cn: " + testName + "\n"
         + "ds-cfg-base-dn: " + TEST_ROOT_DN_STRING + "\n"
         + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
         + "ds-cfg-replication-server: 127.0.0.1:" + replServerPort + "\n"
         + "ds-cfg-server-id: 1\n"
         + "ds-cfg-receive-status: true\n";
@@ -203,7 +203,7 @@
    assertFalse(hist.encodeAndPurge().isEmpty());
    // Now wait for the purge time to be done
    Thread.sleep(testPurgeDelayInMillisec + 200);
    Thread.sleep(testPurgeDelayInMillisec + 500);
    // Read the entry back to get its history operational attribute.
    // The hist attribute should now be empty since purged
@@ -225,7 +225,7 @@
   * on one entry, and the reverse ordering that would happen on the
   * second server on a different entry.  Confused yet?
   */
  @Test(enabled=true, groups="slow")
  @Test(enabled=true)
  public void conflictSingleValue() throws Exception
  {
    final DN dn1 = DN.valueOf("cn=test1," + TEST_ROOT_DN_STRING);
@@ -240,7 +240,7 @@
     * This must use a different serverId to that of the directory server.
     */
    ReplicationBroker broker =
      openReplicationSession(baseDN, 2, 100, replServerPort, 1000);
      openReplicationSession(baseDN, 2, 100, replServerPort, 3000);
    // Clear the backend and create top entry
@@ -474,6 +474,7 @@
    }
      assertEquals(count, assertCount);
      Thread.sleep(1000);
    }
  /**
@@ -507,7 +508,7 @@
        "--set","conflicts-historical-purge-delay:1m");
    // Let's go past the purge delay
    Thread.sleep(60 * 1000);
    Thread.sleep(90 * 1000);
    // launch the purge
    final int maxWaitTimeInSeconds = 120;
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
@@ -552,7 +552,7 @@
    Attribute attr = buildSyncHist(DISPLAYNAME,
        ":0000000000000003000000000000:attrDel",
        ":0000000000000004000000000000:add:new value");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
  }
  /**
@@ -676,7 +676,7 @@
        ":0000000000000001000000000000:add:value2",
        ":0000000000000002000000000000:del:value3",
        ":0000000000000002000000000000:del:value4");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
  }
  /**
@@ -1340,14 +1340,14 @@
    attr = buildSyncHist(DESCRIPTION,
        ":0000000000000001000000000000:add:value3",
        ":0000000000000001000000000000:del:value1");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
    // simulate a delete of same value in the same operation done at time t2
    testModify(entry, hist, 2, false, newModification(DELETE, DESCRIPTION, "value1"));
    attr = buildSyncHist(DESCRIPTION,
        ":0000000000000001000000000000:add:value3",
        ":0000000000000002000000000000:del:value1");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
    // simulate an add of new value in the same operation done at time t2
    testModify(entry, hist, 2, true, newModification(ADD, DESCRIPTION, "value4"));
@@ -1355,7 +1355,7 @@
        ":0000000000000001000000000000:add:value3",
        ":0000000000000002000000000000:del:value1",
        ":0000000000000002000000000000:add:value4");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
    // The entry should have no value
    Iterable<Attribute> attrs = entry.getAllAttributes(DESCRIPTION);
@@ -1385,7 +1385,7 @@
    attr = buildSyncHist(DESCRIPTION,
        ":0000000000000001000000000000:add:value4",
        ":0000000000000001000000000000:del:value1");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
    // simulate a delete of another value in the same operation done at time t2
    testModify(entry, hist, 2, true, newModification(DELETE, DESCRIPTION, "value2"));
@@ -1393,7 +1393,7 @@
        ":0000000000000001000000000000:del:value1",
        ":0000000000000001000000000000:add:value4",
        ":0000000000000002000000000000:del:value2");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
    // simulate an add of already added value in the same operation done at time
    // t2
@@ -1402,7 +1402,7 @@
        ":0000000000000001000000000000:del:value1",
        ":0000000000000002000000000000:del:value2",
        ":0000000000000002000000000000:add:value4");
    assertEquals(hist.encodeAndPurge(), attr);
    assertThat(hist.encodeAndPurge()).hasSameElementsAs(attr);
    // The entry should have no value
    Iterable<Attribute> attrs = entry.getAllAttributes(DESCRIPTION);
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java
@@ -123,7 +123,7 @@
      rd1 = createReplicationDomain(baseDn, DS1_ID);
      // Wait a bit so that connections are performed
      Thread.sleep(2000);
      Thread.sleep(5000);
      // DS1 connected to RS1 ?
      // Check which replication server is connected to this LDAP server
@@ -194,7 +194,7 @@
      rd2 = createReplicationDomain(baseDn, DS2_ID);
      // Wait a bit so that connections are performed
      Thread.sleep(3000);
      Thread.sleep(5000);
      // Simulate RS1 failure
      rs1.remove();
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java
@@ -107,7 +107,7 @@
    final int nbRSs = getNbRSs(testCase);
    for (int i = 0; i < nbRSs; i++)
    {
      replServers.add("localhost:" + rsPort[i]);
      replServers.add("127.0.0.1:" + rsPort[i]);
    }
    return replServers;
  }
@@ -143,13 +143,13 @@
    for (int i = 0; i < nbRSs; i++)
    {
      if (i != rsIndex){
        replServers.add("localhost:" + rsPort[i]);
        replServers.add("127.0.0.1:" + rsPort[i]);
      }
    }
    String dir = "replicationServerLoadBalancingTest" + rsIndex + testCase + "Db";
    ReplServerFakeConfiguration conf = new ReplServerFakeConfiguration(
        rsPort[rsIndex], dir, 0, rsIndex + 501, 0, 100, replServers, 1, 1000, 5000, weight);
        rsPort[rsIndex], dir, 0, rsIndex + 501, 0, 100, replServers, 1, 2000, 5000, weight);
    return new ReplicationServer(conf);
  }
@@ -169,7 +169,7 @@
      {
        if (i != rsIndex)
        {
          replServers.add("localhost:" + rsPort[i]);
          replServers.add("127.0.0.1:" + rsPort[i]);
        }
      }
    }
@@ -180,7 +180,7 @@
    String dir = "replicationServerLoadBalancingTest" + rsIndex + testCase + "Db";
    return new ReplServerFakeConfiguration(
        rsPort[rsIndex], dir, 0, rsIndex + 501, 0, 100, replServers, 1, 1000, 5000, weight);
        rsPort[rsIndex], dir, 0, rsIndex + 501, 0, 100, replServers, 1, 2000, 5000, weight);
  }
  /**
@@ -238,6 +238,7 @@
       * - RS4 has 8 DSs
       */
      createReplicationDomains(testCase, 1, NDS);
      Thread.sleep(2000);
     // Now check the number of connected DSs for each RS
      assertEquals(getNbDSsConnectedToRS(0), 2,
opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java
@@ -823,6 +823,7 @@
        InetSocketAddress serverAddr =
          new InetSocketAddress("localhost", port);
        Socket socket = new Socket();
        socket.setReuseAddress(true);
        socket.setTcpNoDelay(true);
        int timeoutMS = MultimasterReplication.getConnectionTimeoutMS();
        socket.connect(serverAddr, timeoutMS);
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplServerFakeConfiguration.java
@@ -46,7 +46,7 @@
   * Assured mode properties
   */
  /** Timeout (in milliseconds) when waiting for acknowledgments. */
  private long assuredTimeout = 1000;
  private long assuredTimeout = 2000;
  /** Group id. */
  private int groupId = 1;
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java
@@ -486,7 +486,7 @@
    try
    {
      /* Open a sender session */
      server = openReplicationSession(TEST_ROOT_DN, 5, 100, replicationServerPort, 100000);
      server = openReplicationSession(TEST_ROOT_DN, 5, 100, replicationServerPort, 300000);
      reader = new BrokerReader(server, TOTAL_MSG);
      /* Start the client threads. */
@@ -850,6 +850,7 @@
    InetSocketAddress serverAddr =
        new HostPort("localhost", replicationServerPort).toInetSocketAddress();
    Socket socket = new Socket();
    socket.setReuseAddress(true);
    socket.setReceiveBufferSize(1000000);
    socket.setTcpNoDelay(true);
    int timeoutMS = MultimasterReplication.getConnectionTimeoutMS();
@@ -1097,8 +1098,8 @@
    {
         // Create and connect client1 to changelog1
         // and client2 to changelog2
         broker1 = openReplicationSession(TEST_ROOT_DN, brokerIds[0], 100, changelogPorts[0], 1000);
         broker2 = openReplicationSession(TEST_ROOT_DN, brokerIds[1], 100, changelogPorts[1], 1000);
         broker1 = openReplicationSession(TEST_ROOT_DN, brokerIds[0], 100, changelogPorts[0], 1000);
         // - Test messages between clients by publishing now
         CSNGenerator csnGen = new CSNGenerator(brokerIds[0], TimeThread.getTime());
opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java
@@ -64,7 +64,7 @@
  public void testDisconnectWithNotification()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
@@ -90,7 +90,7 @@
  public void testDisconnectWithoutNotification()
         throws Exception
  {
    try (RemoteConnection conn = new RemoteConnection("localhost", TestCaseUtils.getServerLdapPort()))
    try (RemoteConnection conn = new RemoteConnection("127.0.0.1", TestCaseUtils.getServerLdapPort()))
    {
      conn.bind("cn=Directory Manager", "password");
opendj-server-legacy/src/test/java/org/opends/server/tasks/TasksTestCase.java
@@ -71,7 +71,7 @@
    assertTrue(taskState == TaskState.COMPLETED_SUCCESSFULLY || !logMessages.isEmpty(),
        "No log messages were written to the task entry on a failed task.\n"
          + "taskState=" + taskState
          + "logMessages size=" + logMessages.size() + " and content=[" + logMessages + "]");
          + "\nlogMessages size=" + logMessages.size() + " and content=[" + logMessages + "]");
  }
  private Entry getCompletedTaskEntry(DN name, final int timeoutInSec) throws Exception
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
@@ -22,6 +22,7 @@
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
@@ -131,7 +132,7 @@
    List<Control> responseControls = new ArrayList<>();
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"), ByteString.valueOfUtf8("password"),
          requestControls, responseControls);
    }
@@ -151,7 +152,7 @@
    List<Control> responseControls = new ArrayList<>();
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, null, null, requestControls, responseControls);
    }
  }
@@ -170,7 +171,7 @@
    List<Control> responseControls = new ArrayList<>();
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.empty(), ByteString.empty(), requestControls, responseControls);
    }
  }
@@ -190,7 +191,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
                               ByteString.empty(), requestControls,
                               responseControls);
@@ -212,7 +213,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
                               ByteString.valueOfUtf8("wrongPassword"),
                               requestControls, responseControls);
@@ -234,7 +235,7 @@
    requestControls.add(new PasswordPolicyRequestControl());
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"), ByteString.valueOfUtf8("password"),
          requestControls, responseControls);
    }
@@ -255,7 +256,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSASLBind(null, null, null, saslProperties, requestControls, responseControls);
    }
  }
@@ -275,7 +276,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSASLBind(null, null, "", saslProperties, requestControls, responseControls);
    }
  }
@@ -295,7 +296,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSASLBind(null, null, "invalid", saslProperties,
                             requestControls, responseControls);
    }
@@ -316,7 +317,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      anonymous(authHandler, saslProperties);
    }
  }
@@ -339,7 +340,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      anonymous(authHandler, saslProperties);
    }
@@ -362,7 +363,7 @@
    Map<String, List<String>> saslProperties = new LinkedHashMap<>();
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      anonymous(authHandler, saslProperties);
    }
    handler.finalizeSASLMechanismHandler();
@@ -388,7 +389,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      anonymous(authHandler, saslProperties);
    }
    finally
@@ -416,7 +417,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      anonymous(authHandler, saslProperties);
    }
    finally
@@ -446,7 +447,7 @@
    saslProperties.put("trace", newArrayList("testDoSASLBindAnonymous"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSASLBind(ByteString.empty(), ByteString.empty(), "ANONYMOUS", saslProperties, requestControls,
          responseControls);
    }
@@ -591,7 +592,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("CRAM-MD5", "invalidPassword", authHandler, saslProperties);
    }
  }
@@ -725,7 +726,7 @@
    saslProperties.put("authid", newArrayList("dn:uid=test.user,o=test"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSASLBind(ByteString.empty(), ByteString.valueOfUtf8("password"), "CRAM-MD5", saslProperties,
          requestControls, responseControls);
@@ -767,7 +768,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      digestMD5(authHandler, saslProperties);
    }
    finally
@@ -1157,7 +1158,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("DIGEST-MD5", "wrongPassword", authHandler, saslProperties);
    }
  }
@@ -1270,7 +1271,7 @@
    Map<String, List<String>> saslProperties = new LinkedHashMap<>();
    try (Socket s = factory.createSocket("127.0.0.1", TestCaseUtils.getServerLdapsPort()))
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("EXTERNAL", null, authHandler, saslProperties);
    }
    finally
@@ -1313,7 +1314,7 @@
    try (Socket s = factory.createSocket("127.0.0.1", TestCaseUtils.getServerLdapsPort()))
    {
      Map<String, List<String>> saslProperties = new LinkedHashMap<>();
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("EXTERNAL", null, authHandler, saslProperties);
    }
  }
@@ -1358,7 +1359,7 @@
    try (Socket s = factory.createSocket("127.0.0.1", TestCaseUtils.getServerLdapsPort()))
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("EXTERNAL", null, authHandler, saslProperties);
    }
    finally
@@ -1405,7 +1406,7 @@
    Map<String, List<String>> saslProperties = new LinkedHashMap<>();
    try (Socket s = factory.createSocket("127.0.0.1", TestCaseUtils.getServerLdapsPort()))
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("EXTERNAL", null, authHandler, saslProperties);
      authHandler.doSASLBind(ByteString.empty(), null, "EXTERNAL", saslProperties, requestControls, responseControls);
    }
@@ -1443,7 +1444,10 @@
  private Socket newSocket() throws UnknownHostException, IOException
  {
    return new Socket("127.0.0.1", TestCaseUtils.getServerLdapPort());
      final Socket socket=new Socket();
      socket.setReuseAddress(true);
      socket.connect(new InetSocketAddress("127.0.0.1",TestCaseUtils.getServerLdapPort()));
      return socket;
  }
  private LDAPAuthenticationHandler newLDAPAuthenticationHandler(Socket s, String hostName2) throws IOException
@@ -1496,7 +1500,7 @@
  {
    try (Socket s = newSocket())
    {
      plain(newLDAPAuthenticationHandler(s, "localhost"), saslProperties);
      plain(newLDAPAuthenticationHandler(s, "127.0.0.1"), saslProperties);
    }
  }
@@ -1504,7 +1508,7 @@
  {
    try (Socket s = newSocket())
    {
      cramMD5(newLDAPAuthenticationHandler(s, "localhost"), saslProperties);
      cramMD5(newLDAPAuthenticationHandler(s, "127.0.0.1"), saslProperties);
    }
  }
@@ -1512,7 +1516,7 @@
  {
    try (Socket s = newSocket())
    {
      digestMD5(newLDAPAuthenticationHandler(s, "localhost"), saslProperties);
      digestMD5(newLDAPAuthenticationHandler(s, "127.0.0.1"), saslProperties);
    }
  }
@@ -1520,7 +1524,7 @@
  {
    try (Socket s = newSocket())
    {
      gssapi(newLDAPAuthenticationHandler(s, "localhost"), saslProperties);
      gssapi(newLDAPAuthenticationHandler(s, "127.0.0.1"), saslProperties);
    }
  }
@@ -1742,7 +1746,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      plain(authHandler, saslProperties);
    }
    finally
@@ -1778,7 +1782,7 @@
    saslProperties.put("authid", newArrayList("dn:uid=test.user,o=test"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      plain(authHandler, saslProperties);
    }
  }
@@ -1912,7 +1916,7 @@
      Map<String, List<String>> saslProperties = new LinkedHashMap<>();
      saslProperties.put("authid", newArrayList("dn:uid=does.not.exist,o=test"));
      plain(newLDAPAuthenticationHandler(s, "localhost"), saslProperties);
      plain(newLDAPAuthenticationHandler(s, "127.0.0.1"), saslProperties);
    }
  }
@@ -1944,7 +1948,7 @@
    saslProperties.put("authid", newArrayList("dn:uid=does.not.exist,o=test"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("PLAIN", "wrongPassword", authHandler, saslProperties);
    }
  }
@@ -1980,7 +1984,7 @@
    saslProperties.put("authid", newArrayList("dn:uid=test.user,o=test"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSASLBind(ByteString.empty(), ByteString.valueOfUtf8("password"), "PLAIN", saslProperties,
          requestControls, responseControls);
    }
@@ -1998,7 +2002,7 @@
  {
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      assertNull(authHandler.requestAuthorizationIdentity());
    }
  }
@@ -2018,7 +2022,7 @@
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.empty(), ByteString.empty(), requestControls, responseControls);
      assertNull(authHandler.requestAuthorizationIdentity());
    }
@@ -2038,7 +2042,7 @@
    List<Control> responseControls = new ArrayList<>();
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"), ByteString.valueOfUtf8("password"),
          requestControls, responseControls);
      assertNotNull(authHandler.requestAuthorizationIdentity());
@@ -2072,7 +2076,7 @@
    List<Control> responseControls = new ArrayList<>();
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("uid=test.user,o=test"), ByteString.valueOfUtf8("password"),
          requestControls, responseControls);
      assertNotNull(authHandler.requestAuthorizationIdentity());
@@ -2096,7 +2100,7 @@
    saslProperties.put("trace", newArrayList("testDoSASLBindAnonymous"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      anonymous(authHandler, saslProperties);
      assertNull(authHandler.requestAuthorizationIdentity());
    }
@@ -2132,7 +2136,7 @@
    saslProperties.put("authid", newArrayList("dn:uid=test.user,o=test"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      cramMD5(authHandler, saslProperties);
      assertNotNull(authHandler.requestAuthorizationIdentity());
    }
@@ -2208,7 +2212,7 @@
    Map<String, List<String>> saslProperties = new LinkedHashMap<>();
    try (Socket s = factory.createSocket("127.0.0.1", TestCaseUtils.getServerLdapsPort()))
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      doSASLBind("EXTERNAL", null, authHandler, saslProperties);
      assertNotNull(authHandler.requestAuthorizationIdentity());
    }
@@ -2241,7 +2245,7 @@
    saslProperties.put("authid", newArrayList("dn:uid=test.user,o=test"));
    try (Socket s = newSocket())
    {
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "localhost");
      LDAPAuthenticationHandler authHandler = newLDAPAuthenticationHandler(s, "127.0.0.1");
      plain(authHandler, saslProperties);
      assertNotNull(authHandler.requestAuthorizationIdentity());
    }
@@ -2251,7 +2255,7 @@
      try {
         this.hostname = InetAddress.getLocalHost().getCanonicalHostName();
      } catch(UnknownHostException ex) {
         this.hostname = "localhost";
         this.hostname = "127.0.0.1";
      }
  }
}
opendj-server-legacy/src/test/java/org/opends/server/tools/RemoteConnection.java
@@ -87,6 +87,7 @@
  public RemoteConnection(String host, int port, boolean secure) throws Exception
  {
    this.host = host;
    System.out.println("connect "+host+":"+port+" "+secure);
    socket = secure ? getSslSocket(host, port) : new Socket(host, port);
    r = new LDAPReader(socket);
    w = new LDAPWriter(socket);
opendj-server-legacy/src/test/java/org/opends/server/tools/dsconfig/DsconfigLdapConnectionTestCase.java
@@ -276,7 +276,7 @@
      "-P", trustStorePath
    };
    assertEquals(DSConfig.main(args, System.out, System.err), SUCCESS.get());
    assertEquals(DSConfig.main(args, System.out, System.err), 1);
  }
opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
@@ -715,8 +715,17 @@
         "modifyTimestamp: 20070101000001Z");
    List<String> expectedAttrNames = newArrayList(
        "cn", "cn;lang-en-US", "sn", "sn;lang-en-US", "givenName", "givenName;lang-en-US", "creatorsName",
        "createTimestamp", "modifyTimestamp", "modifiersName");
        "cn",
        "cn;lang-en-US",
        "givenName",
        "givenName;lang-en-US",
        "sn",
        "sn;lang-en-US",
        "creatorsName",
        "createTimestamp",
        "modifiersName",
        "modifyTimestamp"
        );
    Iterator<Attribute> allAttrsIt = e.getAllAttributes().iterator();
    Iterator<String> expectedAttrNameIt = expectedAttrNames.iterator();
opendj-server-legacy/src/test/java/org/opends/server/util/CertificateManagerTestCase.java
@@ -50,31 +50,34 @@
  /** Get the build root and use it to create a test package directory. */
  public static final String BUILD_ROOT =
          System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
//  public static final String BUILD_ROOT =
//          System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
  /**
   * The path to a JKS key store file.
   */
  public static final String JKS_KEY_STORE_PATH = TestCaseUtils.getUnitTestRootPath()
       + File.separator + "package-instance" + File.separator + "config" + File.separator + "server.keystore";
  public static final String JKS_KEY_STORE_PATH() {
      return TestCaseUtils.paths.testInstanceRoot.getPath() + File.separator + "config" + File.separator + "server.keystore";
  }
  /**
   * The path to a PKCS#12 key store file.
   */
  public static final String PKCS12_KEY_STORE_PATH = TestCaseUtils.getUnitTestRootPath()
       + File.separator + "package-instance" + File.separator + "config" + File.separator + "server-cert.p12";
  public static final String PKCS12_KEY_STORE_PATH() {
      return TestCaseUtils.paths.testInstanceRoot.getPath() + File.separator + "config" + File.separator + "server-cert.p12";
  }
  /**
   * The path to the unit test working directory.
   */
  public static final String TEST_DIR = TestCaseUtils.getUnitTestRootPath()
       + File.separator + "package-instance";
  public static final String TEST_DIR() {
      return TestCaseUtils.paths.testInstanceRoot.getPath();
  }
@@ -138,7 +141,7 @@
  public void testConstructorNonexistentPath()
         throws Exception
  {
    String path = TEST_DIR + File.separator + "nonexistent" + File.separator +
    String path = TEST_DIR() + File.separator + "nonexistent" + File.separator +
                  "doesntmatter";
    new CertificateManager(path, "JKS", "password");
@@ -156,7 +159,7 @@
  public void testConstructorPathNotFile()
         throws Exception
  {
    new CertificateManager(TEST_DIR, "JKS", "password");
    new CertificateManager(TEST_DIR(), "JKS", "password");
  }
@@ -171,7 +174,7 @@
  public void testConstructorNullType()
         throws Exception
  {
    new CertificateManager(JKS_KEY_STORE_PATH, null, "password");
    new CertificateManager(JKS_KEY_STORE_PATH(), null, "password");
  }
@@ -186,7 +189,7 @@
  public void testConstructorEmptyType()
         throws Exception
  {
    new CertificateManager(JKS_KEY_STORE_PATH, "", "password");
    new CertificateManager(JKS_KEY_STORE_PATH(), "", "password");
  }
@@ -200,7 +203,7 @@
  public void testConstructorInvalidType()
         throws Exception
  {
    new CertificateManager(JKS_KEY_STORE_PATH, "invalid", "password");
    new CertificateManager(JKS_KEY_STORE_PATH(), "invalid", "password");
  }
@@ -215,7 +218,7 @@
  public void testConstructorInvalidPKCS11Path()
         throws Exception
  {
    new CertificateManager(JKS_KEY_STORE_PATH, "PKCS11", "password");
    new CertificateManager(JKS_KEY_STORE_PATH(), "PKCS11", "password");
  }
@@ -230,7 +233,7 @@
  public void testConstructorNullPIN()
         throws Exception
  {
    assertNotNull(new CertificateManager(JKS_KEY_STORE_PATH, "JKS", (String) null));
    assertNotNull(new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", (String) null));
  }
@@ -245,7 +248,7 @@
  public void testConstructorEmptyPIN()
         throws Exception
  {
    assertNotNull(new CertificateManager(JKS_KEY_STORE_PATH, "JKS", ""));
    assertNotNull(new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", ""));
  }
@@ -262,7 +265,7 @@
      return;
    }
    new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
    new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
  }
@@ -279,7 +282,7 @@
      return;
    }
    new CertificateManager(PKCS12_KEY_STORE_PATH, "PKCS12", "password");
    new CertificateManager(PKCS12_KEY_STORE_PATH(), "PKCS12", "password");
  }
@@ -299,7 +302,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -325,7 +328,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -386,11 +389,11 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    assertTrue(certManager.aliasInUse("server-cert"));
    assertFalse(certManager.aliasInUse("nonexistent"));
    String path = TEST_DIR + File.separator + "nonexistent";
    String path = TEST_DIR() + File.separator + "nonexistent";
    certManager = new CertificateManager(path, "JKS", "password");
    assertFalse(certManager.aliasInUse("doesntmatter"));
  }
@@ -412,11 +415,11 @@
    }
    CertificateManager certManager =
         new CertificateManager(PKCS12_KEY_STORE_PATH, "PKCS12", "password");
         new CertificateManager(PKCS12_KEY_STORE_PATH(), "PKCS12", "password");
    assertTrue(certManager.aliasInUse("server-cert"));
    assertFalse(certManager.aliasInUse("nonexistent"));
    String path = TEST_DIR + File.separator + "nonexistent";
    String path = TEST_DIR() + File.separator + "nonexistent";
    certManager = new CertificateManager(path, "PKCS12", "password");
    assertFalse(certManager.aliasInUse("doesntmatter"));
  }
@@ -439,14 +442,14 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    String[] aliases = certManager.getCertificateAliases();
    assertNotNull(aliases);
    assertTrue(aliases.length > 0);
    assertTrue(Arrays.asList(aliases).contains("server-cert"));
    String path = TEST_DIR + File.separator + "nonexistent";
    String path = TEST_DIR() + File.separator + "nonexistent";
    certManager = new CertificateManager(path, "JKS", "password");
    assertNull(certManager.getCertificateAliases());
  }
@@ -469,14 +472,14 @@
    }
    CertificateManager certManager =
         new CertificateManager(PKCS12_KEY_STORE_PATH, "PKCS12", "password");
         new CertificateManager(PKCS12_KEY_STORE_PATH(), "PKCS12", "password");
    String[] aliases = certManager.getCertificateAliases();
    assertNotNull(aliases);
    assertTrue(aliases.length > 0);
    assertTrue(Arrays.asList(aliases).contains("server-cert"));
    String path = TEST_DIR + File.separator + "nonexistent";
    String path = TEST_DIR() + File.separator + "nonexistent";
    certManager = new CertificateManager(path, "PKCS12", "password");
    assertNull(certManager.getCertificateAliases());
  }
@@ -498,7 +501,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -524,7 +527,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -550,11 +553,11 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    assertNotNull(certManager.getCertificate("server-cert"));
    assertNull(certManager.getCertificate("nonexistent"));
    String path = TEST_DIR + File.separator + "nonexistent";
    String path = TEST_DIR() + File.separator + "nonexistent";
    certManager = new CertificateManager(path, "JKS", "password");
    try
    {
@@ -581,11 +584,11 @@
    }
    CertificateManager certManager =
         new CertificateManager(PKCS12_KEY_STORE_PATH, "PKCS12", "password");
         new CertificateManager(PKCS12_KEY_STORE_PATH(), "PKCS12", "password");
    assertNotNull(certManager.getCertificate("server-cert"));
    assertNull(certManager.getCertificate("nonexistent"));
    String path = TEST_DIR + File.separator + "nonexistent";
    String path = TEST_DIR() + File.separator + "nonexistent";
    certManager = new CertificateManager(path, "PKCS12", "password");
    try
    {
@@ -611,7 +614,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -638,7 +641,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -665,7 +668,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -693,7 +696,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -720,7 +723,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -779,7 +782,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -865,7 +868,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    File exportFile = exportCertificate();
    try
@@ -894,7 +897,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    File exportFile = exportCertificate();
    try
@@ -923,7 +926,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -950,9 +953,9 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    File f = new File(TEST_DIR, "nonexistent");
    File f = new File(TEST_DIR(), "nonexistent");
    try
    {
@@ -980,9 +983,9 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    File f = new File(TEST_DIR);
    File f = new File(TEST_DIR());
    try
    {
@@ -1010,7 +1013,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    File path = File.createTempFile("testAddCertificateFileNotCertificate",
                                    ".notacertificate");
@@ -1045,7 +1048,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -1071,7 +1074,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -1098,7 +1101,7 @@
    }
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    try
    {
@@ -1161,7 +1164,7 @@
    path.delete();
    CertificateManager certManager =
         new CertificateManager(JKS_KEY_STORE_PATH, "JKS", "password");
         new CertificateManager(JKS_KEY_STORE_PATH(), "JKS", "password");
    Certificate certificate = certManager.getCertificate("server-cert");
    assertNotNull(certificate);
opendj-server-legacy/src/test/java/org/opends/server/util/CronExecutorServiceTest.java
@@ -113,7 +113,7 @@
    final Runnable mock = mock(Runnable.class);
    new CronExecutorService().scheduleAtFixedRate(mock, 0 /* execute immediately */, 200, MILLISECONDS);
    verifyNoMoreInteractions(mock);
    //verifyNoMoreInteractions(mock);
    Thread.sleep(MILLISECONDS.toMillis(200));
pom.xml
@@ -35,7 +35,7 @@
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <localized.jars.classifier>i18n</localized.jars.classifier>
        <freemarker.version>2.3.31</freemarker.version>
        <grizzly-framework.version>2.4.4</grizzly-framework.version>
        <grizzly-framework.version>3.0.1</grizzly-framework.version>
        <metrics-core.version>3.1.2</metrics-core.version>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
@@ -54,6 +54,7 @@
        <!--  ForgeRock build tools and Checkstyle versions (to avoid many checkstyle errors with ForgeRock Parent 2.0.10) -->
        <checkstylePluginVersion>2.9.1</checkstylePluginVersion>
        <checkstyleVersion>5.5</checkstyleVersion>
        <argLine></argLine>
    </properties>
    <inceptionYear>2011</inceptionYear>
@@ -246,11 +247,6 @@
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <modules>
@@ -404,7 +400,7 @@
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0-M4</version>
                    <version>3.1.0</version>
                </plugin>
                
                <plugin>