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

Jean-Noel Rouvignac
29.40.2014 06eadb122b5e1d11bfbd4faccada66b34fd4c92a
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
opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java 8 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnvTest.java 5 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
@@ -252,12 +252,13 @@
        if (debugEnabled())
        {
          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.decode(str[2]);
          if (debugEnabled())
@@ -269,6 +270,7 @@
        }
        else
        {
          final String[] str = stringData.split(FIELD_SEPARATOR, 2);
          final int serverId = toInt(str[0]);
          final DN baseDN = DN.decode(str[1]);
          if (debugEnabled())
opends/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.decode("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.decode("cn=admin data"), 524157415, asList(42, 346) },
      };
    }