CollectionProcessingEngine cpe = setupCpm(documentCount, "ResourceProcessException",
exceptionSequence, "processCas");
// Create and register a Status Callback Listener
TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
cpe.addStatusCallbackListener(listener);
cpeProcessNoMsg(cpe, listener);
// check the results, if everything worked as expected
ManageOutputDevice.setAllSystemOutputToDefault();
assertEquals("The cpm did not call the listener, that the cpm has finished.", true, listener
.isFinished());