@Test
public void testExceptionReporting() throws InterruptedException {

	final AtomicBoolean exceptionWasThrown = new AtomicBoolean(false);
	final OneShotLatch latch = new OneShotLatch();
	final Object lock = new Object();
	ProcessingTimeService timeServiceProvider = new SystemProcessingTimeService(
			new AsyncExceptionHandler() {
				@Override
				public void handleAsyncException(String message, Throwable exception) {
					exceptionWasThrown.set(true);
					latch.trigger();
				}
			}, lock);
	timeServiceProvider.registerTimer(System.currentTimeMillis(), new ProcessingTimeCallback() {
		@Override
		public void onProcessingTime(long timestamp) throws Exception {
			throw new Exception("Exception in Timer");
		}
	});
	latch.await();
	assertTrue(exceptionWasThrown.get());
}