mil.dod.th.ose.integration/src/mil/dod/th/ose/controller/integration/core/TestMissionProgramManager.java
@Test
    public void testSimpleScript() throws IllegalArgumentException, MissionProgramException, IOException,
        PersistenceFailedException, InterruptedException
    {
        //verify that the template was loaded
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("simple-template"));
        //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("TestSimpleTest1");
        
        Program program = m_MissionProgramManager.loadParameters(params);
        EventHandlerSyncer syncer = new EventHandlerSyncer(Program.TOPIC_PROGRAM_EXECUTED, 
                String.format("(%s=%s)", Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleTest1"));
        
        program.execute();
        
        syncer.waitForEvent(10);
        //verify that the parameters were loaded successfully and created a valid Mission program that executed 
        //successfully
        assertThat(program.getProgramStatus(), is(ProgramStatus.EXECUTED));
    }
/**
     * This tests that a simple script can execute, and utilize primitive arguments as execution parameters.
     * Re-tested {@link TestPersistedMissionPrograms#testSimpleScript()}.
     */
This tests that a simple script can execute, and utilize primitive arguments as execution parameters.
This tests that a simple script can execute and utilize primitive arguments as execution parameters .
@Test
    public void testSimpleScript() throws IllegalArgumentException, MissionProgramException, IOException,
        PersistenceFailedException, InterruptedException
    {
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("simple-template"));
        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("TestSimpleTest1");
        Program program = m_MissionProgramManager.loadParameters(params);
        EventHandlerSyncer syncer = new EventHandlerSyncer(Program.TOPIC_PROGRAM_EXECUTED, 
                String.format("(%s=%s)", Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleTest1"));
        program.execute();
        syncer.waitForEvent(10);
        assertThat(program.getProgramStatus(), is(ProgramStatus.EXECUTED));
    }
@ Test public void testSimpleScript ( ) throws IllegalArgumentException , MissionProgramException , IOException , PersistenceFailedException , InterruptedException { assertThat ( m_TemplateProgramManager . getMissionTemplateNames ( ) , hasItem ( "simple-template" ) ) ; 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 ( "TestSimpleTest1" ) ; Program program = m_MissionProgramManager . loadParameters ( params ) ; EventHandlerSyncer syncer = new EventHandlerSyncer ( Program . TOPIC_PROGRAM_EXECUTED , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleTest1" ) ) ; program . execute ( ) ; syncer . waitForEvent ( 10 ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . EXECUTED ) ) ; }
This tests that a simple script can execute, and utilize primitive arguments as execution parameters.
This tests that a simple script can execute and utilize primitive arguments as execution parameters .
//verify that the template was loaded //create parameters //verify that the parameters were loaded successfully and created a valid Mission program that executed  //successfully