mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestProgramImpl.java
@Test
    public void testSetExecutionDependencies()
    {
        //set up variable data
        MissionVariableMetaData programVars = new MissionVariableMetaData().withDescription("made up program deps").
            withName("assetX").withType(MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData programVars2 = new MissionVariableMetaData().withDescription("made up program deps").
            withName("assetY").withType(MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData programVars3 = new MissionVariableMetaData().withDescription("made up program deps").
            withName("assetZ").withType(MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData programVars4 = new MissionVariableMetaData().withDescription("made up program deps").
                withName("pl1").withType(MissionVariableTypesEnum.PHYSICAL_LINK);
        MissionVariableMetaData programVars5 = new MissionVariableMetaData().withDescription("made up program deps").
                withName("plZ").withType(MissionVariableTypesEnum.PHYSICAL_LINK);
        //the program's parameters
        List<MapEntry> params = new ArrayList<MapEntry>();
        params.add(new MapEntry("assetX", "assetX"));
        params.add(new MapEntry("assetY", "assetY"));
        params.add(new MapEntry("assetZ", "assetZ"));
        params.add(new MapEntry("plZ", "plZ"));
        params.add(new MapEntry("pl1", "pl1"));
        //create the program
        ProgramImpl program = new ProgramImpl(m_Manager, m_EventAdmin, new MissionProgramTemplate().
            withSource("something").withName("test").withVariableMetaData(programVars, programVars2, programVars3, 
                programVars4, programVars5),  new MissionProgramParameters().withSchedule(new MissionProgramSchedule().
                    withIndefiniteInterval(false)).withParameters(params), UUID.randomUUID());
        assertThat(program.getTemplateName(), is("test"));
        assertThat(program.getSource(), is("something"));
        //check dependency lists
        assertThat(program.getFactoryObjectDeps(Asset.class), hasItem("assetX"));
        assertThat(program.getFactoryObjectDeps(Asset.class), hasItem("assetY"));
        assertThat(program.getFactoryObjectDeps(Asset.class), hasItem("assetZ"));
        assertThat(program.getFactoryObjectDeps(PhysicalLink.class), hasItem("pl1"));
        assertThat(program.getFactoryObjectDeps(PhysicalLink.class), hasItem("plZ"));
    }
/**
     * Tests that program dependencies are correctly set and can be retrieved from a created program.
     * Dependencies can be of different FactoryObject types.
     */
Tests that program dependencies are correctly set and can be retrieved from a created program.
Dependencies can be of different FactoryObject types.
Tests that program dependencies are correctly set and can be retrieved from a created program . Dependencies can be of different FactoryObject types .
@Test
    public void testSetExecutionDependencies()
    {
        MissionVariableMetaData programVars = new MissionVariableMetaData().withDescription("made up program deps").
            withName("assetX").withType(MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData programVars2 = new MissionVariableMetaData().withDescription("made up program deps").
            withName("assetY").withType(MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData programVars3 = new MissionVariableMetaData().withDescription("made up program deps").
            withName("assetZ").withType(MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData programVars4 = new MissionVariableMetaData().withDescription("made up program deps").
                withName("pl1").withType(MissionVariableTypesEnum.PHYSICAL_LINK);
        MissionVariableMetaData programVars5 = new MissionVariableMetaData().withDescription("made up program deps").
                withName("plZ").withType(MissionVariableTypesEnum.PHYSICAL_LINK);
        List<MapEntry> params = new ArrayList<MapEntry>();
        params.add(new MapEntry("assetX", "assetX"));
        params.add(new MapEntry("assetY", "assetY"));
        params.add(new MapEntry("assetZ", "assetZ"));
        params.add(new MapEntry("plZ", "plZ"));
        params.add(new MapEntry("pl1", "pl1"));
        ProgramImpl program = new ProgramImpl(m_Manager, m_EventAdmin, new MissionProgramTemplate().
            withSource("something").withName("test").withVariableMetaData(programVars, programVars2, programVars3, 
                programVars4, programVars5),  new MissionProgramParameters().withSchedule(new MissionProgramSchedule().
                    withIndefiniteInterval(false)).withParameters(params), UUID.randomUUID());
        assertThat(program.getTemplateName(), is("test"));
        assertThat(program.getSource(), is("something"));
        assertThat(program.getFactoryObjectDeps(Asset.class), hasItem("assetX"));
        assertThat(program.getFactoryObjectDeps(Asset.class), hasItem("assetY"));
        assertThat(program.getFactoryObjectDeps(Asset.class), hasItem("assetZ"));
        assertThat(program.getFactoryObjectDeps(PhysicalLink.class), hasItem("pl1"));
        assertThat(program.getFactoryObjectDeps(PhysicalLink.class), hasItem("plZ"));
    }
@ Test public void testSetExecutionDependencies ( ) { MissionVariableMetaData programVars = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "assetX" ) . withType ( MissionVariableTypesEnum . ASSET ) ; MissionVariableMetaData programVars2 = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "assetY" ) . withType ( MissionVariableTypesEnum . ASSET ) ; MissionVariableMetaData programVars3 = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "assetZ" ) . withType ( MissionVariableTypesEnum . ASSET ) ; MissionVariableMetaData programVars4 = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "pl1" ) . withType ( MissionVariableTypesEnum . PHYSICAL_LINK ) ; MissionVariableMetaData programVars5 = new MissionVariableMetaData ( ) . withDescription ( "made up program deps" ) . withName ( "plZ" ) . withType ( MissionVariableTypesEnum . PHYSICAL_LINK ) ; List < MapEntry > params = new ArrayList < MapEntry > ( ) ; params . add ( new MapEntry ( "assetX" , "assetX" ) ) ; params . add ( new MapEntry ( "assetY" , "assetY" ) ) ; params . add ( new MapEntry ( "assetZ" , "assetZ" ) ) ; params . add ( new MapEntry ( "plZ" , "plZ" ) ) ; params . add ( new MapEntry ( "pl1" , "pl1" ) ) ; ProgramImpl program = new ProgramImpl ( m_Manager , m_EventAdmin , new MissionProgramTemplate ( ) . withSource ( "something" ) . withName ( "test" ) . withVariableMetaData ( programVars , programVars2 , programVars3 , programVars4 , programVars5 ) , new MissionProgramParameters ( ) . withSchedule ( new MissionProgramSchedule ( ) . withIndefiniteInterval ( false ) ) . withParameters ( params ) , UUID . randomUUID ( ) ) ; assertThat ( program . getTemplateName ( ) , is ( "test" ) ) ; assertThat ( program . getSource ( ) , is ( "something" ) ) ; assertThat ( program . getFactoryObjectDeps ( Asset . class ) , hasItem ( "assetX" ) ) ; assertThat ( program . getFactoryObjectDeps ( Asset . class ) , hasItem ( "assetY" ) ) ; assertThat ( program . getFactoryObjectDeps ( Asset . class ) , hasItem ( "assetZ" ) ) ; assertThat ( program . getFactoryObjectDeps ( PhysicalLink . class ) , hasItem ( "pl1" ) ) ; assertThat ( program . getFactoryObjectDeps ( PhysicalLink . class ) , hasItem ( "plZ" ) ) ; }
Tests that program dependencies are correctly set and can be retrieved from a created program.
Tests that program dependencies are correctly set and can be retrieved from a created program .
//set up variable data //the program's parameters //create the program //check dependency lists