mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestMissionProgramManagerImpl.java
private void mockTemplates()
    {
        // variable metadata
        MissionVariableMetaData varMeta =  new MissionVariableMetaData().withName("assetX").withType(
                    MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData varMeta2 =  new MissionVariableMetaData().withName("assetZ").withType(
                    MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData varMeta3 =  new MissionVariableMetaData().withName("tl7").withType(
                    MissionVariableTypesEnum.TRANSPORT_LAYER);
        MissionVariableMetaData varMeta5 =  new MissionVariableMetaData().withName("saved-program5").
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionVariableMetaData varMeta6 =  new MissionVariableMetaData().withName("pl5").withType(
                    MissionVariableTypesEnum.PHYSICAL_LINK);
        MissionVariableMetaData varMeta9 =  new MissionVariableMetaData().withName("asset3").withType(
                    MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData varMeta10 =  new MissionVariableMetaData().withName("bogus-program").
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionVariableMetaData varMeta11 =  new MissionVariableMetaData().withName("ll1").
            withType(MissionVariableTypesEnum.LINK_LAYER);
        MissionVariableMetaData varMeta12 =  new MissionVariableMetaData().withName("saved-program3").
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        
        //mission templates
        MissionProgramTemplate programData1 = new MissionProgramTemplate().withSource("test").
            withVariableMetaData(varMeta, varMeta2, varMeta3, varMeta5 ).withName("saved-program1");
           
        MissionProgramTemplate programData2 = new MissionProgramTemplate().withSource("blah").
            withName("saved-program2").withVariableMetaData(varMeta6, varMeta11);
        
        MissionProgramTemplate programData3 = new MissionProgramTemplate().withSource("something").
            withName("saved-program3").withVariableMetaData(varMeta9);
        
        MissionProgramTemplate programData4 = new MissionProgramTemplate().withSource("blahblah").
            withName("saved-program4").withVariableMetaData(varMeta10);
        
        MissionProgramTemplate programData5 = new MissionProgramTemplate().withSource("huh").
            withName("saved-program5").withVariableMetaData(varMeta12);
        
        MissionProgramTemplate programData6 = new MissionProgramTemplate().withSource("huh2").
                withName("saved-program6").withVariableMetaData(varMeta12);
            
        //mock out templates
        Set<String> templateNames = new HashSet<String>();
        templateNames.add("saved-program1");
        templateNames.add("saved-program2");
        templateNames.add("saved-program3");
        templateNames.add("saved-program4");
        templateNames.add("saved-program5");
        templateNames.add("saved-program6");
        when(m_TemplateManager.getMissionTemplateNames()).thenReturn(templateNames);
        
        when(m_TemplateManager.getTemplate("saved-program1")).thenReturn(programData1);
        when(m_TemplateManager.getTemplate("saved-program2")).thenReturn(programData2);
        when(m_TemplateManager.getTemplate("saved-program3")).thenReturn(programData3);
        when(m_TemplateManager.getTemplate("saved-program4")).thenReturn(programData4);
        when(m_TemplateManager.getTemplate("saved-program5")).thenReturn(programData5);
        when(m_TemplateManager.getTemplate("saved-program6")).thenReturn(programData6);
    }
/**
     * Templates used to test restoring of mission programs.
     */
Templates used to test restoring of mission programs.
Templates used to test restoring of mission programs .
private void mockTemplates()
    {
        MissionVariableMetaData varMeta =  new MissionVariableMetaData().withName("assetX").withType(
                    MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData varMeta2 =  new MissionVariableMetaData().withName("assetZ").withType(
                    MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData varMeta3 =  new MissionVariableMetaData().withName("tl7").withType(
                    MissionVariableTypesEnum.TRANSPORT_LAYER);
        MissionVariableMetaData varMeta5 =  new MissionVariableMetaData().withName("saved-program5").
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionVariableMetaData varMeta6 =  new MissionVariableMetaData().withName("pl5").withType(
                    MissionVariableTypesEnum.PHYSICAL_LINK);
        MissionVariableMetaData varMeta9 =  new MissionVariableMetaData().withName("asset3").withType(
                    MissionVariableTypesEnum.ASSET);
        MissionVariableMetaData varMeta10 =  new MissionVariableMetaData().withName("bogus-program").
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionVariableMetaData varMeta11 =  new MissionVariableMetaData().withName("ll1").
            withType(MissionVariableTypesEnum.LINK_LAYER);
        MissionVariableMetaData varMeta12 =  new MissionVariableMetaData().withName("saved-program3").
            withType(MissionVariableTypesEnum.PROGRAM_DEPENDENCIES);
        MissionProgramTemplate programData1 = new MissionProgramTemplate().withSource("test").
            withVariableMetaData(varMeta, varMeta2, varMeta3, varMeta5 ).withName("saved-program1");
        MissionProgramTemplate programData2 = new MissionProgramTemplate().withSource("blah").
            withName("saved-program2").withVariableMetaData(varMeta6, varMeta11);
        MissionProgramTemplate programData3 = new MissionProgramTemplate().withSource("something").
            withName("saved-program3").withVariableMetaData(varMeta9);
        MissionProgramTemplate programData4 = new MissionProgramTemplate().withSource("blahblah").
            withName("saved-program4").withVariableMetaData(varMeta10);
        MissionProgramTemplate programData5 = new MissionProgramTemplate().withSource("huh").
            withName("saved-program5").withVariableMetaData(varMeta12);
        MissionProgramTemplate programData6 = new MissionProgramTemplate().withSource("huh2").
                withName("saved-program6").withVariableMetaData(varMeta12);
        Set<String> templateNames = new HashSet<String>();
        templateNames.add("saved-program1");
        templateNames.add("saved-program2");
        templateNames.add("saved-program3");
        templateNames.add("saved-program4");
        templateNames.add("saved-program5");
        templateNames.add("saved-program6");
        when(m_TemplateManager.getMissionTemplateNames()).thenReturn(templateNames);
        when(m_TemplateManager.getTemplate("saved-program1")).thenReturn(programData1);
        when(m_TemplateManager.getTemplate("saved-program2")).thenReturn(programData2);
        when(m_TemplateManager.getTemplate("saved-program3")).thenReturn(programData3);
        when(m_TemplateManager.getTemplate("saved-program4")).thenReturn(programData4);
        when(m_TemplateManager.getTemplate("saved-program5")).thenReturn(programData5);
        when(m_TemplateManager.getTemplate("saved-program6")).thenReturn(programData6);
    }
private void mockTemplates ( ) { MissionVariableMetaData varMeta = new MissionVariableMetaData ( ) . withName ( "assetX" ) . withType ( MissionVariableTypesEnum . ASSET ) ; MissionVariableMetaData varMeta2 = new MissionVariableMetaData ( ) . withName ( "assetZ" ) . withType ( MissionVariableTypesEnum . ASSET ) ; MissionVariableMetaData varMeta3 = new MissionVariableMetaData ( ) . withName ( "tl7" ) . withType ( MissionVariableTypesEnum . TRANSPORT_LAYER ) ; MissionVariableMetaData varMeta5 = new MissionVariableMetaData ( ) . withName ( "saved-program5" ) . withType ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) ; MissionVariableMetaData varMeta6 = new MissionVariableMetaData ( ) . withName ( "pl5" ) . withType ( MissionVariableTypesEnum . PHYSICAL_LINK ) ; MissionVariableMetaData varMeta9 = new MissionVariableMetaData ( ) . withName ( "asset3" ) . withType ( MissionVariableTypesEnum . ASSET ) ; MissionVariableMetaData varMeta10 = new MissionVariableMetaData ( ) . withName ( "bogus-program" ) . withType ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) ; MissionVariableMetaData varMeta11 = new MissionVariableMetaData ( ) . withName ( "ll1" ) . withType ( MissionVariableTypesEnum . LINK_LAYER ) ; MissionVariableMetaData varMeta12 = new MissionVariableMetaData ( ) . withName ( "saved-program3" ) . withType ( MissionVariableTypesEnum . PROGRAM_DEPENDENCIES ) ; MissionProgramTemplate programData1 = new MissionProgramTemplate ( ) . withSource ( "test" ) . withVariableMetaData ( varMeta , varMeta2 , varMeta3 , varMeta5 ) . withName ( "saved-program1" ) ; MissionProgramTemplate programData2 = new MissionProgramTemplate ( ) . withSource ( "blah" ) . withName ( "saved-program2" ) . withVariableMetaData ( varMeta6 , varMeta11 ) ; MissionProgramTemplate programData3 = new MissionProgramTemplate ( ) . withSource ( "something" ) . withName ( "saved-program3" ) . withVariableMetaData ( varMeta9 ) ; MissionProgramTemplate programData4 = new MissionProgramTemplate ( ) . withSource ( "blahblah" ) . withName ( "saved-program4" ) . withVariableMetaData ( varMeta10 ) ; MissionProgramTemplate programData5 = new MissionProgramTemplate ( ) . withSource ( "huh" ) . withName ( "saved-program5" ) . withVariableMetaData ( varMeta12 ) ; MissionProgramTemplate programData6 = new MissionProgramTemplate ( ) . withSource ( "huh2" ) . withName ( "saved-program6" ) . withVariableMetaData ( varMeta12 ) ; Set < String > templateNames = new HashSet < String > ( ) ; templateNames . add ( "saved-program1" ) ; templateNames . add ( "saved-program2" ) ; templateNames . add ( "saved-program3" ) ; templateNames . add ( "saved-program4" ) ; templateNames . add ( "saved-program5" ) ; templateNames . add ( "saved-program6" ) ; when ( m_TemplateManager . getMissionTemplateNames ( ) ) . thenReturn ( templateNames ) ; when ( m_TemplateManager . getTemplate ( "saved-program1" ) ) . thenReturn ( programData1 ) ; when ( m_TemplateManager . getTemplate ( "saved-program2" ) ) . thenReturn ( programData2 ) ; when ( m_TemplateManager . getTemplate ( "saved-program3" ) ) . thenReturn ( programData3 ) ; when ( m_TemplateManager . getTemplate ( "saved-program4" ) ) . thenReturn ( programData4 ) ; when ( m_TemplateManager . getTemplate ( "saved-program5" ) ) . thenReturn ( programData5 ) ; when ( m_TemplateManager . getTemplate ( "saved-program6" ) ) . thenReturn ( programData6 ) ; }
Templates used to test restoring of mission programs.
Templates used to test restoring of mission programs .
// variable metadata //mission templates //mock out templates