Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Session


  @Override
  protected void setUp() throws Exception {
    allowCrawlerThread = true;
    super.setUp();
    Session session = connector.login();
    NotesUserGroupManager userGroupManager =
        new NotesUserGroupManager((NotesConnectorSession) session);
    userGroupManager.updateUsersGroups(true);
    username = ConnectorFixture.getRequiredProperty(
        "javatest.authorization.username");
View Full Code Here


   * Tests reading the repository id.
   *
   * @throws RepositoryException
   */
  public void testGetRepIdFromDocId() throws RepositoryException {
    Session session = connector.login();
    NotesAuthorizationManager manager =
        (NotesAuthorizationManager) session.getAuthorizationManager();
    String docId =
        "http://NewYork/852578CE004AF5F8/0/E54902C71C28594F852578CE004B223B";
    assertEquals("852578CE004AF5F8", manager.getRepIdFromDocId(docId));
  }
View Full Code Here

   * Tests reading the UNID.
   *
   * @throws RepositoryException
   */
  public void testGetUnidFromDocId() throws RepositoryException {
    Session session = connector.login();
    NotesAuthorizationManager manager =
        (NotesAuthorizationManager) session.getAuthorizationManager();
    String docId =
        "http://NewYork/852578CE004AF5F8/0/E54902C71C28594F852578CE004B223B";
    assertEquals("E54902C71C28594F852578CE004B223B",
        manager.getUNIDFromDocId(docId));
  }
View Full Code Here

   * Tests the authorize response for an invalid user.
   *
   * @throws RepositoryException
   */
  public void testAuthorizeDocIdsInvalidUser() throws RepositoryException {
    Session session = connector.login();
    NotesAuthorizationManager manager =
        (NotesAuthorizationManager) session.getAuthorizationManager();
    Collection<String> docIdList = new ArrayList<String>(5);
    docIdList.add(
        "http://NewYork/852578CE004AF5F8/0/A882F2482DCAC783852578CE004B0346");
    docIdList.add(
        "http://NewYork/852578CE004AF5F8/0/D2DB3C67F6263353852578CE004B1955");
View Full Code Here

      assertFalse(response.getDocid(), response.isValid());
    }
  }

  public void testAuthorizeDocids() throws Exception {
    Session session = connector.login();
    List<String> docIds = getDocIds(session);
    assertEquals(5, docIds.size());
    // Try to construct an invalid docId that's still
    // syntactically valid. It should be authorized since it
    // won't appear in the security view.
    StringBuilder id = new StringBuilder(docIds.get(2));
    int slash = id.lastIndexOf("/");
    id.replace(slash + 1, id.length() - 1, "12345678901234567890123456789012");
    docIds.add(4, id.toString());

    NotesAuthorizationManager manager =
        (NotesAuthorizationManager) session.getAuthorizationManager();
    Collection<AuthorizationResponse> responseList = manager.authorizeDocids(
        docIds, new SimpleAuthenticationIdentity(username));
    assertEquals(6, responseList.size());
    for (AuthorizationResponse response : responseList) {
      assertTrue(response.getDocid(), response.isValid());
View Full Code Here

      assertTrue(response.getDocid(), response.isValid());
    }
  }

  public void testAuthorizeDocidsMalformedDocid() throws Exception {
    Session session = connector.login();
    List<String> docIds = getDocIds(session);
    assertEquals(5, docIds.size());
    // Set a invalid docId that's not syntactically valid.
    docIds.add(4, "not a doc id");
    assertEquals(6, docIds.size());

    NotesAuthorizationManager manager =
        (NotesAuthorizationManager) session.getAuthorizationManager();
    Collection<AuthorizationResponse> responseList = manager.authorizeDocids(
        docIds, new SimpleAuthenticationIdentity(username));
    assertEquals(6, responseList.size());
    for (AuthorizationResponse response : responseList) {
      if ("not a doc id".equals(response.getDocid())) {
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    allowCrawlerThread = true;
    super.setUp();
    // Temporary fix for the need to create user/group cache.
    Session session = connector.login();
    NotesUserGroupManager userGroupManager =
        new NotesUserGroupManager((NotesConnectorSession) session);
    userGroupManager.updateUsersGroups(true);
  }
View Full Code Here

  /* TODO: consider creating a helper to take a TraversalManager
   * and return the list of docid values.
   */
  public void testTraverseAllDocuments()
      throws RepositoryLoginException, RepositoryException {
    Session session = connector.login();
    TraversalManager tm = ConnectorFixture.getTraversalManager(
        (NotesConnectorSession) session);

    Set<String> docIdListFirstTraversal = new HashSet<String>(100);
    List<String> duplicatesFirstTraversal = new ArrayList<String>(100);
View Full Code Here

   * the attachment filename.
   */
  // TODO: use a known test database with attachments.
  public void testTraversalCheckAttachments()
      throws RepositoryLoginException, RepositoryException {
    Session session = connector.login();
    TraversalManager tm = ConnectorFixture.getTraversalManager(
        (NotesConnectorSession) session);

    // Get the first set of documents.
    tm.setBatchHint(25);
View Full Code Here

        "javatest.authentication.password");

    // Temporary fix for the need to create user/group cache.
    // TODO: Create a better fixture that handles the need to set
    // up data before tests.
    Session session = connector.login();
    NotesUserGroupManager userGroupManager =
        new NotesUserGroupManager((NotesConnectorSession) session);
    userGroupManager.updateUsersGroups(true);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.Session

Copyright © 2018 www.massapicom. 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.