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

Jean-Noel Rouvignac
30.25.2014 1508f558ba658b7f0e713f3d5e61fa66b9dc2fa0
Support suffixes containing space in the changelog state DB.


ReplicationDbEnvTest.java:
Added one test case.

ReplicationDbEnv.java:
Fixed the code.
2 files modified
13 ■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java 8 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnvTest.java 5 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
@@ -249,12 +249,13 @@
        if (logger.isTraceEnabled())
        {
          debug("read (key, value)=(" + stringKey + ", " + stringData + ")");
          debug("read (key, data)=(" + stringKey + ", " + stringData + ")");
        }
        final String[] str = stringData.split(FIELD_SEPARATOR, 3);
        if (str[0].equals(GENERATION_ID_TAG))
        final String prefix = stringKey.split(FIELD_SEPARATOR)[0];
        if (prefix.equals(GENERATION_ID_TAG))
        {
          final String[] str = stringData.split(FIELD_SEPARATOR, 3);
          final long generationId = toLong(str[1]);
          final DN baseDN = DN.valueOf(str[2]);
@@ -267,6 +268,7 @@
        }
        else
        {
          final String[] str = stringData.split(FIELD_SEPARATOR, 2);
          final int serverId = toInt(str[0]);
          final DN baseDN = DN.valueOf(str[1]);
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnvTest.java
@@ -52,7 +52,7 @@
{
    /**
     * Bypass heavyweight setup.
     * Bypass heavyweight setup.
     */
    private final class TestableReplicationDbEnv extends ReplicationDbEnv
    {
@@ -93,8 +93,7 @@
        return new Object[][] {
            { DN.valueOf("dc=example,dc=com"), 524157415, asList(42, 346) },
            // test with a space in the baseDN (space is the field separator in the DB)
            // FIXME does not work yet (gosh!!)
            // { DN.decode("cn=admin data"), 524157415, asList(42, 346) },
            { DN.valueOf("cn=admin data"), 524157415, asList(42, 346) },
      };
    }