mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestMissionProgramSchedulerImpl.java
@Test
    public void testTestExecution() throws InterruptedException, PrivilegedActionException
    {
        //activate the component
        m_SUT.activate();
        
        //script behavior
        when(m_Script.test()).thenReturn(TestResult.PASSED);
        
        //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));
    }
/**
     * Test that a program can be registered and test executed.
     * Verify the program is test executed.
     */
Test that a program can be registered and test executed.
Verify the program is test executed.
Test that a program can be registered and test executed . Verify the program is test executed .
@Test
    public void testTestExecution() throws InterruptedException, PrivilegedActionException
    {
        m_SUT.activate();
        when(m_Script.test()).thenReturn(TestResult.PASSED);
        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));
    }
@ Test public void testTestExecution ( ) throws InterruptedException , PrivilegedActionException { m_SUT . activate ( ) ; when ( m_Script . test ( ) ) . thenReturn ( TestResult . PASSED ) ; 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 ) ) ; }
Test that a program can be registered and test executed.
Test that a program can be registered and test executed .
//activate the component //script behavior //load the program