Package com.google.enterprise.connector.mock

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


    Document document = new JcrDocument(node);
    return document;
  }

  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


    assertNull(document.findProperty(
        SpiConstants.GROUP_ROLES_PROPNAME_PREFIX + "root"));
  }

  private Document extractJcrDocument(String eventLog, String docid) {
    MockRepositoryEventList mrel = new MockRepositoryEventList(eventLog);
    MockRepository r = new MockRepository(mrel);
    MockRepositoryDocument doc = r.getStore().getDocByID(docid);
    Node node = new MockJcrNode(doc);
    return new JcrDocument(node);
  }
View Full Code Here

import javax.jcr.query.QueryManager;

public class MockPusherTest extends TestCase {
  public void testSimple() throws Exception {
    MockRepositoryEventList mrel = new MockRepositoryEventList(
        "MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);
    QueryManager qm = new MockJcrQueryManager(r.getStore());
    TraversalManager qtm = new JcrTraversalManager(qm);
    MockPusher pusher = new MockPusher(System.out);
View Full Code Here

  private void runTestBatches(int batchHint) {
    try {
      // Reset traversal state from previous tests.
      stateStore.storeTraversalState(null);

      MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog1.txt");
      Traverser traverser = createTraverser(mrel);

      System.out.println();
      BatchSize batchSize = new BatchSize(batchHint);
      System.out.println("Running batch test batchsize " + batchHint);
View Full Code Here

      makeLargeFile("testdata/tmp/largefile.txt");
    } catch (IOException e) {
      fail("Unable to initialize largefile.txt: " + e.toString());
    }
    try {
      MockRepositoryEventList mrel =
          new MockRepositoryEventList("MockRepositoryEventLogLargeFile.txt");
      Traverser traverser = createTraverser(mrel);
      int docsProcessed = 0;
      BatchSize batchSize = new BatchSize(1);
      do {
        docsProcessed = traverser.runBatch(batchSize).getCountProcessed();
View Full Code Here

  /**
   * Creates a {@link JcrConnector} with a backing {@link MockRepository} and
   * registers the created connector with this {@link Instantiator}.
   */
  public void setupConnector(String connectorName, String resourceName) {
    MockRepositoryEventList mrel = new MockRepositoryEventList(resourceName);
    MockRepository mockRepository = new MockRepository(mrel);
    Repository repository = new MockJcrRepository(mockRepository);
    Connector connector = new JcrConnector(repository);
    addConnector(connectorName, connector);
  }
View Full Code Here

public class JcrAuthorizationManagerTest extends TestCase {

  public final void testAuthorizeDocids()
      throws 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);
    AuthorizationManager authorizationManager =
View Full Code Here

    }
  }

  public final void testAuthorizeNewFormat()
      throws RepositoryException, LoginException {
    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);
    AuthorizationManager authorizationManager =
View Full Code Here

   */
  public void testCheckpoint() throws RepositoryException, JSONException {
    // We're comparing date strings here, so we need a fixed time zone.
    Value.setFeedTimeZone("GMT");

    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);
    MockRepositoryDocument mockDoc = r.getStore().getDocByID("doc1");
    Document doc = new JcrDocument(new MockJcrNode(mockDoc));
    String checkpointString = JcrDocumentList.checkpoint(doc);
    logger.info(checkpointString);
View Full Code Here

    String id = qtm.extractDocidFromCheckpoint(jo, checkpointString);
    Assert.assertEquals(id, "doc1");
  }

  public void testResumeTraversal() throws RepositoryException {
    MockRepositoryEventList mrel =
        new MockRepositoryEventList("MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);
    QueryManager qm = new MockJcrQueryManager(r.getStore());
    TraversalManager qtm = new JcrTraversalManager(qm);

    {
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.