mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestRemoteChannelLookupImpl.java
@Test
    public void testHandleChannelEventClient()
    {
        BundleContext context = mock(BundleContext.class);
        RemoteChannel channel = mock(RemoteChannel.class);
        EventHandlerImpl handler = m_SUT.new EventHandlerImpl(context);
        
        //changed channel id
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(RemoteConstants.EVENT_PROP_CHANNEL, channel);
        properties.put(RemoteConstants.EVENT_PROP_SYS_ID, 1);
        
        Event event = new Event(RemoteConstants.TOPIC_NEW_OR_CHANGED_CHANNEL_ID, properties);
        
        handler.handleEvent(event);
        
        assertThat(m_SUT.getChannel(1), is(channel));
        
        //remove channel
        properties.clear();
        properties.put(RemoteConstants.EVENT_PROP_CHANNEL, channel);
        
        event = new Event(RemoteConstants.TOPIC_REMOVE_CHANNEL, properties);
        
        handler.handleEvent(event);
        
        assertThat(m_SUT.getChannels(1).size(), is(0));
    }
/**
     * Verify that TOPIC_NEW_OR_CHANGED_CHANNEL_ID event will sync channel with the new system id. 
     * 
     * Verify that TOPIC_REMOVE_CHANNEL event will cause remove to be called.
     */
Verify that TOPIC_NEW_OR_CHANGED_CHANNEL_ID event will sync channel with the new system id.

Verify that TOPIC_REMOVE_CHANNEL event will cause remove to be called.
Verify that TOPIC_NEW_OR_CHANGED_CHANNEL_ID event will sync channel with the new system id . Verify that TOPIC_REMOVE_CHANNEL event will cause remove to be called .
@Test
    public void testHandleChannelEventClient()
    {
        BundleContext context = mock(BundleContext.class);
        RemoteChannel channel = mock(RemoteChannel.class);
        EventHandlerImpl handler = m_SUT.new EventHandlerImpl(context);
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(RemoteConstants.EVENT_PROP_CHANNEL, channel);
        properties.put(RemoteConstants.EVENT_PROP_SYS_ID, 1);
        Event event = new Event(RemoteConstants.TOPIC_NEW_OR_CHANGED_CHANNEL_ID, properties);
        handler.handleEvent(event);
        assertThat(m_SUT.getChannel(1), is(channel));
        properties.clear();
        properties.put(RemoteConstants.EVENT_PROP_CHANNEL, channel);
        event = new Event(RemoteConstants.TOPIC_REMOVE_CHANNEL, properties);
        handler.handleEvent(event);
        assertThat(m_SUT.getChannels(1).size(), is(0));
    }
@ Test public void testHandleChannelEventClient ( ) { BundleContext context = mock ( BundleContext . class ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; EventHandlerImpl handler = m_SUT . new EventHandlerImpl ( context ) ; Map < String , Object > properties = new HashMap < String , Object > ( ) ; properties . put ( RemoteConstants . EVENT_PROP_CHANNEL , channel ) ; properties . put ( RemoteConstants . EVENT_PROP_SYS_ID , 1 ) ; Event event = new Event ( RemoteConstants . TOPIC_NEW_OR_CHANGED_CHANNEL_ID , properties ) ; handler . handleEvent ( event ) ; assertThat ( m_SUT . getChannel ( 1 ) , is ( channel ) ) ; properties . clear ( ) ; properties . put ( RemoteConstants . EVENT_PROP_CHANNEL , channel ) ; event = new Event ( RemoteConstants . TOPIC_REMOVE_CHANNEL , properties ) ; handler . handleEvent ( event ) ; assertThat ( m_SUT . getChannels ( 1 ) . size ( ) , is ( 0 ) ) ; }
Verify that TOPIC_NEW_OR_CHANGED_CHANNEL_ID event will sync channel with the new system id.
Verify that TOPIC_NEW_OR_CHANGED_CHANNEL_ID event will sync channel with the new system id .
//changed channel id //remove channel