mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestTemplateProgramManagerImpl.java
@Test
    public void testGetTemplate()
    {
        //mock the stored templates
        mockTemplateProgramManagerTemplates();
        m_SUT.activate(context);
        
        // mock data store
        MissionProgramTemplate template = m_SUT.getTemplate("saved-program2");
        assertThat(template.getName(), is("saved-program2"));
        //make sure that this is the correct template and that it is complete
        assertThat(template.getVariableMetaData().size(), is(2));
        
        //test error if template does not exist
        try
        {
            m_SUT.getTemplate("BubonicPlague");
            fail("Expected Exception");
        }
        catch(IllegalArgumentException exception)
        {
            //expected exception
        }
    }
/**
     * Test getting a template from the manager.
     * 
     */
Test getting a template from the manager.
Test getting a template from the manager .
@Test
    public void testGetTemplate()
    {
        mockTemplateProgramManagerTemplates();
        m_SUT.activate(context);
        MissionProgramTemplate template = m_SUT.getTemplate("saved-program2");
        assertThat(template.getName(), is("saved-program2"));
        assertThat(template.getVariableMetaData().size(), is(2));
        try
        {
            m_SUT.getTemplate("BubonicPlague");
            fail("Expected Exception");
        }
        catch(IllegalArgumentException exception)
        {
        }
    }
@ Test public void testGetTemplate ( ) { mockTemplateProgramManagerTemplates ( ) ; m_SUT . activate ( context ) ; MissionProgramTemplate template = m_SUT . getTemplate ( "saved-program2" ) ; assertThat ( template . getName ( ) , is ( "saved-program2" ) ) ; assertThat ( template . getVariableMetaData ( ) . size ( ) , is ( 2 ) ) ; try { m_SUT . getTemplate ( "BubonicPlague" ) ; fail ( "Expected Exception" ) ; } catch ( IllegalArgumentException exception ) { } }
Test getting a template from the manager.
Test getting a template from the manager .
//mock the stored templates // mock data store //make sure that this is the correct template and that it is complete //test error if template does not exist //expected exception