mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestMissionProgramManagerImpl.java
@Test
    public void testAddProgramNoTemplateName() 
        throws IllegalArgumentException, PersistenceFailedException, MissionProgramException
    {
        // mock
        setScriptEngineAndActivate();
        assertThat(m_SUT.getActiveProgramTemplateNames().size(), is(0));
        
        // replay
        MissionProgramSchedule schedule = new MissionProgramSchedule().withImmediately(false).
            withIndefiniteInterval(false).withActive(true);
        MissionProgramParameters params = new MissionProgramParameters().withParameters().
            withSchedule(schedule).withProgramName("heyssdf");
        
        // verify 
        try
        {
            m_SUT.loadParameters(params);
            fail("The program is expected to fail creation because there is not a template name set.");
        }
        catch (IllegalArgumentException e)
        {
            //expecting exception
        }
        verify(m_PersistentDataStore, never()).persist(eq(MissionProgramManagerImpl.class), (UUID)Mockito.any(),
            anyString(), (Serializable)Mockito.any());
    }
/**
     * Test loading parameters that do not have a template name defined.
     * 
     * Verify error is thrown, and program is not created.
     */
Test loading parameters that do not have a template name defined.

Verify error is thrown, and program is not created.
Test loading parameters that do not have a template name defined . Verify error is thrown and program is not created .
@Test
    public void testAddProgramNoTemplateName() 
        throws IllegalArgumentException, PersistenceFailedException, MissionProgramException
    {
        setScriptEngineAndActivate();
        assertThat(m_SUT.getActiveProgramTemplateNames().size(), is(0));
        MissionProgramSchedule schedule = new MissionProgramSchedule().withImmediately(false).
            withIndefiniteInterval(false).withActive(true);
        MissionProgramParameters params = new MissionProgramParameters().withParameters().
            withSchedule(schedule).withProgramName("heyssdf");
        try
        {
            m_SUT.loadParameters(params);
            fail("The program is expected to fail creation because there is not a template name set.");
        }
        catch (IllegalArgumentException e)
        {
        }
        verify(m_PersistentDataStore, never()).persist(eq(MissionProgramManagerImpl.class), (UUID)Mockito.any(),
            anyString(), (Serializable)Mockito.any());
    }
@ Test public void testAddProgramNoTemplateName ( ) throws IllegalArgumentException , PersistenceFailedException , MissionProgramException { setScriptEngineAndActivate ( ) ; assertThat ( m_SUT . getActiveProgramTemplateNames ( ) . size ( ) , is ( 0 ) ) ; MissionProgramSchedule schedule = new MissionProgramSchedule ( ) . withImmediately ( false ) . withIndefiniteInterval ( false ) . withActive ( true ) ; MissionProgramParameters params = new MissionProgramParameters ( ) . withParameters ( ) . withSchedule ( schedule ) . withProgramName ( "heyssdf" ) ; try { m_SUT . loadParameters ( params ) ; fail ( "The program is expected to fail creation because there is not a template name set." ) ; } catch ( IllegalArgumentException e ) { } verify ( m_PersistentDataStore , never ( ) ) . persist ( eq ( MissionProgramManagerImpl . class ) , ( UUID ) Mockito . any ( ) , anyString ( ) , ( Serializable ) Mockito . any ( ) ) ; }
Test loading parameters that do not have a template name defined.
Test loading parameters that do not have a template name defined .
// mock // replay // verify  //expecting exception