}
// First, get an ordinary traversal manager, start it,
// and see what the first doc is that it returns.
// Verify that this date is before our sanctioned startDate
Session sess = conn.login();
TraversalManager tm = sess.getTraversalManager();
Document doc = getFirstResult(tm);
assertNotNull("First doc is null.", doc);
String dateStr = doc.findProperty("ModifyDate").nextValue().toString();
try {
Date docDate = parseDate(dateStr);
assertTrue("First doc is newer than startDate.",
docDate.before(startDate));
}
catch (ParseException e) {
fail("Unable to parse document modified date: " + dateStr);
}
// Now, get another traversal manager, with a connector
// with an appropriate start date(SD). Traverse the
// repository and ensure that nothing older than the
// start date is returned.
LivelinkConnector connSD =
LivelinkConnectorFactory.getConnector("connector.");
connSD.setStartDate(startDateString);
Session sessSD = connSD.login();
TraversalManager tmSD = sessSD.getTraversalManager();
// Look for any results that are too old
LivelinkDocumentList results =
(LivelinkDocumentList) tmSD.startTraversal();
while (results != null) {