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

        program.changeStatus(ProgramStatus.WAITING_UNINITIALIZED);
        program.changeStatus(ProgramStatus.WAITING_INITIALIZED);
        
        @SuppressWarnings("unchecked")
        Future<TestResult> result = mock(Future.class);
        doThrow(new ExecutionException(new ScriptException("Wheeew I am exhausted!"))).
            when(result).get();

        //return value from mission program manager
        when(m_Manager.testProgram(program)).thenReturn(result);
        Future<TestResult> endResult = program.executeTest();
        
        try
        {
            endResult.get();
            fail("Expected exception");
        }
        catch (ExecutionException e)
        {
            //expected exception
        }
    }
/**
     * Test that test executed exceptions are properly handled.
     * 
     * Verify Mission program exception.
     */
Test that test executed exceptions are properly handled.

Verify Mission program exception.
Test that test executed exceptions are properly handled . Verify Mission program exception .
@Test
    public void testTestExecuteException() throws MissionProgramException, InterruptedException, ExecutionException
    {
        ProgramImpl program = createProgram("test");
        program.changeStatus(ProgramStatus.WAITING_UNINITIALIZED);
        program.changeStatus(ProgramStatus.WAITING_INITIALIZED);
        @SuppressWarnings("unchecked")
        Future<TestResult> result = mock(Future.class);
        doThrow(new ExecutionException(new ScriptException("Wheeew I am exhausted!"))).
            when(result).get();
        when(m_Manager.testProgram(program)).thenReturn(result);
        Future<TestResult> endResult = program.executeTest();
        try
        {
            endResult.get();
            fail("Expected exception");
        }
        catch (ExecutionException e)
        {
        }
    }
@ Test public void testTestExecuteException ( ) throws MissionProgramException , InterruptedException , ExecutionException { ProgramImpl program = createProgram ( "test" ) ; program . changeStatus ( ProgramStatus . WAITING_UNINITIALIZED ) ; program . changeStatus ( ProgramStatus . WAITING_INITIALIZED ) ; @ SuppressWarnings ( "unchecked" ) Future < TestResult > result = mock ( Future . class ) ; doThrow ( new ExecutionException ( new ScriptException ( "Wheeew I am exhausted!" ) ) ) . when ( result ) . get ( ) ; when ( m_Manager . testProgram ( program ) ) . thenReturn ( result ) ; Future < TestResult > endResult = program . executeTest ( ) ; try { endResult . get ( ) ; fail ( "Expected exception" ) ; } catch ( ExecutionException e ) { } }
Test that test executed exceptions are properly handled.
Test that test executed exceptions are properly handled .
//return value from mission program manager //expected exception