mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestMissionProgramming.java
@Test
    public void testShutdown() throws Exception
    {
        //create parameters
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false).
            withImmediately(false).withActive(true).withAtReset(false);
        MissionProgramParameters params = new MissionProgramParameters().withTemplateName("simple-template").
            withSchedule(schedule).withParameters(new MapEntry("a", 5)).withProgramName("TestSimpleShutdown");
        
        Program program = m_MissionProgramManager.loadParameters(params);
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_EXECUTED, 
                String.format("(%s=%s)", Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleShutdown"));
        
        program.execute();
        
        //verify that the parameters were loaded successfully and created a valid Mission program that executed 
        //successfully
        syncer.waitForEvent(5);
        
        syncer = new EventHandlerSyncer(m_Context, 
                Program.TOPIC_PROGRAM_SHUTDOWN, String.format("(%s=%s)",
                        Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleShutdown"));
        
        program.executeShutdown();

        syncer.waitForEvent(5);
        
        assertThat(program.getProgramStatus(), is(ProgramStatus.SHUTDOWN));
    }
/**
     * Tests the execution of the shutdown method in a simple script.
     */
Tests the execution of the shutdown method in a simple script.
Tests the execution of the shutdown method in a simple script .
@Test
    public void testShutdown() throws Exception
    {
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false).
            withImmediately(false).withActive(true).withAtReset(false);
        MissionProgramParameters params = new MissionProgramParameters().withTemplateName("simple-template").
            withSchedule(schedule).withParameters(new MapEntry("a", 5)).withProgramName("TestSimpleShutdown");
        Program program = m_MissionProgramManager.loadParameters(params);
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_EXECUTED, 
                String.format("(%s=%s)", Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleShutdown"));
        program.execute();
        syncer.waitForEvent(5);
        syncer = new EventHandlerSyncer(m_Context, 
                Program.TOPIC_PROGRAM_SHUTDOWN, String.format("(%s=%s)",
                        Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleShutdown"));
        program.executeShutdown();
        syncer.waitForEvent(5);
        assertThat(program.getProgramStatus(), is(ProgramStatus.SHUTDOWN));
    }
@ Test public void testShutdown ( ) throws Exception { MissionProgramSchedule schedule = new MissionProgramSchedule ( ) . withIndefiniteInterval ( false ) . withImmediately ( false ) . withActive ( true ) . withAtReset ( false ) ; MissionProgramParameters params = new MissionProgramParameters ( ) . withTemplateName ( "simple-template" ) . withSchedule ( schedule ) . withParameters ( new MapEntry ( "a" , 5 ) ) . withProgramName ( "TestSimpleShutdown" ) ; Program program = m_MissionProgramManager . loadParameters ( params ) ; EventHandlerSyncer syncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_EXECUTED , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleShutdown" ) ) ; program . execute ( ) ; syncer . waitForEvent ( 5 ) ; syncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_SHUTDOWN , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleShutdown" ) ) ; program . executeShutdown ( ) ; syncer . waitForEvent ( 5 ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . SHUTDOWN ) ) ; }
Tests the execution of the shutdown method in a simple script.
Tests the execution of the shutdown method in a simple script .
//create parameters //verify that the parameters were loaded successfully and created a valid Mission program that executed  //successfully