Package com.google.enterprise.connector.spi

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


        }

        String docid = null;
        try {
          LOGGER.finer("Pulling next document from connector " + connectorName);
          Document nextDocument = resultSet.nextDocument();
          if (nextDocument == null) {
            LOGGER.finer("Traversal batch for connector " + connectorName
                + " at end after processing " + counter + " documents.");

            break;
View Full Code Here


    DocPusher dpusher = new DocPusher(feedConnection, dataSource, fsli, dfc);
    DocumentList documentList = qtm.startTraversal();

    Document document = null;
    while ((document = documentList.nextDocument()) != null) {
      assertEquals(PusherStatus.OK, dpusher.take(document, null));
    }
    dpusher.flush();
    String resultXML = feedConnection.getFeed();
    assertEquals(expectedXml, resultXML);
View Full Code Here

    DocumentList documentList = qtm.startTraversal();

    int i = 0;
    Document document = null;
    while ((document = documentList.nextDocument()) != null) {
      System.out.println("Test " + i + " output");
      assertFalse(i == expectedXml.length);
      DocPusher dpusher =
          new DocPusher(feedConnection, dataSource, fsli, dfc);
      assertEquals(PusherStatus.OK, dpusher.take(document, null));
View Full Code Here

    // as here.

    while (documentList != null) {
      int counter = 0;
      Document document = null;
      while ((document = documentList.nextDocument()) != null) {
        processOneDocument(document);
        counter++;
        if (counter == batchHint) {
          // this test program only takes batchHint results from each
          // resultSet. The real connector manager may take fewer - for
View Full Code Here

      con.setDataSource(dbType, TestConfiguration.dbs.get(dbType));
      Session s = con.login();
      TraversalManager out = s.getTraversalManager();

      DocumentList result = out.startTraversal();
      assertNull(result.nextDocument());
      assertEquals(AdConstants.CHECKPOINT_VALUE, result.checkpoint());

      result = out.resumeTraversal(AdConstants.CHECKPOINT_VALUE);
      assertNull(result);
    }
View Full Code Here

        ImmutableMap.of("MyDataSize", "GoogleDataSize"));
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();
    DocumentList list = ltm.startTraversal();
    assertNotNull(list.nextDocument());
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals("1729", Value.getSingleValueString(doc, "MyDataSize"));
  }
View Full Code Here

    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();
    DocumentList list = ltm.startTraversal();
    assertNotNull(list.nextDocument());
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals("1729", Value.getSingleValueString(doc, "MyDataSize"));
  }

  public void testGetResults() throws RepositoryException {
View Full Code Here

  public void testResumeTraversal() throws RepositoryException {
    LivelinkTraversalManager ltm = getObjectUnderTest(new MockClient());

    DocumentList list = ltm.resumeTraversal("2011-10-16 14:13:52,12345");
    assertNotNull(list);
    assertNull(list.nextDocument());
  }

  /**
   * Tests that if GetCurrentUserID throws an exception, so does
   * resumeTraversal. Legacy code returned null and triggered the
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.