mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestMissionProgramming.java
@Test
    public void testSimpleStatusChange() 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("TestSimpleStatusTest");
        
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_EXECUTED, 
                String.format("(%s=%s)",
                        Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleStatusTest"));
        
        Program program = m_MissionProgramManager.loadParameters(params);
        program.execute();
        
        syncer.waitForEvent(5);

        syncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_SHUTDOWN, String.format("(%s=%s)",
                Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleStatusTest"));
        
        //shutdown
        program.executeShutdown();
        
        //waiting... have to wait for events so we can remove the program
        syncer.waitForEvent(5);

        //cleanup
        program.remove();
    }
/**
     * Tests that a status changed event is thrown as part of a simple script's execution. 
     */
Tests that a status changed event is thrown as part of a simple script's execution.
Tests that a status changed event is thrown as part of a simple script ' s execution .
@Test
    public void testSimpleStatusChange() 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("TestSimpleStatusTest");
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_EXECUTED, 
                String.format("(%s=%s)",
                        Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleStatusTest"));
        Program program = m_MissionProgramManager.loadParameters(params);
        program.execute();
        syncer.waitForEvent(5);
        syncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_SHUTDOWN, String.format("(%s=%s)",
                Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleStatusTest"));
        program.executeShutdown();
        syncer.waitForEvent(5);
        program.remove();
    }
@ Test public void testSimpleStatusChange ( ) 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 ( "TestSimpleStatusTest" ) ; EventHandlerSyncer syncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_EXECUTED , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleStatusTest" ) ) ; Program program = m_MissionProgramManager . loadParameters ( params ) ; program . execute ( ) ; syncer . waitForEvent ( 5 ) ; syncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_SHUTDOWN , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleStatusTest" ) ) ; program . executeShutdown ( ) ; syncer . waitForEvent ( 5 ) ; program . remove ( ) ; }
Tests that a status changed event is thrown as part of a simple script's execution.
Tests that a status changed event is thrown as part of a simple script ' s execution .
//create parameters //shutdown //waiting... have to wait for events so we can remove the program //cleanup