mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestProgramImpl.java
@Test
    public void testGetVariableMetaData()
    {
        //set up mission program
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false);
        MissionProgramTemplate program = new MissionProgramTemplate();
        program.setName("TestMission");
        program.setDescription("A test mission that tests the usage of metadata");
        program.setSource("TheSourceIsHere");
        program.withVariableMetaData(new MissionVariableMetaData().withName("Var"). 
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES).withDescription("Really awesome variable").
            withDefaultValue("Steve").withOptionValues("Super", "Bat", "Yeti").
            withHumanReadableName("Nilesh"));
        ProgramImpl programTest =  new ProgramImpl(m_Manager, m_EventAdmin, program, new MissionProgramParameters().
            withSchedule(schedule), UUID.randomUUID());
        
        //check that the new metadata was added
        assertThat(programTest.getVariableMetaData().size(), is(1));
        assertThat(programTest.getDescription(), is("A test mission that tests the usage of metadata"));
        assertThat(programTest.getVariableMetaData().iterator().next().getName(), is("Var"));
        assertThat(programTest.getVariableMetaData().iterator().next().getDefaultValue(), is("Steve"));
        assertThat(programTest.getVariableMetaData().iterator().next().getDescription(), is("Really awesome variable"));
        assertThat(programTest.getVariableMetaData().iterator().next().getType(), 
            is(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES));
        assertThat(programTest.getVariableMetaData().iterator().next().getOptionValues(), hasItem("Bat"));
        assertThat(programTest.getVariableMetaData().iterator().next().getHumanReadableName(), is("Nilesh"));
    }
/**
     * Tests that metadata can be set and retrieved for a program.
     */
Tests that metadata can be set and retrieved for a program.
Tests that metadata can be set and retrieved for a program .
@Test
    public void testGetVariableMetaData()
    {
        MissionProgramSchedule schedule = new MissionProgramSchedule().withIndefiniteInterval(false);
        MissionProgramTemplate program = new MissionProgramTemplate();
        program.setName("TestMission");
        program.setDescription("A test mission that tests the usage of metadata");
        program.setSource("TheSourceIsHere");
        program.withVariableMetaData(new MissionVariableMetaData().withName("Var"). 
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES).withDescription("Really awesome variable").
            withDefaultValue("Steve").withOptionValues("Super", "Bat", "Yeti").
            withHumanReadableName("Nilesh"));
        ProgramImpl programTest =  new ProgramImpl(m_Manager, m_EventAdmin, program, new MissionProgramParameters().
            withSchedule(schedule), UUID.randomUUID());
        assertThat(programTest.getVariableMetaData().size(), is(1));
        assertThat(programTest.getDescription(), is("A test mission that tests the usage of metadata"));
        assertThat(programTest.getVariableMetaData().iterator().next().getName(), is("Var"));
        assertThat(programTest.getVariableMetaData().iterator().next().getDefaultValue(), is("Steve"));
        assertThat(programTest.getVariableMetaData().iterator().next().getDescription(), is("Really awesome variable"));
        assertThat(programTest.getVariableMetaData().iterator().next().getType(), 
            is(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES));
        assertThat(programTest.getVariableMetaData().iterator().next().getOptionValues(), hasItem("Bat"));
        assertThat(programTest.getVariableMetaData().iterator().next().getHumanReadableName(), is("Nilesh"));
    }
@ Test public void testGetVariableMetaData ( ) { MissionProgramSchedule schedule = new MissionProgramSchedule ( ) . withIndefiniteInterval ( false ) ; MissionProgramTemplate program = new MissionProgramTemplate ( ) ; program . setName ( "TestMission" ) ; program . setDescription ( "A test mission that tests the usage of metadata" ) ; program . setSource ( "TheSourceIsHere" ) ; program . withVariableMetaData ( new MissionVariableMetaData ( ) . withName ( "Var" ) . withType ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) . withDescription ( "Really awesome variable" ) . withDefaultValue ( "Steve" ) . withOptionValues ( "Super" , "Bat" , "Yeti" ) . withHumanReadableName ( "Nilesh" ) ) ; ProgramImpl programTest = new ProgramImpl ( m_Manager , m_EventAdmin , program , new MissionProgramParameters ( ) . withSchedule ( schedule ) , UUID . randomUUID ( ) ) ; assertThat ( programTest . getVariableMetaData ( ) . size ( ) , is ( 1 ) ) ; assertThat ( programTest . getDescription ( ) , is ( "A test mission that tests the usage of metadata" ) ) ; assertThat ( programTest . getVariableMetaData ( ) . iterator ( ) . next ( ) . getName ( ) , is ( "Var" ) ) ; assertThat ( programTest . getVariableMetaData ( ) . iterator ( ) . next ( ) . getDefaultValue ( ) , is ( "Steve" ) ) ; assertThat ( programTest . getVariableMetaData ( ) . iterator ( ) . next ( ) . getDescription ( ) , is ( "Really awesome variable" ) ) ; assertThat ( programTest . getVariableMetaData ( ) . iterator ( ) . next ( ) . getType ( ) , is ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) ) ; assertThat ( programTest . getVariableMetaData ( ) . iterator ( ) . next ( ) . getOptionValues ( ) , hasItem ( "Bat" ) ) ; assertThat ( programTest . getVariableMetaData ( ) . iterator ( ) . next ( ) . getHumanReadableName ( ) , is ( "Nilesh" ) ) ; }
Tests that metadata can be set and retrieved for a program.
Tests that metadata can be set and retrieved for a program .
//set up mission program //check that the new metadata was added