mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestProgramImpl.java
@Test
    public void testProgramDeps()
    {
        UUID progUuid = UUID.randomUUID();
        //mocks for MissionProgramManager behavior
        Program mockProg = mock(Program.class);
        when(m_Manager.getProgramDep(Mockito.anyString())).thenReturn(mockProg);
        //program variables, schedule, and template
        MissionVariableMetaData programVars = new MissionVariableMetaData().withDescription("made up program deps")
                .withName("prog1").
            withOptionValues("prog2", "prog3").withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionVariableMetaData programVars2 = new MissionVariableMetaData().withDescription("made up program deps").
            withName("prog2").withOptionValues("prog1", "prog3").withType(
                        MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionProgramTemplate progInstance = new MissionProgramTemplate().withSource("dragon").withName("George").
            withVariableMetaData(programVars, programVars2);
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false);
        //program parameters
        List<MapEntry> params = new ArrayList<MapEntry>();
        params.add(new MapEntry("prog1", "prog3"));
        params.add(new MapEntry("prog2", "prog3"));
        //create new program
        ProgramImpl program = new ProgramImpl(m_Manager, m_EventAdmin, progInstance, new MissionProgramParameters().
            withParameters(params).withSchedule(schedule).withProgramName("NAME"), progUuid);
        //both variables have the same dependency
        assertThat(program.getProgramDeps(), hasItem("prog3"));
        List<MissionVariableMetaData> newVarData = program.getVariableMetaData();
        //there should only be two in the list
        assertThat(newVarData.get(0).getOptionValues(), hasItem("prog2"));
        assertThat(newVarData.get(0).getOptionValues(), hasItem("prog3"));
        assertThat(newVarData.get(1).getOptionValues(), hasItem("prog1"));
        assertThat(newVarData.get(1).getOptionValues(), hasItem("prog3"));
        
        //should be unsatisfied as the program has only been created, and the execution params have not been changed
        //to values for their give type
        assertThat(program.getProgramStatus(), is(ProgramStatus.UNSATISFIED));
        //attempt to reconcile the deps to values
        program.reconcileDependencies();

        //without the script engine evaluating the program's script in the mission program manager, 
        //this is the waiting status
        assertThat(program.getProgramStatus(), is(ProgramStatus.WAITING_UNINITIALIZED));
    }
/**
     * This tests that the program dependencies are extracted from the mission program and placed into the program 
     * deps.
     * Verify that the mission's status is update to waiting, but not initialized.
     */
This tests that the program dependencies are extracted from the mission program and placed into the program
deps.
Verify that the mission's status is update to waiting, but not initialized.
This tests that the program dependencies are extracted from the mission program and placed into the program deps . Verify that the mission ' s status is update to waiting but not initialized .
@Test
    public void testProgramDeps()
    {
        UUID progUuid = UUID.randomUUID();
        Program mockProg = mock(Program.class);
        when(m_Manager.getProgramDep(Mockito.anyString())).thenReturn(mockProg);
        MissionVariableMetaData programVars = new MissionVariableMetaData().withDescription("made up program deps")
                .withName("prog1").
            withOptionValues("prog2", "prog3").withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionVariableMetaData programVars2 = new MissionVariableMetaData().withDescription("made up program deps").
            withName("prog2").withOptionValues("prog1", "prog3").withType(
                        MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionProgramTemplate progInstance = new MissionProgramTemplate().withSource("dragon").withName("George").
            withVariableMetaData(programVars, programVars2);
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false);
        List<MapEntry> params = new ArrayList<MapEntry>();
        params.add(new MapEntry("prog1", "prog3"));
        params.add(new MapEntry("prog2", "prog3"));
        ProgramImpl program = new ProgramImpl(m_Manager, m_EventAdmin, progInstance, new MissionProgramParameters().
            withParameters(params).withSchedule(schedule).withProgramName("NAME"), progUuid);
        assertThat(program.getProgramDeps(), hasItem("prog3"));
        List<MissionVariableMetaData> newVarData = program.getVariableMetaData();
        assertThat(newVarData.get(0).getOptionValues(), hasItem("prog2"));
        assertThat(newVarData.get(0).getOptionValues(), hasItem("prog3"));
        assertThat(newVarData.get(1).getOptionValues(), hasItem("prog1"));
        assertThat(newVarData.get(1).getOptionValues(), hasItem("prog3"));
        assertThat(program.getProgramStatus(), is(ProgramStatus.UNSATISFIED));
        program.reconcileDependencies();
        assertThat(program.getProgramStatus(), is(ProgramStatus.WAITING_UNINITIALIZED));
    }
@ Test public void testProgramDeps ( ) { UUID progUuid = UUID . randomUUID ( ) ; Program mockProg = mock ( Program . class ) ; when ( m_Manager . getProgramDep ( Mockito . anyString ( ) ) ) . thenReturn ( mockProg ) ; MissionVariableMetaData programVars = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "prog1" ) . withOptionValues ( "prog2" , "prog3" ) . withType ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) ; MissionVariableMetaData programVars2 = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "prog2" ) . withOptionValues ( "prog1" , "prog3" ) . withType ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) ; MissionProgramTemplate progInstance = new MissionProgramTemplate ( ) . withSource ( "dragon" ) . withName ( "George" ) . withVariableMetaData ( programVars , programVars2 ) ; MissionProgramSchedule schedule = new MissionProgramSchedule ( ) . withIndefiniteInterval ( false ) ; List < MapEntry > params = new ArrayList < MapEntry > ( ) ; params . add ( new MapEntry ( "prog1" , "prog3" ) ) ; params . add ( new MapEntry ( "prog2" , "prog3" ) ) ; ProgramImpl program = new ProgramImpl ( m_Manager , m_EventAdmin , progInstance , new MissionProgramParameters ( ) . withParameters ( params ) . withSchedule ( schedule ) . withProgramName ( "NAME" ) , progUuid ) ; assertThat ( program . getProgramDeps ( ) , hasItem ( "prog3" ) ) ; List < MissionVariableMetaData > newVarData = program . getVariableMetaData ( ) ; assertThat ( newVarData . get ( 0 ) . getOptionValues ( ) , hasItem ( "prog2" ) ) ; assertThat ( newVarData . get ( 0 ) . getOptionValues ( ) , hasItem ( "prog3" ) ) ; assertThat ( newVarData . get ( 1 ) . getOptionValues ( ) , hasItem ( "prog1" ) ) ; assertThat ( newVarData . get ( 1 ) . getOptionValues ( ) , hasItem ( "prog3" ) ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . UNSATISFIED ) ) ; program . reconcileDependencies ( ) ; assertThat ( program . getProgramStatus ( ) , is ( ProgramStatus . WAITING_UNINITIALIZED ) ) ; }
This tests that the program dependencies are extracted from the mission program and placed into the program
 deps.
This tests that the program dependencies are extracted from the mission program and placed into the program deps .
//mocks for MissionProgramManager behavior //program variables, schedule, and template //program parameters //create new program //both variables have the same dependency //there should only be two in the list //should be unsatisfied as the program has only been created, and the execution params have not been changed //to values for their give type //attempt to reconcile the deps to values //without the script engine evaluating the program's script in the mission program manager,  //this is the waiting status