mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestRemoteChannelLookupImpl.java
@Test
    public void testGetChannelSystemId()
    {
        // will add each channel with this id
        int systemId = 100;
        int systemId2 = 128;
        int systemId3 = 256;
        
        // mock generic channels
        RemoteChannel channel1 = mock(RemoteChannel.class);
        RemoteChannel channel2 = mock(RemoteChannel.class);
        RemoteChannel channel3 = mock(RemoteChannel.class);
        RemoteChannel channel4 = mock(RemoteChannel.class);
        RemoteChannel channel5 = mock(RemoteChannel.class);
        RemoteChannel channel6 = mock(RemoteChannel.class);
        
        
        // sync all the system id with the channel
        m_SUT.syncChannel(channel1, systemId);
        m_SUT.syncChannel(channel3, systemId);
        m_SUT.syncChannel(channel4, systemId2);
        m_SUT.syncChannel(channel5, systemId3);
        m_SUT.syncChannel(channel6, systemId3);
        
        //Verify the correct system ID is returned for the channel.
        assertThat(m_SUT.getChannelSystemId(channel1), is(100));
        assertThat(m_SUT.getChannelSystemId(channel3), is(100));
        assertThat(m_SUT.getChannelSystemId(channel4), is(128));
        assertThat(m_SUT.getChannelSystemId(channel5), is(256));
        assertThat(m_SUT.getChannelSystemId(channel6), is(256));
        
        //Verify an illegal argument exception is thrown for a channel that isn't associated with a system.
        try
        {
            m_SUT.getChannelSystemId(channel2);
            fail("Expecting exception since channel not associated with a system.");
        }
        catch (IllegalArgumentException e)
        {
            assertThat(e.getMessage(), is("Specified channel is not associated with a system!"));
        }
    }
/**
     * Verify the get channel system id will return the correct system id associate with the channel.
     */
Verify the get channel system id will return the correct system id associate with the channel.
Verify the get channel system id will return the correct system id associate with the channel .
@Test
    public void testGetChannelSystemId()
    {
        int systemId = 100;
        int systemId2 = 128;
        int systemId3 = 256;
        RemoteChannel channel1 = mock(RemoteChannel.class);
        RemoteChannel channel2 = mock(RemoteChannel.class);
        RemoteChannel channel3 = mock(RemoteChannel.class);
        RemoteChannel channel4 = mock(RemoteChannel.class);
        RemoteChannel channel5 = mock(RemoteChannel.class);
        RemoteChannel channel6 = mock(RemoteChannel.class);
        m_SUT.syncChannel(channel1, systemId);
        m_SUT.syncChannel(channel3, systemId);
        m_SUT.syncChannel(channel4, systemId2);
        m_SUT.syncChannel(channel5, systemId3);
        m_SUT.syncChannel(channel6, systemId3);
        assertThat(m_SUT.getChannelSystemId(channel1), is(100));
        assertThat(m_SUT.getChannelSystemId(channel3), is(100));
        assertThat(m_SUT.getChannelSystemId(channel4), is(128));
        assertThat(m_SUT.getChannelSystemId(channel5), is(256));
        assertThat(m_SUT.getChannelSystemId(channel6), is(256));
        try
        {
            m_SUT.getChannelSystemId(channel2);
            fail("Expecting exception since channel not associated with a system.");
        }
        catch (IllegalArgumentException e)
        {
            assertThat(e.getMessage(), is("Specified channel is not associated with a system!"));
        }
    }
@ Test public void testGetChannelSystemId ( ) { int systemId = 100 ; int systemId2 = 128 ; int systemId3 = 256 ; RemoteChannel channel1 = mock ( RemoteChannel . class ) ; RemoteChannel channel2 = mock ( RemoteChannel . class ) ; RemoteChannel channel3 = mock ( RemoteChannel . class ) ; RemoteChannel channel4 = mock ( RemoteChannel . class ) ; RemoteChannel channel5 = mock ( RemoteChannel . class ) ; RemoteChannel channel6 = mock ( RemoteChannel . class ) ; m_SUT . syncChannel ( channel1 , systemId ) ; m_SUT . syncChannel ( channel3 , systemId ) ; m_SUT . syncChannel ( channel4 , systemId2 ) ; m_SUT . syncChannel ( channel5 , systemId3 ) ; m_SUT . syncChannel ( channel6 , systemId3 ) ; assertThat ( m_SUT . getChannelSystemId ( channel1 ) , is ( 100 ) ) ; assertThat ( m_SUT . getChannelSystemId ( channel3 ) , is ( 100 ) ) ; assertThat ( m_SUT . getChannelSystemId ( channel4 ) , is ( 128 ) ) ; assertThat ( m_SUT . getChannelSystemId ( channel5 ) , is ( 256 ) ) ; assertThat ( m_SUT . getChannelSystemId ( channel6 ) , is ( 256 ) ) ; try { m_SUT . getChannelSystemId ( channel2 ) ; fail ( "Expecting exception since channel not associated with a system." ) ; } catch ( IllegalArgumentException e ) { assertThat ( e . getMessage ( ) , is ( "Specified channel is not associated with a system!" ) ) ; } }
Verify the get channel system id will return the correct system id associate with the channel.
Verify the get channel system id will return the correct system id associate with the channel .
// will add each channel with this id // mock generic channels // sync all the system id with the channel //Verify the correct system ID is returned for the channel. //Verify an illegal argument exception is thrown for a channel that isn't associated with a system.