Package com.google.enterprise.connector.util.diffing

Examples of com.google.enterprise.connector.util.diffing.ChangeSource


  /**
   * Tests the normal operation where a sequence of batches are processed to
   * completion in order. The first batch begins with a null checkpoint.
   */
  public void testStartResumeTraversal() throws IOException {
    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    String checkpoint = null;
View Full Code Here


  /**
   * Tests replaying the first batch which has a null checkpoint and then
   * resuming.
   */
  public void testRetryStartThenResume() throws IOException {
    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    String checkpoint = null;
View Full Code Here

  /**
   * Tests retrying a batch after the first one.
   */
  public void testRetryThenResume() throws IOException {
    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    String checkpoint = null;
View Full Code Here

  /**
   * Tests resuming from a checkpoint that is half way through the first batch.
   */
  public void testHalfStartBatch() throws IOException {
    ChangeSource changeSource = new MockChangeSource(8);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(3);
    q.start(null);
    Iterator<CheckpointAndChange> it = q.resume(null).iterator();
View Full Code Here

  /**
   * Tests resume for a null checkpoint when the {@link ChangeSource} is empty.
   */
  public void testStartWithEmptyChangeSource() throws IOException {
    ChangeSource changeSource = new MockChangeSource(0);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(3);
    q.start(null);
    Iterator<CheckpointAndChange> it = q.resume(null).iterator();
View Full Code Here

  /**
   * Tests resume for a second checkpoint when the {@link ChangeSource} is empty.
   */
  public void testResumeWithEmptyChangeSource() throws IOException {
    ChangeSource changeSource = new MockChangeSource(2);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    String checkpoint = null;
View Full Code Here

  /**
   * Tests resume for a null checkpoint when the {@link ChangeSource} has half
   * the requested changes.
   */
  public void testStartWithPartialChangeSource() throws IOException {
    ChangeSource changeSource = new MockChangeSource(2);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(3);
    q.start(null);
    String checkpoint = null;
View Full Code Here

  /**
   * Tests resume for a second checkpoint when the {@link ChangeSource} has half
   * the requested changes.
   */
  public void testResumeWithPartialChangeSource() throws IOException {
    ChangeSource changeSource = new MockChangeSource(5);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(3);
    q.start(null);
    String checkpoint = null;
View Full Code Here

        Arrays.asList(MockChangeSource.newChange(0),
            MockChangeSource.newChange(1), null,
            MockChangeSource.newChange(2), null, null,
            MockChangeSource.newChange(3),
            MockChangeSource.newChange(4));
    ChangeSource changeSource = new MockChangeSource(changes);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(5);
    q.start(null);
    String checkpoint = null;
View Full Code Here

    assertFalse(it.hasNext());
    return result;
  }

  public void testRecovery() throws IOException {
    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.util.diffing.ChangeSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.