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

Jean-Noël Rouvignac
03.31.2016 db8d009db28035eedcd7957d6e2a26c0643952ec
FakeReplicationDomain improved exception to ease diagnostic in CI
1 files modified
25 ■■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java 25 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java
@@ -16,19 +16,20 @@
 */
package org.opends.server.replication.service;
import static org.forgerock.i18n.LocalizableMessage.*;
import static org.forgerock.opendj.ldap.ResultCode.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.SortedSet;
import java.util.concurrent.BlockingQueue;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.replication.plugin.DomainFakeCfg;
import org.opends.server.replication.protocol.UpdateMsg;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.DirectoryException;
import org.forgerock.opendj.ldap.ResultCode;
/**
 * This class is the minimum implementation of a Concrete ReplicationDomain
@@ -37,21 +38,12 @@
@SuppressWarnings("javadoc")
public class FakeReplicationDomain extends ReplicationDomain
{
  /**
   * A blocking queue that is used to send the UpdateMsg received from the
   * Replication Service.
   */
  /** A blocking queue that is used to send the UpdateMsg received from the Replication Service. */
  private BlockingQueue<UpdateMsg> queue;
  /** A string that will be exported should exportBackend be called. */
  private String exportString;
  /**
   * A StringBuilder that will be used to build a new String should the import
   * be called.
   */
  /** A StringBuilder that will be used to build a new String should the import be called. */
  private StringBuilder importString;
  private int exportedEntryCount;
  private FakeReplicationDomain(DN baseDN, int serverID,
@@ -122,7 +114,7 @@
    }
    catch (IOException e)
    {
      throw new DirectoryException(ResultCode.OPERATIONS_ERROR, LocalizableMessage.raw("exportBackend"));
      throw new DirectoryException(OPERATIONS_ERROR, raw("IOException during exportBackend"), e);
    }
  }
@@ -139,7 +131,7 @@
      }
      catch (IOException e)
      {
        throw new DirectoryException(ResultCode.OPERATIONS_ERROR, LocalizableMessage.raw("importBackend"));
        throw new DirectoryException(OPERATIONS_ERROR, raw("IOException during importBackend"), e);
      }
      if (ret>0)
      {
@@ -158,5 +150,4 @@
    }
    return true;
  }
}