Package com.google.enterprise.connector.spi

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


  public void testStartTraversal() throws RepositoryException {
    qtm.setBatchHint(DmInitialize.DM_RETURN_TOP_UNBOUNDED);
    DocumentList documentList = qtm.startTraversal();

    int counter = 0;
    while (documentList.nextDocument() != null) {
      counter++;
    }
    assertEquals(DmInitialize.DM_RETURN_TOP_UNBOUNDED, counter);
  }
View Full Code Here


    qtm.setBatchHint(DmInitialize.DM_RETURN_TOP_BOUNDED);
    DocumentList documentList = qtm.resumeTraversal(checkPoint);

    assertNotNull(documentList);
    int counter = 0;
    while (documentList.nextDocument() != null) {
      counter++;
    }
    assertEquals(DmInitialize.DM_RETURN_TOP_BOUNDED, counter);
  }
View Full Code Here

    String checkpoint = "{index:0,uuid:['one','another'],"
        + "lastModified=['2010-04-01 00:01:00','2010-10-27 22:55:03']}";

    DocumentList documentList = mtm.resumeTraversal(checkpoint);
    assertNotNull(documentList);
    assertNull(documentList.nextDocument());
    assertNotNull(documentList.checkpoint()); // It's not MockDocumentList.
    assertEquals(1, mtm.count); // Would have been 2 without the timeout.
  }
}
View Full Code Here

    int counter = 0;
    DocumentList propertyMapList = qtm.startTraversal();
    Document pm = null;
    Property prop = null;

    while ((pm = propertyMapList.nextDocument()) != null) {

      assertTrue(pm instanceof DctmSysobjectDocument);
      prop = pm.findProperty(SpiConstants.PROPNAME_DOCID);

      assertNotNull(prop);
View Full Code Here

    String checkPoint = null;

    int counter = 0;
    DocumentList propertyMapList = qtm.startTraversal();

    while ((propertyMapList.nextDocument()) != null) {
      counter++;
    }
    assertEquals(DmInitialize.DM_RETURN_TOP_UNBOUNDED, counter);

    // XXX: This time comes back as if the timestamp value were in
View Full Code Here

  public void documentContainsDirectDefaultAcls() throws Exception {
    String[][] data = {{expectedId, timeStr}};
    @SuppressWarnings("unchecked") DocumentList doclist =
        getDocumentList(data, directAces, defaultAces);

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    Property inheritFrom =
        doc.findProperty(SpiConstants.PROPNAME_ACLINHERITFROM_DOCID);
    assertNull(inheritFrom);
    assertDocContainsDirectDefaultAces(doc, 0);
View Full Code Here

        doc.findProperty(SpiConstants.PROPNAME_ACLINHERITFROM_DOCID);
    assertNull(inheritFrom);
    assertDocContainsDirectDefaultAces(doc, 0);

    assertNull("Document should not have TMPL or FLDR ACL document",
        doclist.nextDocument());
  }

  /**
   * Tests document inheriting from TMPL docid and TMPL-Parent-ACL document
   * existed.
 
View Full Code Here

  public void documentContainsDirectDefaultTemplateAcls() throws Exception {
    String[][] data = {{expectedId, timeStr}};
    @SuppressWarnings("unchecked") DocumentList doclist =
        getDocumentList(data, directAces, defaultAces, templateAces);

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    assertDocInheritFrom(doc, expectedId + AclDocument.SEC_POLICY_POSTFIX);
    assertDocContainsDirectDefaultAces(doc, 0);

    Document acl = doclist.nextDocument();
View Full Code Here

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    assertDocInheritFrom(doc, expectedId + AclDocument.SEC_POLICY_POSTFIX);
    assertDocContainsDirectDefaultAces(doc, 0);

    Document acl = doclist.nextDocument();
    assertTrue(acl instanceof AclDocument);
    assertEquals(expectedId + AclDocument.SEC_POLICY_POSTFIX,
        Value.getSingleValueString(acl, SpiConstants.PROPNAME_DOCID));
    assertAclContainsAces(acl, PermissionSource.SOURCE_TEMPLATE, 0);
View Full Code Here

    assertTrue(acl instanceof AclDocument);
    assertEquals(expectedId + AclDocument.SEC_POLICY_POSTFIX,
        Value.getSingleValueString(acl, SpiConstants.PROPNAME_DOCID));
    assertAclContainsAces(acl, PermissionSource.SOURCE_TEMPLATE, 0);

    assertNull(doclist.nextDocument());
  }

  /**
   * Tests document inheriting from FLDR docid and FLDR-Parent-ACL document
   * existed.
 
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.