mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/channel/TestChannelEventWrapper.java
@Test
    public void testHandleEvent()
    {
        Event nonRemovedEvent = PowerMockito.mock(Event.class);
        when(nonRemovedEvent.getTopic()).thenReturn(RemoteChannelLookup.TOPIC_CHANNEL_UPDATED);
        
        Event removedEvent = PowerMockito.mock(Event.class);
        when(removedEvent.getTopic()).thenReturn(RemoteChannelLookup.TOPIC_CHANNEL_REMOVED);
        
        m_SUT.handleEvent(nonRemovedEvent);
        m_SUT.handleEvent(removedEvent);
        
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, times(2)).postEvent(eventCaptor.capture());
        
        Event channelUpdated = eventCaptor.getAllValues().get(0);
        assertThat(channelUpdated.getTopic(), is(ChannelEventWrapper.TOPIC_CHANNEL_UPDATED));
       
        Event channelRemoved = eventCaptor.getAllValues().get(1);
        assertThat(channelRemoved.getTopic(), is(ChannelEventWrapper.TOPIC_CHANNEL_REMOVED));
    }
/**
     * Verify RemoteChannelLookup channel updated and removed events are properly
     * translated into local gui events.
     */
Verify RemoteChannelLookup channel updated and removed events are properly
translated into local gui events.
Verify RemoteChannelLookup channel updated and removed events are properly translated into local gui events .
@Test
    public void testHandleEvent()
    {
        Event nonRemovedEvent = PowerMockito.mock(Event.class);
        when(nonRemovedEvent.getTopic()).thenReturn(RemoteChannelLookup.TOPIC_CHANNEL_UPDATED);
        Event removedEvent = PowerMockito.mock(Event.class);
        when(removedEvent.getTopic()).thenReturn(RemoteChannelLookup.TOPIC_CHANNEL_REMOVED);
        m_SUT.handleEvent(nonRemovedEvent);
        m_SUT.handleEvent(removedEvent);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, times(2)).postEvent(eventCaptor.capture());
        Event channelUpdated = eventCaptor.getAllValues().get(0);
        assertThat(channelUpdated.getTopic(), is(ChannelEventWrapper.TOPIC_CHANNEL_UPDATED));
        Event channelRemoved = eventCaptor.getAllValues().get(1);
        assertThat(channelRemoved.getTopic(), is(ChannelEventWrapper.TOPIC_CHANNEL_REMOVED));
    }
@ Test public void testHandleEvent ( ) { Event nonRemovedEvent = PowerMockito . mock ( Event . class ) ; when ( nonRemovedEvent . getTopic ( ) ) . thenReturn ( RemoteChannelLookup . TOPIC_CHANNEL_UPDATED ) ; Event removedEvent = PowerMockito . mock ( Event . class ) ; when ( removedEvent . getTopic ( ) ) . thenReturn ( RemoteChannelLookup . TOPIC_CHANNEL_REMOVED ) ; m_SUT . handleEvent ( nonRemovedEvent ) ; m_SUT . handleEvent ( removedEvent ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin , times ( 2 ) ) . postEvent ( eventCaptor . capture ( ) ) ; Event channelUpdated = eventCaptor . getAllValues ( ) . get ( 0 ) ; assertThat ( channelUpdated . getTopic ( ) , is ( ChannelEventWrapper . TOPIC_CHANNEL_UPDATED ) ) ; Event channelRemoved = eventCaptor . getAllValues ( ) . get ( 1 ) ; assertThat ( channelRemoved . getTopic ( ) , is ( ChannelEventWrapper . TOPIC_CHANNEL_REMOVED ) ) ; }
Verify RemoteChannelLookup channel updated and removed events are properly
 translated into local gui events.
Verify RemoteChannelLookup channel updated and removed events are properly translated into local gui events .