mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestProgramImpl.java
@Test
    public void testTestExecuteWithExceptionNonBlock() throws MissionProgramException, InterruptedException, 
           ExecutionException
    {
        //mission information
        ProgramImpl program = createProgram("test");

        program.changeStatus(ProgramStatus.WAITING_UNINITIALIZED);
        program.changeStatus(ProgramStatus.WAITING_INITIALIZED);

        Future<?> result = mock(Future.class);
        when(result.get()).thenThrow(new ExecutionException(
                new PrivilegedActionException(
                    new ScriptException("Wheeew I am exhausted!")).getCause()));

        //return value from mission program manager
        doReturn(result).when(m_Manager).testProgram(program);
        
        //try to execute
        Future<?> execFuture = program.executeTest();
        
        //expected and documented behavior
        assertThat(execFuture, is(notNullValue()));
    }
/**
     * Test that the program requested to test execute non blocking will not throw an exception as expected.
     * In these scenarios one must listen for the event posted elsewhere that test execution was unsuccessful.
     * 
     * Verify null is returned.
     * 
     */
Test that the program requested to test execute non blocking will not throw an exception as expected.
In these scenarios one must listen for the event posted elsewhere that test execution was unsuccessful.

Verify null is returned.
Test that the program requested to test execute non blocking will not throw an exception as expected . In these scenarios one must listen for the event posted elsewhere that test execution was unsuccessful . Verify null is returned .
@Test
    public void testTestExecuteWithExceptionNonBlock() throws MissionProgramException, InterruptedException, 
           ExecutionException
    {
        ProgramImpl program = createProgram("test");
        program.changeStatus(ProgramStatus.WAITING_UNINITIALIZED);
        program.changeStatus(ProgramStatus.WAITING_INITIALIZED);
        Future<?> result = mock(Future.class);
        when(result.get()).thenThrow(new ExecutionException(
                new PrivilegedActionException(
                    new ScriptException("Wheeew I am exhausted!")).getCause()));
        doReturn(result).when(m_Manager).testProgram(program);
        Future<?> execFuture = program.executeTest();
        assertThat(execFuture, is(notNullValue()));
    }
@ Test public void testTestExecuteWithExceptionNonBlock ( ) throws MissionProgramException , InterruptedException , ExecutionException { ProgramImpl program = createProgram ( "test" ) ; program . changeStatus ( ProgramStatus . WAITING_UNINITIALIZED ) ; program . changeStatus ( ProgramStatus . WAITING_INITIALIZED ) ; Future < ? > result = mock ( Future . class ) ; when ( result . get ( ) ) . thenThrow ( new ExecutionException ( new PrivilegedActionException ( new ScriptException ( "Wheeew I am exhausted!" ) ) . getCause ( ) ) ) ; doReturn ( result ) . when ( m_Manager ) . testProgram ( program ) ; Future < ? > execFuture = program . executeTest ( ) ; assertThat ( execFuture , is ( notNullValue ( ) ) ) ; }
Test that the program requested to test execute non blocking will not throw an exception as expected.
Test that the program requested to test execute non blocking will not throw an exception as expected .
//mission information //return value from mission program manager //try to execute //expected and documented behavior