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

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


    internalFactory = new DeleteDocumentHandleFactory();
    clientFactory = new MockDocumentHandleFactory();
  }

  public void testCheckpointAndChange_internal() throws Exception {
    DiffingConnectorCheckpoint fccp = DiffingConnectorCheckpoint.newFirst();
    DeleteDocumentHandle ddh = new DeleteDocumentHandle("abc");
    Change c = new Change(Change.FactoryType.INTERNAL, ddh, MCP);
    CheckpointAndChange checkpointAndChange = new CheckpointAndChange(fccp, c);
    String stringForm = checkpointAndChange.getJson().toString();
    JSONObject json = new JSONObject(stringForm);
View Full Code Here


    assertEquals(c.getDocumentHandle().getDocumentId(),
        copy.getChange().getDocumentHandle().getDocumentId());
  }

  public void testCheckpointAndChange_client() throws Exception {
    DiffingConnectorCheckpoint fccp = DiffingConnectorCheckpoint.newFirst();
    MockDocumentHandle mdh = new MockDocumentHandle("abc", "data");
    Change c = new Change(Change.FactoryType.CLIENT, mdh, MCP);
    CheckpointAndChange checkpointAndChange = new CheckpointAndChange(fccp, c);
    String stringForm = checkpointAndChange.getJson().toString();
    JSONObject json = new JSONObject(stringForm);
View Full Code Here

* Tests for {@link DiffingConnectorCheckpoint}.
*/
public class DiffingConnectorCheckpointTest extends TestCase {

  public void testNewFirst() throws Exception {
    DiffingConnectorCheckpoint fccp = DiffingConnectorCheckpoint.newFirst();
    assertEquals(0, fccp.getMajorNumber());
    assertEquals(0, fccp.getMinorNumber());
    assertTrue(fccp.compareTo(fccp) == 0);
    assertEquals(fccp, fccp);
    DiffingConnectorCheckpoint fccp2 = DiffingConnectorCheckpoint.fromJsonString(fccp.toString());
    assertEquals(fccp, fccp2);
    assertEquals(fccp.hashCode(), fccp2.hashCode());
    assertTrue(fccp.compareTo(fccp2) == 0);
  }
View Full Code Here

    assertEquals(fccp.hashCode(), fccp2.hashCode());
    assertTrue(fccp.compareTo(fccp2) == 0);
  }

  public void testNext() throws Exception {
    DiffingConnectorCheckpoint fccp = DiffingConnectorCheckpoint.newFirst();
    DiffingConnectorCheckpoint fccpN = fccp.next();
    assertEquals(fccp.getMajorNumber(), fccpN.getMajorNumber());
    assertEquals(fccp.getMinorNumber() + 1, fccpN.getMinorNumber());
    assertFalse(fccp.equals(fccpN));
    DiffingConnectorCheckpoint fccpN2 = DiffingConnectorCheckpoint.fromJsonString(fccpN.toString());
    assertEquals(fccpN, fccpN2);
    assertEquals(fccpN.hashCode(), fccpN2.hashCode());
    assertTrue(fccp.compareTo(fccpN) < 0);
    assertTrue(fccpN.compareTo(fccp) > 0);
  }
View Full Code Here

    assertTrue(fccp.compareTo(fccpN) < 0);
    assertTrue(fccpN.compareTo(fccp) > 0);
  }

  public void testNextMajor() throws Exception {
    DiffingConnectorCheckpoint fccp = DiffingConnectorCheckpoint.newFirst();
    DiffingConnectorCheckpoint fccpN = fccp.next();
    DiffingConnectorCheckpoint fccpNextMajor = fccpN.nextMajor();
    assertEquals(fccp.getMajorNumber() + 1, fccpNextMajor.getMajorNumber());
    assertEquals(fccp.getMinorNumber(), fccpNextMajor.getMinorNumber());
    assertFalse(fccp.equals(fccpNextMajor));
    DiffingConnectorCheckpoint fccpNextMajor2 =
        DiffingConnectorCheckpoint.fromJsonString(fccpNextMajor.toString());
    assertEquals(fccpNextMajor, fccpNextMajor2);
    assertEquals(fccpNextMajor.hashCode(), fccpNextMajor2.hashCode());
    assertTrue(fccp.compareTo(fccpNextMajor) < 0);
    assertTrue(fccpN.compareTo(fccpNextMajor) < 0);
    assertTrue(fccpNextMajor.compareTo(fccp) > 0);
    assertTrue(fccpNextMajor.compareTo(fccpN) > 0);
    assertTrue(fccpNextMajor.compareTo(fccpNextMajor2) == 0);
View Full Code Here

TOP

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

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.