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

Examples of com.google.enterprise.connector.util.diffing.CheckpointAndChangeQueue.resume()


    q.setMaximumQueueSize(5);
    q.start(null);
    String checkpoint = null;
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 1);
    Iterator<CheckpointAndChange> it = q.resume(checkpoint).iterator();
    assertFalse(it.hasNext());
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 3, 2);
    it = q.resume(checkpoint).iterator();
    assertFalse(it.hasNext());
  }
View Full Code Here


    String checkpoint = null;
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 1);
    Iterator<CheckpointAndChange> it = q.resume(checkpoint).iterator();
    assertFalse(it.hasNext());
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 3, 2);
    it = q.resume(checkpoint).iterator();
    assertFalse(it.hasNext());
  }

  private String checkChangesAndReturnLastCheckpoint(List<CheckpointAndChange> list,
View Full Code Here

    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 1);
    Iterator<CheckpointAndChange> it = q.resume(checkpoint).iterator();
    assertFalse(it.hasNext());
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 3, 2);
    it = q.resume(checkpoint).iterator();
    assertFalse(it.hasNext());
  }

  private String checkChangesAndReturnLastCheckpoint(List<CheckpointAndChange> list,
      int start, int count) {
View Full Code Here

    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);
    String checkpoint = firstBatch.get(1).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
View Full Code Here

        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String checkpoint = firstBatch.get(1).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
View Full Code Here

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
    List<CheckpointAndChange> secondBatchAgain = q2.resume(checkpoint);
    assertEquals(secondBatch, secondBatchAgain);
  }

  public void testRepeatedRecoveryAtSameCheckpoint() throws IOException {
    ChangeSource changeSource = new MockChangeSource(6);
View Full Code Here

    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);
    String checkpoint = firstBatch.get(1).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
View Full Code Here

        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String checkpoint = firstBatch.get(1).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
View Full Code Here

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
    List<CheckpointAndChange> secondBatchAgain = q2.resume(checkpoint);
    assertEquals(secondBatch, secondBatchAgain);

    CheckpointAndChangeQueue q3 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory,clientFactory);
    q3.setMaximumQueueSize(2);
View Full Code Here

    CheckpointAndChangeQueue q3 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory,clientFactory);
    q3.setMaximumQueueSize(2);
    q3.start(checkpoint);
    List<CheckpointAndChange> secondBatchThrice = q3.resume(checkpoint);
    assertEquals(secondBatch, secondBatchThrice);

    CheckpointAndChangeQueue q4 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q4.setMaximumQueueSize(2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.