Package com.google.enterprise.connector.spi

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


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

  /**
   * Tests a document where FetchVersion should throw an I/O exception
View Full Code Here


    DocumentList list =
        getObjectUnderTest(connector, MockConstants.IO_OBJECT_ID, 1, USER_ID);

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

  /**
   * Tests a document list where the first document is fine and for
   * the second document, FetchVersion should throw an I/O exception.
View Full Code Here

        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());
    assertEquals(checkpoint, list.checkpoint());
  }
View Full Code Here

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

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

  /**
   * Tests a document where FetchVersion should throw a
   * RepositoryDocumentException and be skipped.
View Full Code Here

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

  private static class PingErrorClient extends MockClient {
    private boolean isThrown = false;
View Full Code Here

    SharepointTraversalManager manager = this.travMan;
    sharepointClientContext.setSocialOption(
        SharepointConnector.SocialOption.NO);
    DocumentList initial = manager.startTraversal();
    List<SPDocument> pass1 = ((SPDocumentList) initial).getDocuments();
    String checkpoint1 = initial.checkpoint();
    assertEquals(SPConstants.CHECKPOINT_VALUE, checkpoint1);
    DocumentList incremental = manager.resumeTraversal(checkpoint1);
    List<SPDocument> pass2 = ((SPDocumentList) incremental).getDocuments();
    assertEquals(pass1.size(), pass2.size());   
  }
View Full Code Here

    }
    assertNull(docs.nextDocument());

    // TODO: Investigate: this loop looks weird cause it goes for BATCH_COUNT-1.
    for (int batch = 1; batch < BATCH_COUNT; batch++) {
      docs = tm.resumeTraversal(docs.checkpoint());
      assertEquals(1 + batch, monitorManager.getGuaranteeCount());
      for (int k = 0; k < BATCH_SIZE; ++k) {
        Document doc = docs.nextDocument();
        assertNotNull(doc);
        String docId = Value.getSingleValueString(doc, SpiConstants.PROPNAME_DOCID);
View Full Code Here

            docId);
      }
      assertNull(docs.nextDocument());
    }

    docs = tm.resumeTraversal(docs.checkpoint());
    for (int k = 0; k < EXTRA; ++k) {
      assertNotNull(docs.nextDocument());
    }
    assertNull(docs.nextDocument());
  }
View Full Code Here

          // example, if it receives a shutdown request
          break;
        }
      }

      String checkPointString = documentList.checkpoint();

      if (counter == 0) {
        // this test program stops if it receives zero results in a resultSet.
        // the real connector Manager might wait a while, then try again
        break;
View Full Code Here

      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

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.