mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/mp/TestMissionProgrammingMessageService.java
@Test
    public void testShutdownExecutors() throws IllegalArgumentException, IOException
    {
        //request
        ManagedExecutorsShutdownRequestData request = ManagedExecutorsShutdownRequestData.newBuilder().
                setShutdownNow(false).build();
        MissionProgrammingNamespace missionMessage = MissionProgrammingNamespace.newBuilder().
                setType(MissionProgrammingMessageType.ManagedExecutorsShutdownRequest).
                setData(request.toByteString()).build();
        TerraHarvestMessage message = createMissionProgrammingMessage(missionMessage);
        
        RemoteChannel channel = mock(RemoteChannel.class);
        
        m_SUT.handleMessage(message, createPayload(missionMessage), channel);
        
        //verify interaction
        verify(m_ManagedExecutors).shutdownAllExecutorServices();
        
        // verify the event
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat((ManagedExecutorsShutdownRequestData)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(request));
        
        //verify response
        verify(m_MessageFactory).createMissionProgrammingResponseMessage(message, 
                MissionProgrammingMessageType.ManagedExecutorsShutdownResponse, null);
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Test requesting the managed executor service to shutdown.
     * Verify response and the interaction with that service.
     */
Test requesting the managed executor service to shutdown.
Verify response and the interaction with that service.
Test requesting the managed executor service to shutdown . Verify response and the interaction with that service .
@Test
    public void testShutdownExecutors() throws IllegalArgumentException, IOException
    {
        ManagedExecutorsShutdownRequestData request = ManagedExecutorsShutdownRequestData.newBuilder().
                setShutdownNow(false).build();
        MissionProgrammingNamespace missionMessage = MissionProgrammingNamespace.newBuilder().
                setType(MissionProgrammingMessageType.ManagedExecutorsShutdownRequest).
                setData(request.toByteString()).build();
        TerraHarvestMessage message = createMissionProgrammingMessage(missionMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, createPayload(missionMessage), channel);
        verify(m_ManagedExecutors).shutdownAllExecutorServices();
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat((ManagedExecutorsShutdownRequestData)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(request));
        verify(m_MessageFactory).createMissionProgrammingResponseMessage(message, 
                MissionProgrammingMessageType.ManagedExecutorsShutdownResponse, null);
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testShutdownExecutors ( ) throws IllegalArgumentException , IOException { ManagedExecutorsShutdownRequestData request = ManagedExecutorsShutdownRequestData . newBuilder ( ) . setShutdownNow ( false ) . build ( ) ; MissionProgrammingNamespace missionMessage = MissionProgrammingNamespace . newBuilder ( ) . setType ( MissionProgrammingMessageType . ManagedExecutorsShutdownRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestMessage message = createMissionProgrammingMessage ( missionMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , createPayload ( missionMessage ) , channel ) ; verify ( m_ManagedExecutors ) . shutdownAllExecutorServices ( ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event event = eventCaptor . getValue ( ) ; assertThat ( ( ManagedExecutorsShutdownRequestData ) event . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( request ) ) ; verify ( m_MessageFactory ) . createMissionProgrammingResponseMessage ( message , MissionProgrammingMessageType . ManagedExecutorsShutdownResponse , null ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Test requesting the managed executor service to shutdown.
Test requesting the managed executor service to shutdown .
//request //verify interaction // verify the event //verify response