Package com.google.enterprise.connector.spi

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


    Document doc = handle.getDocument();
    assertNotNull(doc);
    assertEquals(properties.keySet(), doc.getPropertyNames());

    for (Map.Entry<String, String>  entry : properties.entrySet()) {
      Property property = doc.findProperty(entry.getKey());
      assertNotNull(property);
      assertEquals(entry.getValue(), property.nextValue().toString());
    }
  }
View Full Code Here


    // SnapshotRepository.
    assertEquals("document from deserialized handle",
        propertyNames, recoveryDoc.getPropertyNames());
    for (String propertyName : propertyNames) {
      assertPropertyEquals(propertyName, doc.findProperty(propertyName),
          recoveryDoc.findProperty(propertyName));
    }
  }

  public void testHandleLifecycle_default() throws Exception {
    testHandleLifecycle(configMap);
View Full Code Here

  public void testNoAcl() throws RepositoryException {
    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
                                           "no_acl");
    // Should not have ACL properties.
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLUSERS));
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLGROUPS));
  }

  public void testUserAcl() throws RepositoryException {
    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
View Full Code Here

  public void testNoAcl() throws RepositoryException {
    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
                                           "no_acl");
    // Should not have ACL properties.
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLUSERS));
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLGROUPS));
  }

  public void testUserAcl() throws RepositoryException {
    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
                                           "user_acl");
View Full Code Here

  public void testUserAcl() throws RepositoryException {
    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
                                           "user_acl");
    // ACL=[joe,mary,admin]
    JcrProperty property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertNotNull(property);
    assertContainsScope("joe", property);
    // Note, have to refresh the property each time since it's nextValue()
    // method is stateful.
    property =
View Full Code Here

    assertNotNull(property);
    assertContainsScope("joe", property);
    // Note, have to refresh the property each time since it's nextValue()
    // method is stateful.
    property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertContainsScope("mary", property);
    property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertContainsScope("admin", property);
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLGROUPS));
View Full Code Here

    // method is stateful.
    property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertContainsScope("mary", property);
    property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertContainsScope("admin", property);
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLGROUPS));
  }

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

        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertContainsScope("mary", property);
    property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertContainsScope("admin", property);
    assertNull(document.findProperty(SpiConstants.PROPNAME_ACLGROUPS));
  }

  public void testUserRoleAcl() throws RepositoryException {
    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
                                           "user_role_acl");
View Full Code Here

    Document document = extractJcrDocument("MockRepositoryEventLogAcl.txt",
                                           "user_role_acl");
    // ACL=["joe=reader","mary=reader,writer","admin=owner"]
    // joe=reder
    JcrProperty property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertNotNull(property);
    assertContainsScope("joe", property);
    JcrProperty scopeRoles = (JcrProperty) document.findProperty(
        SpiConstants.USER_ROLES_PROPNAME_PREFIX + "joe");
    assertNotNull(scopeRoles);
View Full Code Here

    // joe=reder
    JcrProperty property =
        (JcrProperty) document.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertNotNull(property);
    assertContainsScope("joe", property);
    JcrProperty scopeRoles = (JcrProperty) document.findProperty(
        SpiConstants.USER_ROLES_PROPNAME_PREFIX + "joe");
    assertNotNull(scopeRoles);
    assertContainsRole("reader", scopeRoles);
    // mary=reader,writer
    property =
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.