Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.DocumentList.nextDocument()


      throws RepositoryException, SQLException {
    insertDTreeAcl(38, 1001, Client.PERM_SEECONTENTS);
    setUserData(1001, "ntlm=");

    DocumentList list = getObjectUnderTest(38, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
View Full Code Here


   */
  public void testNextDocument_emptyContent() throws RepositoryException {
    DocumentList list =
        getObjectUnderTest(MockConstants.IO_OBJECT_ID, 0, USER_ID);

    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertNotNull(list.checkpoint());
  }

  enum Content { NULL, NON_NULL };
View Full Code Here

   */
  private void testTraversalContext(TraversalContext traversalContext,
      long dataSize, Content contentState) throws RepositoryException {
    DocumentList list = getObjectUnderTest(traversalContext, dataSize);

    Document doc = list.nextDocument();
    Property content = doc.findProperty(SpiConstants.PROPNAME_CONTENT);
    if (contentState == Content.NULL) {
      assertNull("Expected null content", content);
    } else if (contentState == Content.NON_NULL) {
      assertNotNull("Expected non-null content", content);
View Full Code Here

  public void testNextDocument_exception() throws RepositoryException {
    DocumentList list =
        getObjectUnderTest(MockConstants.IO_OBJECT_ID, 1, USER_ID);

    try {
      Document doc = list.nextDocument();
      fail("Expected a LivelinkIOException");
    } catch (RepositoryDocumentException e) {
      fail("Did not expect a RepositoryDocumentException");
    } catch (LivelinkIOException e) {
      assertNull(list.checkpoint());
View Full Code Here

    LivelinkConnector connector =
        getConnector("unsupportedFetchVersionTypes", "144");
    DocumentList list =
        getObjectUnderTest(connector, MockConstants.IO_OBJECT_ID, 1, USER_ID);

    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertNotNull(list.checkpoint());
  }

  /**
 
View Full Code Here

  public void testNextDocument_partial() throws RepositoryException {
    DocumentList list = getObjectUnderTest(
        MockConstants.HARMLESS_OBJECT_ID, 0, USER_ID,
        MockConstants.IO_OBJECT_ID, 1, USER_ID);

    Document doc = list.nextDocument();
    assertNotNull(doc);
    String checkpoint = list.checkpoint();
    assertNotNull(checkpoint);

    assertNull(list.nextDocument());
View Full Code Here

    Document doc = list.nextDocument();
    assertNotNull(doc);
    String checkpoint = list.checkpoint();
    assertNotNull(checkpoint);

    assertNull(list.nextDocument());
    assertEquals(checkpoint, list.checkpoint());
  }

  /**
   * Tests a document where FetchVersion should throw a
View Full Code Here

    PingErrorClient client = new PingErrorClient();
    DocumentList list = getObjectUnderTest(client,
        MockConstants.DOCUMENT_OBJECT_ID, 1, USER_ID);

    try {
      Document doc = list.nextDocument();
      fail("Expected a RepositoryDocumentException");
    } catch (RepositoryDocumentException e) {
      assertFalse(client.isThrown());
      assertNotNull(list.checkpoint());
    }
View Full Code Here

    Client client = clientFactory.createClient();

    DocumentList list = new LivelinkDocumentList(connector,
        client, null, null, null, null, null, null, null);
    try {
      Document next = list.nextDocument();
      fail("Expected a NullPointerException");
    } catch (NullPointerException e) {
    }
  }
View Full Code Here

    Client client = clientFactory.createClient();
    Checkpoint checkpoint = new Checkpoint();

    DocumentList list = new LivelinkDocumentList(connector,
        client, null, null, null, null, null, checkpoint, null);
    Document next = list.nextDocument();
    assertNull(next);
  }

  /** Tests a null recArray with a non-null publicContentUsername. */
  public void testNullConstructorArgs_publicContentUsername()
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.