Package com.google.enterprise.connector.spi

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


    MockRepositoryEventList mrel =
      new MockRepositoryEventList("MockRepositoryEventLog1.txt");
    MockRepository r = new MockRepository(mrel);
    javax.jcr.Repository jcrRepo = new MockJcrRepository(r);
    Connector repo = new JcrConnector(jcrRepo);
    Session session = repo.login();
    TraversalManager qtm = session.getTraversalManager();
    QueryTraversalUtil.runTraversal(qtm, 2);
  }
View Full Code Here


      con.setHostname(TestConfiguration.d1hostname);
      con.setPort(Integer.toString(TestConfiguration.d1port));
      con.setPrincipal(TestConfiguration.d1principal);
      con.setPassword(TestConfiguration.d1password);
      con.setDataSource(dbType, TestConfiguration.dbs.get(dbType));
      Session s = con.login();
      TraversalManager out = s.getTraversalManager();

      DocumentList result = out.startTraversal();
      assertNull(result.nextDocument());
      assertEquals(AdConstants.CHECKPOINT_VALUE, result.checkpoint());
View Full Code Here

    assertFalse(excluded, excluded.contains("and SubType not in"));
    assertFalse(excluded, excluded.contains("and not"));
  }

  public void testGetLastAuditEvent() throws RepositoryException {
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();

    ClientValue results = ltm.getLastAuditEvent();
    assertEquals(1, results.size());
    // toLong works with H2 (we check the type in the production code).
    assertEquals(10042L, results.toLong(0, "EventID"));
View Full Code Here

   * @param checkpointDate the supposed starting point for the batch
   */
  private void checkCandidatesTimeWarp(Date firstCandidateDate,
      int firstCandidateId, Date lastCandidateDate, int lastCandidateId,
      String checkpoint) throws RepositoryException {
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();
    ClientValue candidates = new MockClientValue(
        new String[] { "ModifyDate", "DataID" },
        new Object[][] { { firstCandidateDate, firstCandidateId },
                         { lastCandidateDate, lastCandidateId } });
    ltm.checkCandidatesTimeWarp(candidates, new Checkpoint(checkpoint));
View Full Code Here

    checkCandidatesTimeWarp(first, 0, last, 0, "2014-01-01 00:00:00,0");
  }

  /** Calls the like-named method under test. */
  private String getMatchingQuery() throws RepositoryException {
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();
    return ltm.getMatchingQuery(null, new Date(), false);
  }
View Full Code Here

        assertNotNull(selectExpressions);
        int size = (map == null) ? 0 : map.size();
        assertEquals(selectExpressions.toString(),
            size, selectExpressions.size());

        Session sess = conn.login();
        LivelinkTraversalManager ltm =
            (LivelinkTraversalManager) sess.getTraversalManager();

        Field[] fields = ltm.getFields();
        assertEquals(LivelinkTraversalManager.DEFAULT_FIELDS.length + size,
            fields.length);
        String expected =
View Full Code Here

      throws RepositoryException {
    // GoogleDataSize is the non-negative alias of DataSize that is
    // selected in the WebNodes query.
    conn.setIncludedSelectExpressions(
        ImmutableMap.of("MyDataSize", "GoogleDataSize"));
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();
    DocumentList list = ltm.startTraversal();
    assertNotNull(list.nextDocument());
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals("1729", Value.getSingleValueString(doc, "MyDataSize"));
View Full Code Here

    assertNotNull(doc);
    assertEquals("1729", Value.getSingleValueString(doc, "MyDataSize"));
  }

  public void testGetResults() throws RepositoryException {
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();

    // Not sure why, but 6 and 2000 are not in the WebNodes data.
    // 2901 is, but it's an excluded volume type.
    ClientValue results = ltm.getResults("6,24,42,2000,2901", new Date());
    assertEquals(2, results.size());
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.