Package com.google.enterprise.connector.spi

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


    testUserProfiles(docList);
  }

  @Test
  public void testResumeTraversal_whole() throws RepositoryException {
    TraversalManager trav = session.getTraversalManager();
    trav.setBatchHint(500);
    DocumentList docList = trav.resumeTraversal(
        SharepointSocialUserProfileDocumentList.CHECKPOINT_PREFIX);
    testUserProfiles(docList);
  }
View Full Code Here


    testUserProfiles(docList);
  }

  @Test
  public void testResumeTraversal_partial() throws RepositoryException {
    TraversalManager trav = session.getTraversalManager();
    trav.setBatchHint(500);
    int halfSize = EXPECTED_NAMES.size() / 2;
    int halfway = new MockUserProfileGenerator().getNextValue(halfSize);
    String checkpoint =
        CHECKPOINT_PREFIX + "{" + "\"userProfileNextIndex\":" + halfway + "}";
    DocumentList docList = trav.resumeTraversal(checkpoint);
    ArrayList<String> names = new ArrayList<String>();
    testUserProfiles(docList, names);
    assertEquals(EXPECTED_NAMES.subList(halfSize + 1, EXPECTED_NAMES.size()),
        names);
  }
View Full Code Here

        names);
  }

  @Test
  public void testMultipleBatches() throws RepositoryException, JSONException {
    TraversalManager trav = session.getTraversalManager();
    ArrayList<String> names = new ArrayList<String>();

    int halfSize = EXPECTED_NAMES.size() / 2;
    trav.setBatchHint(halfSize);
    DocumentList docList = trav.startTraversal();
    testUserProfiles(docList, names);
    assertEquals(EXPECTED_NAMES.subList(0, halfSize), names);

    String checkpoint = docList.checkpoint();
    JSONObject jo = new
        JSONObject(checkpoint.substring(CHECKPOINT_PREFIX.length()));
    assertTrue(jo.has("userProfileChangeToken"));
    assertTrue(jo.has("userProfileLastFullSync"));
    assertTrue(jo.has("userProfileNextIndex"));
    trav.setBatchHint(500);
    docList = trav.resumeTraversal(checkpoint);
    testUserProfiles(docList, names);
    assertEquals(EXPECTED_NAMES, names);
  }
View Full Code Here

    assertEquals(EXPECTED_NAMES, names);
  }

  @Test
  public void testResumeTraversal_nonsocial() throws RepositoryException {
    TraversalManager trav = sessionNonSocial.getTraversalManager();
    trav.setBatchHint(500);
    DocumentList docList = trav.resumeTraversal(
        SharepointSocialUserProfileDocumentList.CHECKPOINT_PREFIX);
    // We expect no results here because the social option is ONLY.
    assertNull(docList);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.TraversalManager

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.