Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Document.findProperty()


        isAddTested = true;
      } else if (ActionType.DELETE.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        if (object.isDeletionEvent()) {
          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_DELETION_EVENT_TIME));
          isDeletionEventTested = true;
        } else {
          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
View Full Code Here


              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_DELETION_EVENT_TIME));
          isDeletionEventTested = true;
        } else {
          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_CUSTOM_DELETION_TIME));
          isCustomDeletionTested = true;
        }
      }
    }
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);
    } else {
View Full Code Here

      throws RepositoryException {
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      System.out.println();
      for (String name : doc.getPropertyNames()) {
        Value value = doc.findProperty(name).nextValue();
        String printableValue;
        if (value instanceof BinaryValue) {
          try {
            InputStream in = ((BinaryValue) value).getInputStream();
            byte[] buffer = new byte[32];
View Full Code Here

    // Verify that this date is before our sanctioned startDate
    Session sess = conn.login();
    TraversalManager tm = sess.getTraversalManager();
    Document doc = getFirstResult(tm);
    assertNotNull("First doc is null.", doc);
    String dateStr = doc.findProperty("ModifyDate").nextValue().toString();
    try {
      Date docDate = parseDate(dateStr);

      assertTrue("First doc is newer than startDate.",
          docDate.before(startDate));
View Full Code Here

   */
  private void assertNoResultsOlderThan(LivelinkDocumentList docList,
      Date date) throws RepositoryException {
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      String docId = doc.findProperty("ID").nextValue().toString();
      String dateStr =
          doc.findProperty("ModifyDate").nextValue().toString();

      // Check that the modify date is new enough
      try {
View Full Code Here

      Date date) throws RepositoryException {
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      String docId = doc.findProperty("ID").nextValue().toString();
      String dateStr =
          doc.findProperty("ModifyDate").nextValue().toString();

      // Check that the modify date is new enough
      try {
        Date docDate = parseDate(dateStr);
        assertFalse("Document is older than " +
View Full Code Here

      try {
        Date docDate = parseDate(dateStr);
        assertFalse("Document is older than " +
            defaultDateFormat.format(date) +
            ". (Id="+ docId + "; Name=\"" +
            doc.findProperty("Name").nextValue().toString() +
            "\"; Mod Date=" + defaultDateFormat.format(docDate) + ")",
            docDate.before(date));
        boolean verbose = false;
        if ( verbose ) {
          System.out.println("Examining:(Id="+ docId +
View Full Code Here

            docDate.before(date));
        boolean verbose = false;
        if ( verbose ) {
          System.out.println("Examining:(Id="+ docId +
              "; Name=\"" +
              doc.findProperty("Name").nextValue().toString() +
              "\"; Mod Date=" + defaultDateFormat.format(docDate) +
              ")");
        }
      }
      catch (ParseException e) {
View Full Code Here

  private void assertNoDuplicates(LivelinkDocumentList docList,
      Set<String> nodes) throws RepositoryException {
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      Property prop = doc.findProperty(SpiConstants.PROPNAME_DOCID);
      String value = prop.nextValue().toString();
      assertTrue(value, nodes.add(value));
    }
  }
}
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.