Package com.google.enterprise.connector.spi

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


   * Tests an invalid user name.
   *
   * @throws RepositoryException
   */
  public void testInvalidUser() throws RepositoryException {
    Session session = connector.login();
    AuthenticationManager manager = session.getAuthenticationManager();
    AuthenticationResponse response = manager.authenticate(
        new SimpleAuthenticationIdentity("not a real username"));
    assertFalse(response.isValid());
  }
View Full Code Here


   * Tests a valid user name.
   *
   * @throws RepositoryException
   */
  public void testValidUser() throws RepositoryException {
    Session session = connector.login();
    AuthenticationManager manager = session.getAuthenticationManager();
    AuthenticationResponse response = manager.authenticate(
        new SimpleAuthenticationIdentity(username, password));
    assertTrue("Failed to authenticate: " + username, response.isValid());
    @SuppressWarnings({ "unchecked", "cast" })
        Collection<Principal> groups = (Collection<Principal>) response.getGroups();
View Full Code Here

   * Tests a valid user name with no password.
   *
   * @throws RepositoryException
   */
  public void testValidUserGroupResolutionOnly() throws RepositoryException {
    Session session = connector.login();
    AuthenticationManager manager = session.getAuthenticationManager();
    AuthenticationResponse response = manager.authenticate(
        new SimpleAuthenticationIdentity(username, null));
    assertTrue("Authenticated: " + username, response.isValid());
    @SuppressWarnings({ "unchecked", "cast" })
        Collection<Principal> groups = (Collection<Principal>) response.getGroups();
View Full Code Here

        connector.getSessionFactory();
    NotesConnectorSessionTest.configureFactoryForSession(factory);

    assertFalse(connector.getShutdown());
    try {
      Session session = connector.login();
    } finally {
      connector.shutdown();
    }
    assertTrue(connector.getShutdown());
  }
View Full Code Here

public class AfydConnectorTest extends TestCase {
 
  public void testConnectorImplementsRequiredInterfaces() {
    try {
      Connector connector = new AfydConnector(null, "ignored.properties", null);
      Session session = connector.login();
      AuthenticationManager authnManager = session.getAuthenticationManager();
      AuthorizationManager authzManager = session.getAuthorizationManager();
      TraversalManager traversalManager = session.getTraversalManager();
    } catch (ClassCastException cce) {
      Assert.fail(cce.toString());
    } catch (RepositoryException re) {
      // this is OK to throw
    }
View Full Code Here

      connector.setIncluded_meta(DmInitialize.DM_INCLUDED_META);
      /**
       * End simulation
       */

      Session session = connector.login();
      TraversalManager qtm = session.getTraversalManager();
      DctmTraversalUtil.runTraversal(qtm, 10);
    } catch (RepositoryLoginException le) {
      System.out.println("Root Cause : " + le.getCause()
          + " ; Message : " + le.getMessage());
    } catch (RepositoryException re) {
View Full Code Here

    ((DctmConnector) connector)
        .setIncluded_object_type(DmInitialize.DM_INCLUDED_OBJECT_TYPE);

    ((DctmConnector) connector)
        .setRoot_object_type(DmInitialize.ROOT_OBJECT_TYPE);
    Session sess = (DctmSession) connector.login();
    qtm = (DctmTraversalManager) sess.getTraversalManager();
  }
View Full Code Here

    ((DctmConnector) connector).setClientX(DmInitialize.DM_CLIENTX);
    ((DctmConnector) connector)
        .setWebtop_display_url(DmInitialize.DM_WEBTOP_SERVER_URL);
    ((DctmConnector) connector).setIs_public("false");

    Session sess = (DctmSession) connector.login();

    DctmAuthenticationManager authentManager = (DctmAuthenticationManager) sess
        .getAuthenticationManager();

    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK1,
            DmInitialize.DM_PWD_OK1)).isValid());
View Full Code Here

    connector.setPassword(DmInitialize.DM_PWD_OK1);
    connector.setDocbase(DmInitialize.DM_DOCBASE);
    connector.setClientX(DmInitialize.DM_CLIENTX);
    connector.setWebtop_display_url(DmInitialize.DM_WEBTOP_SERVER_URL);
    connector.setIs_public("false");
    Session sess = connector.login();
    AuthorizationManager authorizationManager = sess.getAuthorizationManager();

    {
      String username = DmInitialize.DM_LOGIN_OK2;

      Map<String, Boolean> expectedResults = new HashMap<String, Boolean>();
View Full Code Here

    connector.setPassword(DmInitialize.DM_PWD_OK1);
    connector.setDocbase(DmInitialize.DM_DOCBASE);
    connector.setClientX(DmInitialize.DM_CLIENTX);
    connector.setWebtop_display_url(DmInitialize.DM_WEBTOP_SERVER_URL);
    connector.setIs_public("false");
    Session session = connector.login();
    assertNotNull(session);
    TraversalManager qtm = session.getTraversalManager();
    assertNotNull(qtm);
    assertEquals(DmInitialize.DM_WEBTOP_SERVER_URL,
        ((DctmTraversalManager) qtm).getServerUrl());
  }
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.