Package com.google.enterprise.connector.mock

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


      throws RepositoryException, RepositoryLoginException {
    // db is actually the suffix of the filename that is used to create the
    // eventlist.
    // As there is no way we can retrieve it, we will store it in the
    // MockDmSession we create.
    MockRepositoryEventList mrel = null;
    try {
      mrel = new MockRepositoryEventList(db);
    } catch (RuntimeException e) {
      throw new RepositoryException(e);
    }

    MockJcrRepository repo = new MockJcrRepository(new MockRepository(mrel));
View Full Code Here


  /**
   * 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);
View Full Code Here

  /**
   * 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);
View Full Code Here

  /**
   * 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());
View Full Code Here

public class MockJcrSessionTest extends TestCase {

  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());
View Full Code Here

    testAccess(session, "bill", "doc4", true);
  }

  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);
View Full Code Here

   * Sanity test
   * @throws RepositoryException
   */
  public void testSimpleIterator() throws RepositoryException {
    MockRepositoryDocumentStore mrd = new MockRepositoryDocumentStore();
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog1.txt");
    for (MockRepositoryEvent event : mrel.getEventList()) {
      mrd.applyEvent(event);
    }

    // create an node iterator over the entire store
    NodeIterator ni = new MockJcrNodeIterator(mrd.iterator());
View Full Code Here

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

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

View Full Code Here

      }
    }
  }

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

    QueryManager qm = new MockJcrQueryManager(r.getStore());
View Full Code Here

public class JcrAuthenticationManagerTest extends TestCase {

  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 =
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.mock.MockRepositoryEventList

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.