Package com.google.enterprise.connector.spi

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


    try {
      GdConnector gdc = new GdConnector();
      gdc.setService(alwaysOneEntryService);
      DocumentList resultSet = gdc.startTraversal();
      Document docA = resultSet.nextDocument();
      Document docB = resultSet.nextDocument();
      assertNotNull(docA);
      assertEquals("\u9762",
          getFirstStringValue(docA, SpiConstants.PROPNAME_DOCID));
      assertNull(docB);
    } catch (RepositoryException re) {
View Full Code Here


    items.add(makeDocument("just the other day"));
   
    DocumentList docList = new GdDocumentList(items, "right now");
    Document ignoredDocument = null;
   
    ignoredDocument = docList.nextDocument();
    assertEquals("a while ago", docList.checkpoint());
    ignoredDocument = docList.nextDocument();
    assertEquals("just the other day", docList.checkpoint());
    ignoredDocument = docList.nextDocument();
    assertEquals("right now", docList.checkpoint());
View Full Code Here

    DocumentList docList = new GdDocumentList(items, "right now");
    Document ignoredDocument = null;
   
    ignoredDocument = docList.nextDocument();
    assertEquals("a while ago", docList.checkpoint());
    ignoredDocument = docList.nextDocument();
    assertEquals("just the other day", docList.checkpoint());
    ignoredDocument = docList.nextDocument();
    assertEquals("right now", docList.checkpoint());
  }
 
View Full Code Here

   
    ignoredDocument = docList.nextDocument();
    assertEquals("a while ago", docList.checkpoint());
    ignoredDocument = docList.nextDocument();
    assertEquals("just the other day", docList.checkpoint());
    ignoredDocument = docList.nextDocument();
    assertEquals("right now", docList.checkpoint());
  }
 
  public void testTraversesDocumentsGivenToConstructor()
  throws RepositoryException {
View Full Code Here

    items.add(docB);
    items.add(docC);
   
    DocumentList docList = new GdDocumentList(items, "right now");
   
    assertSame(docA, docList.nextDocument());
    assertSame(docB, docList.nextDocument());
    assertSame(docC, docList.nextDocument());
    assertNull(null, docList.nextDocument());
  }
 
View Full Code Here

    items.add(docC);
   
    DocumentList docList = new GdDocumentList(items, "right now");
   
    assertSame(docA, docList.nextDocument());
    assertSame(docB, docList.nextDocument());
    assertSame(docC, docList.nextDocument());
    assertNull(null, docList.nextDocument());
  }
 
  private Document makeDocument() {
View Full Code Here

   
    DocumentList docList = new GdDocumentList(items, "right now");
   
    assertSame(docA, docList.nextDocument());
    assertSame(docB, docList.nextDocument());
    assertSame(docC, docList.nextDocument());
    assertNull(null, docList.nextDocument());
  }
 
  private Document makeDocument() {
    return makeDocument(null);
View Full Code Here

    DocumentList docList = new GdDocumentList(items, "right now");
   
    assertSame(docA, docList.nextDocument());
    assertSame(docB, docList.nextDocument());
    assertSame(docC, docList.nextDocument());
    assertNull(null, docList.nextDocument());
  }
 
  private Document makeDocument() {
    return makeDocument(null);
  }
View Full Code Here

    // Under live test and the test account, the deletion events weren't
    // returned from FileNet.
    boolean tested = false;
    DocumentList docList = traverser.getDocumentList(new Checkpoint());
    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      assertTrue(checkpointContains(docList.checkpoint(),
          doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
          JsonField.LAST_MODIFIED_TIME));
      tested = true;
    }
View Full Code Here

  public void testLiveNextDocument() throws Exception {
    Traverser traverser = getObjectUnderTest();
    boolean isTested = false;
    DocumentList docList = traverser.getDocumentList(new Checkpoint());
    assertNotNull("Document list is null", docList);
    Document doc = docList.nextDocument();
    while (doc != null && doc instanceof FileDocument) {
      Property lastModifiedProp =
          doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED);
      Value lastModifiedValue = lastModifiedProp.nextValue();
      Calendar cal = Value.iso8601ToCalendar(lastModifiedValue.toString());
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.