mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/transport/TestTransportChannelImpl.java
@Test
    public void testTrySendMessageInvalidAddress() throws IOException, CCommException
    {
        // Connection-less channel that is available
        activateChannel(false, true, null);

        // construct a single base namespace message to verify sent to socket
        TerraHarvestMessage message = TerraHarvestMessageHelper.createBaseMessage();

        when(m_AddressManagerService.getOrCreateAddress("remote-addr"))
            .thenThrow(new CCommException(FormatProblem.OTHER));

        // replay
        boolean sent = m_SUT.trySendMessage(message);
        assertThat("failed to send message as address is invalid", sent, is(false));

        //check that status is unavailable
        assertThat(m_SUT.getStatus(), is(ChannelStatus.Unavailable));
    }
/**
     * Verify the exception is thrown if inner exception is thrown when looking up address
     */
Verify the exception is thrown if inner exception is thrown when looking up address
Verify the exception is thrown if inner exception is thrown when looking up address
@Test
    public void testTrySendMessageInvalidAddress() throws IOException, CCommException
    {
        activateChannel(false, true, null);
        TerraHarvestMessage message = TerraHarvestMessageHelper.createBaseMessage();
        when(m_AddressManagerService.getOrCreateAddress("remote-addr"))
            .thenThrow(new CCommException(FormatProblem.OTHER));
        boolean sent = m_SUT.trySendMessage(message);
        assertThat("failed to send message as address is invalid", sent, is(false));
        assertThat(m_SUT.getStatus(), is(ChannelStatus.Unavailable));
    }
@ Test public void testTrySendMessageInvalidAddress ( ) throws IOException , CCommException { activateChannel ( false , true , null ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createBaseMessage ( ) ; when ( m_AddressManagerService . getOrCreateAddress ( "remote-addr" ) ) . thenThrow ( new CCommException ( FormatProblem . OTHER ) ) ; boolean sent = m_SUT . trySendMessage ( message ) ; assertThat ( "failed to send message as address is invalid" , sent , is ( false ) ) ; assertThat ( m_SUT . getStatus ( ) , is ( ChannelStatus . Unavailable ) ) ; }
Verify the exception is thrown if inner exception is thrown when looking up address
Verify the exception is thrown if inner exception is thrown when looking up address
// Connection-less channel that is available // construct a single base namespace message to verify sent to socket // replay //check that status is unavailable