mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestMissionProgramming.java
@Test
    public void testSimpleScriptSchedule() throws IllegalArgumentException, MissionProgramException, IOException,
        PersistenceFailedException, InterruptedException
    {
        //create parameters
        MissionProgramSchedule schedule = new MissionProgramSchedule(true, false, null, 
            System.currentTimeMillis() + 500L, null, System.currentTimeMillis() + 1000L);
        MissionProgramParameters params = new MissionProgramParameters().withTemplateName("simple-template").
            withSchedule(schedule).withParameters(new MapEntry("a", 99)).withProgramName("TestSimpleTestSchedule");

        EventHandlerSyncer executionSyncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_EXECUTED, 
                        String.format("(%s=%s)", 
                                Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleTestSchedule"));
        EventHandlerSyncer shutdownSyncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_STATUS_CHANGED,
                        String.format("(&(%s=%s)(%s=%s))", 
                                Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleTestSchedule",
                                Program.EVENT_PROP_PROGRAM_STATUS, ProgramStatus.SHUTDOWN.toString()));

        Program program = m_MissionProgramManager.loadParameters(params);

        executionSyncer.waitForEvent(5);
        shutdownSyncer.waitForEvent(20);

        program.remove();
    }
/**
     * This tests that a simple script can execute with a schedule.
     * Verify that the program executes.
     * Verify that execution is complete before shutdown is initialized.
     */
This tests that a simple script can execute with a schedule.
Verify that the program executes.
Verify that execution is complete before shutdown is initialized.
This tests that a simple script can execute with a schedule . Verify that the program executes . Verify that execution is complete before shutdown is initialized .
@Test
    public void testSimpleScriptSchedule() throws IllegalArgumentException, MissionProgramException, IOException,
        PersistenceFailedException, InterruptedException
    {
        MissionProgramSchedule schedule = new MissionProgramSchedule(true, false, null, 
            System.currentTimeMillis() + 500L, null, System.currentTimeMillis() + 1000L);
        MissionProgramParameters params = new MissionProgramParameters().withTemplateName("simple-template").
            withSchedule(schedule).withParameters(new MapEntry("a", 99)).withProgramName("TestSimpleTestSchedule");
        EventHandlerSyncer executionSyncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_EXECUTED, 
                        String.format("(%s=%s)", 
                                Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleTestSchedule"));
        EventHandlerSyncer shutdownSyncer = new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_STATUS_CHANGED,
                        String.format("(&(%s=%s)(%s=%s))", 
                                Program.EVENT_PROP_PROGRAM_NAME, "TestSimpleTestSchedule",
                                Program.EVENT_PROP_PROGRAM_STATUS, ProgramStatus.SHUTDOWN.toString()));
        Program program = m_MissionProgramManager.loadParameters(params);
        executionSyncer.waitForEvent(5);
        shutdownSyncer.waitForEvent(20);
        program.remove();
    }
@ Test public void testSimpleScriptSchedule ( ) throws IllegalArgumentException , MissionProgramException , IOException , PersistenceFailedException , InterruptedException { MissionProgramSchedule schedule = new MissionProgramSchedule ( true , false , null , System . currentTimeMillis ( ) + 500L , null , System . currentTimeMillis ( ) + 1000L ) ; MissionProgramParameters params = new MissionProgramParameters ( ) . withTemplateName ( "simple-template" ) . withSchedule ( schedule ) . withParameters ( new MapEntry ( "a" , 99 ) ) . withProgramName ( "TestSimpleTestSchedule" ) ; EventHandlerSyncer executionSyncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_EXECUTED , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleTestSchedule" ) ) ; EventHandlerSyncer shutdownSyncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_STATUS_CHANGED , String . format ( "(&(%s=%s)(%s=%s))" , Program . EVENT_PROP_PROGRAM_NAME , "TestSimpleTestSchedule" , Program . EVENT_PROP_PROGRAM_STATUS , ProgramStatus . SHUTDOWN . toString ( ) ) ) ; Program program = m_MissionProgramManager . loadParameters ( params ) ; executionSyncer . waitForEvent ( 5 ) ; shutdownSyncer . waitForEvent ( 20 ) ; program . remove ( ) ; }
This tests that a simple script can execute with a schedule.
This tests that a simple script can execute with a schedule .
//create parameters