mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestTemplateProgramManager.java
public void testBadTemplate()
    {
        //get the template that has ill-formed XML
        try
        {
            m_TemplateProgramManager.getTemplate("bad-template");
            fail("Expected exception the template should not be in the lookup");
        }
        catch (IllegalArgumentException exception)
        {
            //expected exception
        }
        //try to get the template that is missing a required element
        try
        {
            m_TemplateProgramManager.getTemplate("bad-template-missing-element");
            fail("Expected exception the template should not be in the lookup");
        }
        catch (IllegalArgumentException exception)
        {
            //expected exception
        }
        //try to get the template with an added element not define in the mission program schemas
        try
        {
            m_TemplateProgramManager.getTemplate("bad-template-added-element");
            fail("Expected exception the template should not be in the lookup");
        }
        catch (IllegalArgumentException exception)
        {
            //expected exception
        }
        //verify that the other two templates from the directory are loaded
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("timed-data-capture-loop"));
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("triggered-data-captured"));
    }
/**
     * Inside the template directory there are templates prefixed with 'bad'. These templates
     * specifically check that even with different types of invalid templates that all other templates in the 
     * directory are still loaded. 
     */
Inside the template directory there are templates prefixed with 'bad'. These templates
specifically check that even with different types of invalid templates that all other templates in the
directory are still loaded.
Inside the template directory there are templates prefixed with ' bad ' . These templates specifically check that even with different types of invalid templates that all other templates in the directory are still loaded .
public void testBadTemplate()
    {
        try
        {
            m_TemplateProgramManager.getTemplate("bad-template");
            fail("Expected exception the template should not be in the lookup");
        }
        catch (IllegalArgumentException exception)
        {
        }
        try
        {
            m_TemplateProgramManager.getTemplate("bad-template-missing-element");
            fail("Expected exception the template should not be in the lookup");
        }
        catch (IllegalArgumentException exception)
        {
        }
        try
        {
            m_TemplateProgramManager.getTemplate("bad-template-added-element");
            fail("Expected exception the template should not be in the lookup");
        }
        catch (IllegalArgumentException exception)
        {
        }
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("timed-data-capture-loop"));
        assertThat(m_TemplateProgramManager.getMissionTemplateNames(), hasItem("triggered-data-captured"));
    }
public void testBadTemplate ( ) { try { m_TemplateProgramManager . getTemplate ( "bad-template" ) ; fail ( "Expected exception the template should not be in the lookup" ) ; } catch ( IllegalArgumentException exception ) { } try { m_TemplateProgramManager . getTemplate ( "bad-template-missing-element" ) ; fail ( "Expected exception the template should not be in the lookup" ) ; } catch ( IllegalArgumentException exception ) { } try { m_TemplateProgramManager . getTemplate ( "bad-template-added-element" ) ; fail ( "Expected exception the template should not be in the lookup" ) ; } catch ( IllegalArgumentException exception ) { } assertThat ( m_TemplateProgramManager . getMissionTemplateNames ( ) , hasItem ( "timed-data-capture-loop" ) ) ; assertThat ( m_TemplateProgramManager . getMissionTemplateNames ( ) , hasItem ( "triggered-data-captured" ) ) ; }
Inside the template directory there are templates prefixed with 'bad'.
Inside the template directory there are templates prefixed with ' bad ' .
//get the template that has ill-formed XML //expected exception //try to get the template that is missing a required element //expected exception //try to get the template with an added element not define in the mission program schemas //expected exception //verify that the other two templates from the directory are loaded