mil.dod.th.ose.shared/test/mil/dod/th/ose/shared/TestExceptionUtil.java
@Test
    public void testHandleExecutorExceptionNullException() throws InterruptedException, ExecutionException
    {
        final LoggingService log = LoggingServiceMocker.createMock();
        final Future<?> future = mock(Future.class, withSettings().extraInterfaces(Runnable.class));
        final CancellationException canEx = new CancellationException("CANCELLED!");
        when(future.get()).thenThrow(canEx);
        when(future.isDone()).thenReturn(true);
        
        ExceptionUtil.handleExecutorExceptions(log, (Runnable)future, null);
        verify(log).error(canEx, "Executor threw an exception");
    }
/**
     * Verify the handle executor exception method appropriately logs if an exception is thrown by the future passed
     * to it.
     */
Verify the handle executor exception method appropriately logs if an exception is thrown by the future passed
to it.
Verify the handle executor exception method appropriately logs if an exception is thrown by the future passed to it .
@Test
    public void testHandleExecutorExceptionNullException() throws InterruptedException, ExecutionException
    {
        final LoggingService log = LoggingServiceMocker.createMock();
        final Future<?> future = mock(Future.class, withSettings().extraInterfaces(Runnable.class));
        final CancellationException canEx = new CancellationException("CANCELLED!");
        when(future.get()).thenThrow(canEx);
        when(future.isDone()).thenReturn(true);
        ExceptionUtil.handleExecutorExceptions(log, (Runnable)future, null);
        verify(log).error(canEx, "Executor threw an exception");
    }
@ Test public void testHandleExecutorExceptionNullException ( ) throws InterruptedException , ExecutionException { final LoggingService log = LoggingServiceMocker . createMock ( ) ; final Future < ? > future = mock ( Future . class , withSettings ( ) . extraInterfaces ( Runnable . class ) ) ; final CancellationException canEx = new CancellationException ( "CANCELLED!" ) ; when ( future . get ( ) ) . thenThrow ( canEx ) ; when ( future . isDone ( ) ) . thenReturn ( true ) ; ExceptionUtil . handleExecutorExceptions ( log , ( Runnable ) future , null ) ; verify ( log ) . error ( canEx , "Executor threw an exception" ) ; }
Verify the handle executor exception method appropriately logs if an exception is thrown by the future passed
 to it.
Verify the handle executor exception method appropriately logs if an exception is thrown by the future passed to it .