mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestTemplateProgramManager.java
public void testRemoveTemplate() throws IllegalArgumentException, PersistenceFailedException
    {
        //add templates
        MissionProgramTemplate progTemplate = createTestTemplate("TemplateTest1", "source");
        m_TemplateProgramManager.loadMissionTemplate(progTemplate);  
        progTemplate = createTestTemplate("TemplateTest2", "source");
        m_TemplateProgramManager.loadMissionTemplate(progTemplate);
        
        //remove templates
        m_TemplateProgramManager.removeTemplate("TemplateTest1");
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), not(hasItem("TemplateTest1")));
        m_TemplateProgramManager.removeTemplate("TemplateTest2");
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), not(hasItem("TemplateTest2")));
        
        //try to remove template that is already gone
        try
        {
            m_TemplateProgramManager.removeTemplate("TemplateTest2");
            fail("Expected Exception");
        }
        catch (IllegalArgumentException exception)
        {
            //expected exception as the template was already removed. 
        }
    }
/**
     * Verify the ability to delete/remove previously loaded mission program templates.
     */
Verify the ability to delete/remove previously loaded mission program templates.
Verify the ability to delete / remove previously loaded mission program templates .
public void testRemoveTemplate() throws IllegalArgumentException, PersistenceFailedException
    {
        MissionProgramTemplate progTemplate = createTestTemplate("TemplateTest1", "source");
        m_TemplateProgramManager.loadMissionTemplate(progTemplate);  
        progTemplate = createTestTemplate("TemplateTest2", "source");
        m_TemplateProgramManager.loadMissionTemplate(progTemplate);
        m_TemplateProgramManager.removeTemplate("TemplateTest1");
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), not(hasItem("TemplateTest1")));
        m_TemplateProgramManager.removeTemplate("TemplateTest2");
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), not(hasItem("TemplateTest2")));
        try
        {
            m_TemplateProgramManager.removeTemplate("TemplateTest2");
            fail("Expected Exception");
        }
        catch (IllegalArgumentException exception)
        {
        }
    }
public void testRemoveTemplate ( ) throws IllegalArgumentException , PersistenceFailedException { MissionProgramTemplate progTemplate = createTestTemplate ( "TemplateTest1" , "source" ) ; m_TemplateProgramManager . loadMissionTemplate ( progTemplate ) ; progTemplate = createTestTemplate ( "TemplateTest2" , "source" ) ; m_TemplateProgramManager . loadMissionTemplate ( progTemplate ) ; m_TemplateProgramManager . removeTemplate ( "TemplateTest1" ) ; assertThat ( m_TemplateProgramManager . getMissionTemplateNames ( ) , not ( hasItem ( "TemplateTest1" ) ) ) ; m_TemplateProgramManager . removeTemplate ( "TemplateTest2" ) ; assertThat ( m_TemplateProgramManager . getMissionTemplateNames ( ) , not ( hasItem ( "TemplateTest2" ) ) ) ; try { m_TemplateProgramManager . removeTemplate ( "TemplateTest2" ) ; fail ( "Expected Exception" ) ; } catch ( IllegalArgumentException exception ) { } }
Verify the ability to delete/remove previously loaded mission program templates.
Verify the ability to delete / remove previously loaded mission program templates .
//add templates //remove templates //try to remove template that is already gone //expected exception as the template was already removed. 