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

        //this would take place in the mission program manager's script initialization process if initialization fails
        program.changeStatus(ProgramStatus.INITIALIZATION_ERROR);

        try
        {
            program.execute();
            fail("Expecting exception because the script failed initialization.");
        }
        catch (IllegalStateException e)
        {
            //expected exception
        }

        //verify the call to the MissionProgramManager
        verify(m_Manager, never()).executeProgram(program);

        //check that the flag has NOT changed
        assertThat(program.getProgramStatus(), is(ProgramStatus.INITIALIZATION_ERROR));
    }
/**
     * Test that if the mission is in a initialization error state that the program cannot execute.
     */
Test that if the mission is in a initialization error state that the program cannot execute.
Test that if the mission is in a initialization error state that the program cannot execute .
@Test
    public void testProgramStatusIllegalState() throws MissionProgramException
    {
        ProgramImpl program = createProgram("test");
        program.changeStatus(ProgramStatus.INITIALIZATION_ERROR);
        try
        {
            program.execute();
            fail("Expecting exception because the script failed initialization.");
        }
        catch (IllegalStateException e)
        {
        }
        verify(m_Manager, never()).executeProgram(program);
        assertThat(program.getProgramStatus(), is(ProgramStatus.INITIALIZATION_ERROR));
    }
@ Test public void testProgramStatusIllegalState ( ) throws MissionProgramException { ProgramImpl program = createProgram ( "test" ) ; program . changeStatus ( ProgramStatus . INITIALIZATION_ERROR ) ; try { program . execute ( ) ; fail ( "Expecting exception because the script failed initialization." ) ; } catch ( IllegalStateException e ) { } verify ( m_Manager , never ( ) ) . executeProgram ( program ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . INITIALIZATION_ERROR ) ) ; }
Test that if the mission is in a initialization error state that the program cannot execute.
Test that if the mission is in a initialization error state that the program cannot execute .
//this would take place in the mission program manager's script initialization process if initialization fails //expected exception //verify the call to the MissionProgramManager //check that the flag has NOT changed