mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestTemplateProgramManager.java
public void testLoadMissionTemplate() throws IllegalArgumentException, PersistenceFailedException
    {
        MissionProgramTemplate progTemplate = createTestTemplate("TemplateTest", 
                "To be or not to be, that is the question.");
        m_TemplateProgramManager.loadMissionTemplate(progTemplate);
        
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("TemplateTest"));
        
        //get the template made already
        MissionProgramTemplate template = m_TemplateProgramManager.getTemplate("TemplateTest");
        assertThat(template.getSource(), is("To be or not to be, that is the question."));
        
        //get a template that doesn't exist
        try
        {
            template = m_TemplateProgramManager.getTemplate("ImagineryTemplate");
            fail("Expected Exception");
        }
        catch (IllegalArgumentException exception)
        {
            //expected exception the template requested does not exist.       
        }
    }
/**
     * Verify ability to load and get templates.
     */
Verify ability to load and get templates.
Verify ability to load and get templates .
public void testLoadMissionTemplate() throws IllegalArgumentException, PersistenceFailedException
    {
        MissionProgramTemplate progTemplate = createTestTemplate("TemplateTest", 
                "To be or not to be, that is the question.");
        m_TemplateProgramManager.loadMissionTemplate(progTemplate);
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("TemplateTest"));
        MissionProgramTemplate template = m_TemplateProgramManager.getTemplate("TemplateTest");
        assertThat(template.getSource(), is("To be or not to be, that is the question."));
        try
        {
            template = m_TemplateProgramManager.getTemplate("ImagineryTemplate");
            fail("Expected Exception");
        }
        catch (IllegalArgumentException exception)
        {
        }
    }
public void testLoadMissionTemplate ( ) throws IllegalArgumentException , PersistenceFailedException { MissionProgramTemplate progTemplate = createTestTemplate ( "TemplateTest" , "To be or not to be, that is the question." ) ; m_TemplateProgramManager . loadMissionTemplate ( progTemplate ) ; assertThat ( m_TemplateProgramManager . getMissionTemplateNames ( ) , hasItem ( "TemplateTest" ) ) ; MissionProgramTemplate template = m_TemplateProgramManager . getTemplate ( "TemplateTest" ) ; assertThat ( template . getSource ( ) , is ( "To be or not to be, that is the question." ) ) ; try { template = m_TemplateProgramManager . getTemplate ( "ImagineryTemplate" ) ; fail ( "Expected Exception" ) ; } catch ( IllegalArgumentException exception ) { } }
Verify ability to load and get templates.
Verify ability to load and get templates .
//get the template made already //get a template that doesn't exist //expected exception the template requested does not exist.       