mil.dod.th.remote.client/test/mil/dod/th/remote/client/impl/TestMessageSenderServiceImpl.java
@Test
    public void testAddRemoveRemoteChannel()
    {
        m_SUT.addRemoteChannel(DEST_ID, m_OutStream, m_ChannelCallback);

        m_SUT.removeRemoteChannel(DEST_ID);
        verify(m_ChannelCallback).onChannelRemoved(DEST_ID);

        // Should not be able to remove channel twice
        try
        {
            m_SUT.removeRemoteChannel(DEST_ID);
            fail("removeRemoteChannel should throw IllegalArgumentException");
        }
        catch (IllegalArgumentException e)
        {
            // Expected;
        }
    }
/**
     * Verify that a remote channel can be added and removed with appropriate callbacks made.
     */
Verify that a remote channel can be added and removed with appropriate callbacks made.
Verify that a remote channel can be added and removed with appropriate callbacks made .
@Test
    public void testAddRemoveRemoteChannel()
    {
        m_SUT.addRemoteChannel(DEST_ID, m_OutStream, m_ChannelCallback);
        m_SUT.removeRemoteChannel(DEST_ID);
        verify(m_ChannelCallback).onChannelRemoved(DEST_ID);
        try
        {
            m_SUT.removeRemoteChannel(DEST_ID);
            fail("removeRemoteChannel should throw IllegalArgumentException");
        }
        catch (IllegalArgumentException e)
        {
        }
    }
@ Test public void testAddRemoveRemoteChannel ( ) { m_SUT . addRemoteChannel ( DEST_ID , m_OutStream , m_ChannelCallback ) ; m_SUT . removeRemoteChannel ( DEST_ID ) ; verify ( m_ChannelCallback ) . onChannelRemoved ( DEST_ID ) ; try { m_SUT . removeRemoteChannel ( DEST_ID ) ; fail ( "removeRemoteChannel should throw IllegalArgumentException" ) ; } catch ( IllegalArgumentException e ) { } }
Verify that a remote channel can be added and removed with appropriate callbacks made.
Verify that a remote channel can be added and removed with appropriate callbacks made .
// Should not be able to remove channel twice // Expected;