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

        //work through legal state changes
        program.changeStatus(ProgramStatus.UNSATISFIED);
        program.changeStatus(ProgramStatus.WAITING_UNINITIALIZED);
        program.changeStatus(ProgramStatus.WAITING_INITIALIZED);
        program.changeStatus(ProgramStatus.EXECUTING);
        
        try
        {
            program.changeStatus(ProgramStatus.SHUTTING_DOWN);
            fail("Expecting exception because the script should not go from executing to shutting down.");
        }
        catch (IllegalStateException e)
        {
            //expected exception, because the script had unsatisfied dependencies it should not execute.
        }
    }
/**
     * Tests that a mission status cannot be changed from executing to shutting down.
     * Verify exception.
     */
Tests that a mission status cannot be changed from executing to shutting down.
Verify exception.
Tests that a mission status cannot be changed from executing to shutting down . Verify exception .
@Test
    public void testProgramStatusChangeIllegalShuttingDown() throws MissionProgramException
    {
        ProgramImpl program = createProgram("name");
        program.changeStatus(ProgramStatus.UNSATISFIED);
        program.changeStatus(ProgramStatus.WAITING_UNINITIALIZED);
        program.changeStatus(ProgramStatus.WAITING_INITIALIZED);
        program.changeStatus(ProgramStatus.EXECUTING);
        try
        {
            program.changeStatus(ProgramStatus.SHUTTING_DOWN);
            fail("Expecting exception because the script should not go from executing to shutting down.");
        }
        catch (IllegalStateException e)
        {
        }
    }
@ Test public void testProgramStatusChangeIllegalShuttingDown ( ) throws MissionProgramException { ProgramImpl program = createProgram ( "name" ) ; program . changeStatus ( ProgramStatus . UNSATISFIED ) ; program . changeStatus ( ProgramStatus . WAITING_UNINITIALIZED ) ; program . changeStatus ( ProgramStatus . WAITING_INITIALIZED ) ; program . changeStatus ( ProgramStatus . EXECUTING ) ; try { program . changeStatus ( ProgramStatus . SHUTTING_DOWN ) ; fail ( "Expecting exception because the script should not go from executing to shutting down." ) ; } catch ( IllegalStateException e ) { } }
Tests that a mission status cannot be changed from executing to shutting down.
Tests that a mission status cannot be changed from executing to shutting down .
//work through legal state changes //expected exception, because the script had unsatisfied dependencies it should not execute.