Package com.google.enterprise.connector.mock.jcr

Examples of com.google.enterprise.connector.mock.jcr.MockJcrNode


      jo = new JSONObject(jsonString);
    } catch (JSONException e) {
      throw new IllegalArgumentException("test input can not be parsed");
    }
    MockRepositoryDocument mockDocument = new MockRepositoryDocument(jo);
    MockJcrNode node = new MockJcrNode(mockDocument);
    Document document = new JcrDocument(node);
    return document;
  }
View Full Code Here


  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

  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

    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);

    JSONObject jo = new JSONObject(checkpointString);
View Full Code Here

    QueryManager qm = new MockJcrQueryManager(r.getStore());
    TraversalManager qtm = new JcrTraversalManager(qm);

    {
      MockRepositoryDocument mockDoc = r.getStore().getDocByID("doc2");
      Document doc = new JcrDocument(new MockJcrNode(mockDoc));
      String checkpointString = JcrDocumentList.checkpoint(doc);
      DocumentList documentList = qtm.resumeTraversal(checkpointString);
      int counter = countDocuments(documentList);
      Assert.assertEquals(2, counter);
    }

    {
      MockRepositoryDocument mockDoc = r.getStore().getDocByID("doc4");
      Document doc = new JcrDocument(new MockJcrNode(mockDoc));
      String checkpointString = JcrDocumentList.checkpoint(doc);
      DocumentList documentList = qtm.resumeTraversal(checkpointString);
      int counter = countDocuments(documentList);
      Assert.assertEquals(0, counter);
    }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.mock.jcr.MockJcrNode

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.