mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestMissionProgramming.java
@Test
    public void testSimpleScriptTestExecution() throws IllegalArgumentException, MissionProgramException, IOException,
        PersistenceFailedException, InterruptedException, ExecutionException
    {
        //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("TestSimpleTest2");

        //wait for tested event
        EventHandlerSyncer syncer = 
                new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_TESTED, "(name=TestSimpleTest2)");

        Program program = m_MissionProgramManager.loadParameters(params);
        Future<TestResult> results = program.executeTest();

        //verify
        syncer.waitForEvent(10);

        //verify that the parameters were loaded successfully and created a valid Mission program that executed 
        //successfully
        assertThat(program.getProgramStatus(), is(ProgramStatus.WAITING_INITIALIZED));
        assertThat(program.getLastTestResult(), is(TestResult.PASSED));
        assertThat(results.get(), is(TestResult.PASSED));
        program.remove();
    }
/**
     * This tests that a simple script can execute its test function.
     */
This tests that a simple script can execute its test function.
This tests that a simple script can execute its test function .
@Test
    public void testSimpleScriptTestExecution() throws IllegalArgumentException, MissionProgramException, IOException,
        PersistenceFailedException, InterruptedException, ExecutionException
    {
        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("TestSimpleTest2");
        EventHandlerSyncer syncer = 
                new EventHandlerSyncer(m_Context, Program.TOPIC_PROGRAM_TESTED, "(name=TestSimpleTest2)");
        Program program = m_MissionProgramManager.loadParameters(params);
        Future<TestResult> results = program.executeTest();
        syncer.waitForEvent(10);
         that the parameters were loaded successfully and created a valid Mission program that executed 
        assertThat(program.getProgramStatus(), is(ProgramStatus.WAITING_INITIALIZED));
        assertThat(program.getLastTestResult(), is(TestResult.PASSED));
        assertThat(results.get(), is(TestResult.PASSED));
        program.remove();
    }
@ Test public void testSimpleScriptTestExecution ( ) throws IllegalArgumentException , MissionProgramException , IOException , PersistenceFailedException , InterruptedException , ExecutionException { 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 ( "TestSimpleTest2" ) ; EventHandlerSyncer syncer = new EventHandlerSyncer ( m_Context , Program . TOPIC_PROGRAM_TESTED , "(name=TestSimpleTest2)" ) ; Program program = m_MissionProgramManager . loadParameters ( params ) ; Future < TestResult > results = program . executeTest ( ) ; syncer . waitForEvent ( 10 ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . WAITING_INITIALIZED ) ) ; assertThat ( program . getLastTestResult ( ) , is ( TestResult . PASSED ) ) ; assertThat ( results . get ( ) , is ( TestResult . PASSED ) ) ; program . remove ( ) ; }
This tests that a simple script can execute its test function.
This tests that a simple script can execute its test function .
//create parameters //wait for tested event //verify //verify that the parameters were loaded successfully and created a valid Mission program that executed  //successfully