mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestRemoteChannelLookupImpl.java
@SuppressWarnings("unchecked")
    @Test
    public void testGetChannel()
    {
        // first verify exception if invalid channel is given
        try
        {
            m_SUT.getChannel(2);
            fail("Expecting exception since channel is no longer associated with this id");
        }
        catch (IllegalArgumentException e)
        {
            
        }

        // will add each channel with this id
        int systemId = 100;
        
        // mock generic channels and 1 transport channel
        RemoteChannel channel1 = mock(RemoteChannel.class);
        RemoteChannel channel2 = mock(RemoteChannel.class);
        
        stubTransportChannel(m_TransportChannel, "tl-3", "tl3:4-5", "tl3:4-6");
        
        // sync all to the same system id
        m_SUT.syncChannel(channel1, systemId);
        m_SUT.syncChannel(channel2, systemId);
        m_SUT.syncTransportChannel("tl-3", "tl3:4-5", "tl3:4-6", systemId);
        
        // transport layer should be created since it is new
        verify(m_TransportChannelFactory, times(1)).newInstance(Mockito.any(Dictionary.class));
        
        assertThat(m_SUT.getChannel(systemId), is(notNullValue()));
    }
/**
     * Verify get channel call will return a channel if there are multiple channels for a given id. 
     */
Verify get channel call will return a channel if there are multiple channels for a given id.
Verify get channel call will return a channel if there are multiple channels for a given id .
@SuppressWarnings("unchecked")
    @Test
    public void testGetChannel()
    {
        try
        {
            m_SUT.getChannel(2);
            fail("Expecting exception since channel is no longer associated with this id");
        }
        catch (IllegalArgumentException e)
        {
        }
        int systemId = 100;
        RemoteChannel channel1 = mock(RemoteChannel.class);
        RemoteChannel channel2 = mock(RemoteChannel.class);
        stubTransportChannel(m_TransportChannel, "tl-3", "tl3:4-5", "tl3:4-6");
        m_SUT.syncChannel(channel1, systemId);
        m_SUT.syncChannel(channel2, systemId);
        m_SUT.syncTransportChannel("tl-3", "tl3:4-5", "tl3:4-6", systemId);
        verify(m_TransportChannelFactory, times(1)).newInstance(Mockito.any(Dictionary.class));
        assertThat(m_SUT.getChannel(systemId), is(notNullValue()));
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testGetChannel ( ) { try { m_SUT . getChannel ( 2 ) ; fail ( "Expecting exception since channel is no longer associated with this id" ) ; } catch ( IllegalArgumentException e ) { } int systemId = 100 ; RemoteChannel channel1 = mock ( RemoteChannel . class ) ; RemoteChannel channel2 = mock ( RemoteChannel . class ) ; stubTransportChannel ( m_TransportChannel , "tl-3" , "tl3:4-5" , "tl3:4-6" ) ; m_SUT . syncChannel ( channel1 , systemId ) ; m_SUT . syncChannel ( channel2 , systemId ) ; m_SUT . syncTransportChannel ( "tl-3" , "tl3:4-5" , "tl3:4-6" , systemId ) ; verify ( m_TransportChannelFactory , times ( 1 ) ) . newInstance ( Mockito . any ( Dictionary . class ) ) ; assertThat ( m_SUT . getChannel ( systemId ) , is ( notNullValue ( ) ) ) ; }
Verify get channel call will return a channel if there are multiple channels for a given id.
Verify get channel call will return a channel if there are multiple channels for a given id .
// first verify exception if invalid channel is given // will add each channel with this id // mock generic channels and 1 transport channel // sync all to the same system id // transport layer should be created since it is new