Package com.google.enterprise.connector.spi

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


    jdbcFixture.tearDown();
  }

  /** Continue the setup after initializing the connector. */
  protected void afterInit() throws RepositoryException {
    Session sess = conn.login();
    lam = (LivelinkAuthorizationManager) sess.getAuthorizationManager();
    ClientFactory clientFactory = conn.getClientFactory();
    client = clientFactory.createClient();
  }
View Full Code Here


          return Collections.<AuthorizationResponse>emptySet();
        }
      };
    conn.setAuthorizationManager(pluggable);

    Session sess = conn.login();
    AuthorizationManager authZ = sess.getAuthorizationManager();

    assertFalse(authZ.getClass().toString(),
        authZ instanceof LivelinkAuthorizationManager);
    assertSame(pluggable, authZ);
  }
View Full Code Here

    this.connector = TestConfiguration.getConnectorInstance();
  }

  public void testTraversal() throws InterruptedException, RepositoryException {
    final String connectorName = "sharepoint";
    final Session session = this.connector.login();
    GlobalState.forgetState(null);
    final SharepointTraversalManager traversalManager = (SharepointTraversalManager) session.getTraversalManager();
    final MockInstantiator instantiator = new MockInstantiator(new ThreadPool(
        5, new SystemClock()));
    final Traverser traverser = new QueryTraverser(new MockPusher(System.out),
        traversalManager, instantiator.getTraversalStateStore(connectorName),
        connectorName, Context.getInstance().getTraversalContext(),
View Full Code Here

    con.setPrincipal(TestConfiguration.d1upn);
    con.setPassword(TestConfiguration.d1password);
   
    con.setDataSource("h2", TestConfiguration.dbs.get("h2"));
   
    Session s = con.login();
    s.getTraversalManager();
  }
View Full Code Here

    con.setPrincipal(TestConfiguration.d1principal);
    con.setPassword(TestConfiguration.d1password);
   
    con.setDataSource("h2", TestConfiguration.dbs.get("h2"));
   
    Session s = con.login();
    s.getTraversalManager();
  }
View Full Code Here

    con.setPrincipal(TestConfiguration.d1principal);
    con.setPassword(TestConfiguration.d1password);
   
    con.setDataSource("h2", TestConfiguration.dbs.get("h2"));
   
    Session s = con.login();
    s.getTraversalManager();
  }
View Full Code Here

    con.setPrincipal(TestConfiguration.d1upn);
    con.setPassword(TestConfiguration.d1password);
   
    con.setDataSource("h2", TestConfiguration.dbs.get("h2"));
   
    Session s = con.login();
    s.getTraversalManager();
  }
View Full Code Here

    con.setPrincipal(TestConfiguration.d1principal);
    con.setPassword(TestConfiguration.d1password);
   
    con.setDataSource("h2", TestConfiguration.dbs.get("h2"));
   
    Session s = con.login();
    s.getTraversalManager();
  }
View Full Code Here

    con.setHostname(TestConfiguration.d1hostname);
    con.setPort(Integer.toString(TestConfiguration.d1plaintextport));
   
    con.setDataSource("h2", TestConfiguration.dbs.get("h2"));
   
    Session s = con.login();
    s.getTraversalManager();
  }
View Full Code Here

    con.setPrincipal(TestConfiguration.d1principal);
    con.setPassword(TestConfiguration.d1password);
    con.setDataSource(dbType, TestConfiguration.dbs.get(dbType));
    con.setIncludeBuiltinGroups(true);

    Session s = con.login();
    s.getTraversalManager().startTraversal();
    AuthenticationManager am = s.getAuthenticationManager();
    String username = TestConfiguration.d1principal.split("\\\\")[1];
    AuthenticationResponse response = am.authenticate(
        new SimpleAuthenticationIdentity(username));
    assertNotNull(response);

    Collection<Principal> principals = getGroups(response);
    assertNotNull(principals);
    assertTrue(principals.size() > 0);

    // Count the builtin groups to make sure at least one is found.
    ArrayList<Principal> groupsFound = new ArrayList<Principal>();
    int foundCount = 0;
    for (Principal principal : principals) {
      if (isBuiltin(principal.getName())) {
        foundCount++;
      } else {
        groupsFound.add(principal);
      }
    }
    assertTrue(foundCount > 0);

    // Run the traversal again, this time excluding builtin groups.
    con.setIncludeBuiltinGroups(false);
    am = s.getAuthenticationManager();
    response = am.authenticate(new SimpleAuthenticationIdentity(username));

    principals = getGroups(response);
    assertNotNull(principals);
    assertTrue(principals.size() > 0);
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.