mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestRemoteChannelLookupImpl.java
@Test
    public void testGetChannelsForSystem()
    {
        // add channels with these ids
        int systemIdA = 897;
        int systemIdB = 1417;
        int systemIdC = 321;
        
        // mock socket channels
        RemoteChannel socketChannel1 = mock(SocketChannel.class);
        RemoteChannel socketChannel2 = mock(SocketChannel.class);
        
        stubTransportChannel(m_TransportChannel, "hamburger", "cheese", "bacon");
        
        // sync channels to different ids
        m_SUT.syncChannel(socketChannel1, systemIdA);
        m_SUT.syncChannel(socketChannel2, systemIdB);
        m_SUT.syncTransportChannel("hamburger", "cheese", "bacon", systemIdC);
        m_SUT.syncChannel(socketChannel1, systemIdC);  // sync channel to new id
        m_SUT.syncTransportChannel("hamburger", "cheese", "bacon", systemIdA);
        
        // systemIdA should only have 1 as the other one was synced to a new location
        assertThat(m_SUT.getAllChannels().get(systemIdA).size(), is(1));
        assertThat(m_SUT.getAllChannels().get(systemIdB).size(), is(1));
        assertThat(m_SUT.getAllChannels().get(systemIdC).size(), is(2));
    }
/**
     * Verify that a map of all channels is returned if multiple channels to one controller are registered.
     */
Verify that a map of all channels is returned if multiple channels to one controller are registered.
Verify that a map of all channels is returned if multiple channels to one controller are registered .
@Test
    public void testGetChannelsForSystem()
    {
        int systemIdA = 897;
        int systemIdB = 1417;
        int systemIdC = 321;
        RemoteChannel socketChannel1 = mock(SocketChannel.class);
        RemoteChannel socketChannel2 = mock(SocketChannel.class);
        stubTransportChannel(m_TransportChannel, "hamburger", "cheese", "bacon");
        m_SUT.syncChannel(socketChannel1, systemIdA);
        m_SUT.syncChannel(socketChannel2, systemIdB);
        m_SUT.syncTransportChannel("hamburger", "cheese", "bacon", systemIdC);
        m_SUT.syncChannel(socketChannel1, systemIdC);  
        m_SUT.syncTransportChannel("hamburger", "cheese", "bacon", systemIdA);
        assertThat(m_SUT.getAllChannels().get(systemIdA).size(), is(1));
        assertThat(m_SUT.getAllChannels().get(systemIdB).size(), is(1));
        assertThat(m_SUT.getAllChannels().get(systemIdC).size(), is(2));
    }
@ Test public void testGetChannelsForSystem ( ) { int systemIdA = 897 ; int systemIdB = 1417 ; int systemIdC = 321 ; RemoteChannel socketChannel1 = mock ( SocketChannel . class ) ; RemoteChannel socketChannel2 = mock ( SocketChannel . class ) ; stubTransportChannel ( m_TransportChannel , "hamburger" , "cheese" , "bacon" ) ; m_SUT . syncChannel ( socketChannel1 , systemIdA ) ; m_SUT . syncChannel ( socketChannel2 , systemIdB ) ; m_SUT . syncTransportChannel ( "hamburger" , "cheese" , "bacon" , systemIdC ) ; m_SUT . syncChannel ( socketChannel1 , systemIdC ) ; m_SUT . syncTransportChannel ( "hamburger" , "cheese" , "bacon" , systemIdA ) ; assertThat ( m_SUT . getAllChannels ( ) . get ( systemIdA ) . size ( ) , is ( 1 ) ) ; assertThat ( m_SUT . getAllChannels ( ) . get ( systemIdB ) . size ( ) , is ( 1 ) ) ; assertThat ( m_SUT . getAllChannels ( ) . get ( systemIdC ) . size ( ) , is ( 2 ) ) ; }
Verify that a map of all channels is returned if multiple channels to one controller are registered.
Verify that a map of all channels is returned if multiple channels to one controller are registered .
// add channels with these ids // mock socket channels // sync channels to different ids // sync channel to new id // systemIdA should only have 1 as the other one was synced to a new location