mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestMissionProgramManagerImpl.java
@Test
    public void testLoadParamsInactive() throws ValidationFailedException, MissionProgramException, 
        PersistenceFailedException, ScriptException
    {
        //mock data
        mockMissionProgramPersistentData();
        mockTemplates();

        setScriptEngineAndActivate();
        
        //program to add
        Map<String, Object> arguments = new HashMap<String, Object>();
        arguments.put("arg1", "test-value");
        arguments.put("arg2", 5);
        MissionProgramTemplate program = new MissionProgramTemplate().withName("test").withSource("something");
        MissionProgramSchedule schedule = new MissionProgramSchedule().withImmediately(false).
            withIndefiniteInterval(false).withActive(false);
        MissionProgramParameters params = new MissionProgramParameters().withTemplateName("test").
            withParameters(MapTranslator.translateMap(arguments)).withProgramName("Jim").withSchedule(schedule);

        //load program
        doReturn(program).when(m_TemplateManager).getTemplate("test");
        m_SUT.loadParameters(params);

        //verify not initialized, could throw script exception
        verify(m_ScriptEngine, never()).eval(eq("something"), Mockito.any(Bindings.class));

        //five templates are mocked in the 'mockTemplates'
        assertThat(m_SUT.getPrograms().size(), is(7));
    }
/**
     * Test loading parameters initialization process.
     * 
     * Verify inactive program does not get initialized.
     */
Test loading parameters initialization process.

Verify inactive program does not get initialized.
Test loading parameters initialization process . Verify inactive program does not get initialized .
@Test
    public void testLoadParamsInactive() throws ValidationFailedException, MissionProgramException, 
        PersistenceFailedException, ScriptException
    {
        mockMissionProgramPersistentData();
        mockTemplates();
        setScriptEngineAndActivate();
        Map<String, Object> arguments = new HashMap<String, Object>();
        arguments.put("arg1", "test-value");
        arguments.put("arg2", 5);
        MissionProgramTemplate program = new MissionProgramTemplate().withName("test").withSource("something");
        MissionProgramSchedule schedule = new MissionProgramSchedule().withImmediately(false).
            withIndefiniteInterval(false).withActive(false);
        MissionProgramParameters params = new MissionProgramParameters().withTemplateName("test").
            withParameters(MapTranslator.translateMap(arguments)).withProgramName("Jim").withSchedule(schedule);
        doReturn(program).when(m_TemplateManager).getTemplate("test");
        m_SUT.loadParameters(params);
        verify(m_ScriptEngine, never()).eval(eq("something"), Mockito.any(Bindings.class));
        assertThat(m_SUT.getPrograms().size(), is(7));
    }
@ Test public void testLoadParamsInactive ( ) throws ValidationFailedException , MissionProgramException , PersistenceFailedException , ScriptException { mockMissionProgramPersistentData ( ) ; mockTemplates ( ) ; setScriptEngineAndActivate ( ) ; Map < String , Object > arguments = new HashMap < String , Object > ( ) ; arguments . put ( "arg1" , "test-value" ) ; arguments . put ( "arg2" , 5 ) ; MissionProgramTemplate program = new MissionProgramTemplate ( ) . withName ( "test" ) . withSource ( "something" ) ; MissionProgramSchedule schedule = new MissionProgramSchedule ( ) . withImmediately ( false ) . withIndefiniteInterval ( false ) . withActive ( false ) ; MissionProgramParameters params = new MissionProgramParameters ( ) . withTemplateName ( "test" ) . withParameters ( MapTranslator . translateMap ( arguments ) ) . withProgramName ( "Jim" ) . withSchedule ( schedule ) ; doReturn ( program ) . when ( m_TemplateManager ) . getTemplate ( "test" ) ; m_SUT . loadParameters ( params ) ; verify ( m_ScriptEngine , never ( ) ) . eval ( eq ( "something" ) , Mockito . any ( Bindings . class ) ) ; assertThat ( m_SUT . getPrograms ( ) . size ( ) , is ( 7 ) ) ; }
Test loading parameters initialization process.
Test loading parameters initialization process .
//mock data //program to add //load program //verify not initialized, could throw script exception //five templates are mocked in the 'mockTemplates'