mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestMissionProgramming.java
public void testCoreApi() throws Exception
    {
        //variable data
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false).
            withImmediately(true).withActive(true);
        MissionProgramParameters params = new MissionProgramParameters()
            .withTemplateName("core-api-template")
            .withSchedule(schedule)
            .withProgramName("core-api-test");

        EventHandlerSyncer executionSyncer = new EventHandlerSyncer(m_Context, 
                new String[] { Program.TOPIC_PROGRAM_EXECUTED, Program.TOPIC_PROGRAM_EXECUTED_FAILURE }, 
                String.format("(%s=%s)", Program.EVENT_PROP_PROGRAM_NAME, "core-api-test"));
        
        //the test actually happens from within the script
        Program program = m_MissionProgramManager.loadParameters(params);
        
        executionSyncer.waitForEvent(10);
        
        assertThat(program.getProgramStatus(), is(ProgramStatus.EXECUTED));
    }
/**
     * Test that class from the core API can be access directly from a mission program. 
     */
Test that class from the core API can be access directly from a mission program.
Test that class from the core API can be access directly from a mission program .
public void testCoreApi() throws Exception
    {
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false).
            withImmediately(true).withActive(true);
        MissionProgramParameters params = new MissionProgramParameters()
            .withTemplateName("core-api-template")
            .withSchedule(schedule)
            .withProgramName("core-api-test");
        EventHandlerSyncer executionSyncer = new EventHandlerSyncer(m_Context, 
                new String[] { Program.TOPIC_PROGRAM_EXECUTED, Program.TOPIC_PROGRAM_EXECUTED_FAILURE }, 
                String.format("(%s=%s)", Program.EVENT_PROP_PROGRAM_NAME, "core-api-test"));
        Program program = m_MissionProgramManager.loadParameters(params);
        executionSyncer.waitForEvent(10);
        assertThat(program.getProgramStatus(), is(ProgramStatus.EXECUTED));
    }
public void testCoreApi ( ) throws Exception { MissionProgramSchedule schedule = new MissionProgramSchedule ( ) . withIndefiniteInterval ( false ) . withImmediately ( true ) . withActive ( true ) ; MissionProgramParameters params = new MissionProgramParameters ( ) . withTemplateName ( "core-api-template" ) . withSchedule ( schedule ) . withProgramName ( "core-api-test" ) ; EventHandlerSyncer executionSyncer = new EventHandlerSyncer ( m_Context , new String [ ] { Program . TOPIC_PROGRAM_EXECUTED , Program . TOPIC_PROGRAM_EXECUTED_FAILURE } , String . format ( "(%s=%s)" , Program . EVENT_PROP_PROGRAM_NAME , "core-api-test" ) ) ; Program program = m_MissionProgramManager . loadParameters ( params ) ; executionSyncer . waitForEvent ( 10 ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . EXECUTED ) ) ; }
Test that class from the core API can be access directly from a mission program.
Test that class from the core API can be access directly from a mission program .
//variable data //the test actually happens from within the script