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

ludovicp
31.07.2010 a33166c79680cdc1154b99df37987140c9bd2e9c
Improve error message when querying the External Changelog with an invalid cookie. Improve unit tests reliabililty  for replication. 
4 files modified
23 ■■■■■ changed files
opends/src/messages/messages/replication.properties 4 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ECLServerHandler.java 4 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java 9 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/GenerationIdTest.java 6 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/replication.properties
@@ -376,7 +376,9 @@
SEVERE_ERR_REPLICATION_PROTOCOL_MESSAGE_TYPE_157=Replication \
 protocol error. Bad message type. %s received, %s required  
SEVERE_ERR_RESYNC_REQUIRED_MISSING_DOMAIN_IN_PROVIDED_COOKIE_158=Full resync \
 required. Reason: The provided cookie is missing the replicated domain(s) %s
 required because the provided cookie is missing the replicated domain(s) %s. \
 The following cookie value can be used to retrieve the missing changes, \
 including the COMPLETE record of changes for the missing domain(s) : %s
SEVERE_ERR_BYTE_COUNT_159=The Server Handler byte count is not correct (Fixed)
NOTICE_ERR_FRACTIONAL_CONFIG_UNKNOWN_OBJECT_CLASS_160=Wrong fractional \
 replication configuration: could not find object class definition for %s in \
opends/src/server/org/opends/server/replication/server/ECLServerHandler.java
@@ -826,8 +826,8 @@
        // the request is rejected and a full resync is required.
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
          ERR_RESYNC_REQUIRED_MISSING_DOMAIN_IN_PROVIDED_COOKIE.get(
              missingDomains +
              ". Possible cookie: <" + (providedCookie + missingDomains)+ ">"));
              missingDomains,
              "<" + (providedCookie + missingDomains)+ ">"));
      }
      domainCtxts = tmpSet.toArray(new DomainContext[0]);
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java
@@ -1184,11 +1184,12 @@
      
      waitOpResult(searchOp, ResultCode.UNWILLING_TO_PERFORM);
      assertEquals(searchOp.getSearchEntries().size(), 0);
      assertTrue(searchOp.getErrorMessage().toString().equalsIgnoreCase(
          "Full resync required. Reason: The provided cookie is missing the replicated domain(s) o=test:;. Possible cookie: <"
          + newCookie + "o=test:;>"), "Server output:" +
      String expectedError =
        "Full resync required because the provided cookie is missing the replicated domain(s) o=test:;. The following cookie value can be used to retrieve the missing changes, including the COMPLETE record of changes for the missing domain(s) : <"
        + newCookie + "o=test:;>";
      assertTrue(searchOp.getErrorMessage().toString().equalsIgnoreCase(expectedError),
          "Expected: " + expectedError + "Server output:" +
          searchOp.getErrorMessage().toString());
      s1test.stop();
      s1test2.stop();
      s2test.stop();
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/GenerationIdTest.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.server.replication;
@@ -444,13 +444,13 @@
      int waitCo=0;
      LDAPReplicationDomain doToco=null;
      while(waitCo<30)
      while(waitCo<50)
      {
        doToco =
          LDAPReplicationDomain.retrievesReplicationDomain(baseDn);
        if ((doToco!=null) && (doToco.isConnected()))
          break;
        Thread.sleep(200);
        Thread.sleep(waitCo * 200);
        waitCo++;
      }
      assertTrue(doToco.isConnected(), "not connected after #attempt="+waitCo);