mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestMissionProgramSchedulerImpl.java
@Test
    public void testTestExecutionStatePreserved() throws InterruptedException, PrivilegedActionException
    {
        //activate the component
        m_SUT.activate();
        
        //script behavior
        when(m_Script.test()).thenReturn(TestResult.PASSED);
        
        when(m_Program1.getProgramStatus()).thenReturn(ProgramStatus.SCHEDULED);
        
        //load the program
        m_SUT.testProgram(m_Program1);
        
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, timeout(1000)).postEvent(eventCaptor.capture());
        
        assertThat(eventCaptor.getValue().getTopic(), 
            is(Program.TOPIC_PROGRAM_TESTED));
        assertProgramEventProps(eventCaptor.getValue(), m_Program1);
        assertThat((TestResult)eventCaptor.getValue().getProperty(Program.EVENT_PROP_PROGRAM_TEST_RESULT), 
                is(TestResult.PASSED));
        
        //verify state preservation
        assertThat(m_Program1.getProgramStatus(), is(ProgramStatus.SCHEDULED));
    }
/**
     * Test that a program can be registered and test executed, the program is restored.
     * Verify that the state of mission is redeemed. 
     * Verify the program is test executed.
     */
Test that a program can be registered and test executed, the program is restored.
Verify that the state of mission is redeemed.
Verify the program is test executed.
Test that a program can be registered and test executed the program is restored . Verify that the state of mission is redeemed . Verify the program is test executed .
@Test
    public void testTestExecutionStatePreserved() throws InterruptedException, PrivilegedActionException
    {
        m_SUT.activate();
        when(m_Script.test()).thenReturn(TestResult.PASSED);
        when(m_Program1.getProgramStatus()).thenReturn(ProgramStatus.SCHEDULED);
        m_SUT.testProgram(m_Program1);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, timeout(1000)).postEvent(eventCaptor.capture());
        assertThat(eventCaptor.getValue().getTopic(), 
            is(Program.TOPIC_PROGRAM_TESTED));
        assertProgramEventProps(eventCaptor.getValue(), m_Program1);
        assertThat((TestResult)eventCaptor.getValue().getProperty(Program.EVENT_PROP_PROGRAM_TEST_RESULT), 
                is(TestResult.PASSED));
        assertThat(m_Program1.getProgramStatus(), is(ProgramStatus.SCHEDULED));
    }
@ Test public void testTestExecutionStatePreserved ( ) throws InterruptedException , PrivilegedActionException { m_SUT . activate ( ) ; when ( m_Script . test ( ) ) . thenReturn ( TestResult . PASSED ) ; when ( m_Program1 . getProgramStatus ( ) ) . thenReturn ( ProgramStatus . SCHEDULED ) ; m_SUT . testProgram ( m_Program1 ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin , timeout ( 1000 ) ) . postEvent ( eventCaptor . capture ( ) ) ; assertThat ( eventCaptor . getValue ( ) . getTopic ( ) , is ( Program . TOPIC_PROGRAM_TESTED ) ) ; assertProgramEventProps ( eventCaptor . getValue ( ) , m_Program1 ) ; assertThat ( ( TestResult ) eventCaptor . getValue ( ) . getProperty ( Program . EVENT_PROP_PROGRAM_TEST_RESULT ) , is ( TestResult . PASSED ) ) ; assertThat ( m_Program1 . getProgramStatus ( ) , is ( ProgramStatus . SCHEDULED ) ) ; }
Test that a program can be registered and test executed, the program is restored.
Test that a program can be registered and test executed the program is restored .
//activate the component //script behavior //load the program //verify state preservation