IndexingDumpCompletionListener idcl = new IndexingDumpCompletionListener(this.lsi,docs);
idcl.start();
this.lsi.startDump(idcl);
idcl.waitUntilCompleted();
assertEquals("Checkpoint made it to the index", 0, lsi.findMatches(new Query(new TermQuery("documentId","checkpoint_doc"),null,null),1, 1).getTotalMatches());
assertEquals("First doc didn't make it to the index", 1, lsi.findMatches(new Query(new TermQuery("documentId","first_doc"),null,null),1, 1).getTotalMatches());
// TODO test there is only one thing on the index.
this.lsi.startDump(new DummyDumpCompletionListener());
assertEquals("Checkpoint didn't make it to the index", 1, lsi.findMatches(new Query(new TermQuery("documentId","checkpoint_doc"),null,null),1, 1).getTotalMatches());
assertEquals("First doc didn't make it to the index", 1, lsi.findMatches(new Query(new TermQuery("documentId","first_doc"),null,null),1, 1).getTotalMatches());
// TODO test that there are limit + 2 documents on the index
}