Examples of MockRepository


Examples of com.google.enterprise.connector.mock.MockRepository

      mrel = new MockRepositoryEventList(db);
    } catch (RuntimeException e) {
      throw new RepositoryException(e);
    }

    MockJcrRepository repo = new MockJcrRepository(new MockRepository(mrel));
    Credentials creds = null;
    if (iLI != null) {
      creds = new SimpleCredentials(iLI.getUser(), iLI.getPassword()
          .toCharArray());
    } else {
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

   * Basic sanity test
   */
  public void testSimpleRepository() throws LoginException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);
    assertTrue
        (r.getCurrentTime().compareTo(new MockRepositoryDateTime(60)) == 0);

    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());

    Session session = repo.login(creds);
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

   * Test session with "users" document and "acl" properties.
   */
  public void testAuthnRepository() throws LoginException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog2.txt");
    MockRepository r = new MockRepository(mrel);
    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());
    Session session = repo.login(creds);
    assertTrue(session != null);
    // Test non-admin user
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

   * Test for Issue 3.  Bad login should result in a LoginException.
   */
  public final void testIssue3() {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog7.txt");
    MockRepository r = new MockRepository(mrel);
    MockJcrRepository repo = new MockJcrRepository(r);

    // Test good credentials.
    Credentials creds = new SimpleCredentials("joe", "joe".toCharArray());
    Session session = null;
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

  public final void testGetNodeByUUID() throws LoginException,
      RepositoryException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog2.txt");
    MockRepository r = new MockRepository(mrel);

    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());

    Session session = repo.login(creds);
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

  public final void testGetNodeByUUIDNewFormat()
      throws LoginException, RepositoryException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLogAcl.txt");
    MockRepository r = new MockRepository(mrel);
    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());

    Session session = repo.login(creds);
    Assert.assertTrue(session != null);
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

   * @throws RepositoryException
   */
  public void testSimpleQuery() throws RepositoryException {
    MockRepositoryEventList mrel = new MockRepositoryEventList(
        "MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);

    QueryManager qm = new MockJcrQueryManager(r.getStore());

    String statement = "{from:10, to:21}";
    String language = "mockQueryLanguage";

    Query query = qm.createQuery(statement, language);
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

  }

  public void testXpathQuery() throws RepositoryException {
    MockRepositoryEventList mrel = new MockRepositoryEventList(
        "MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);

    QueryManager qm = new MockJcrQueryManager(r.getStore());

    String messagePattern =
      "//*[@jcr:primaryType = 'nt:resource' and @jcr:lastModified >= " +
      "''{0}''] order by @jcr:lastModified, @jcr:uuid";

View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

  public final void testAuthenticate() throws RepositoryLoginException,
      RepositoryException, LoginException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog2.txt");
    MockRepository r = new MockRepository(mrel);
    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());
    Session session = repo.login(creds);
    AuthenticationManager authenticationManager =
        new JcrAuthenticationManager(session);
View Full Code Here

Examples of com.google.enterprise.connector.mock.MockRepository

  }

  public final void testJcrDocumentFromMockRepo() throws RepositoryException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog3.txt");
    MockRepository r = new MockRepository(mrel);
    MockRepositoryDocument doc = r.getStore().getDocByID("doc1");
    Node node = new MockJcrNode(doc);
    Document document = new JcrDocument(node);
    countProperties(document);
  }
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.