assertEquals("Unexpected number of messages received", expectedMessages, receivedCount.get());
assertEquals("onException should NOT have been called", 0, countingExceptionListener.getErrorCount());
// Check that Error has been written to the application log.
LogMonitor _monitor = new LogMonitor(_outputFile);
assertTrue("The expected message not written to log file.",
_monitor.waitForMessage(javaLangErrorMessageText, LOGMONITOR_TIMEOUT));
if (_consumerConnection != null)
{
try
{