mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/transport/TestTransportChannelImpl.java
@Test
    public void testMatches() throws CCommException
    {
        Map<String, Object> extraProps = new HashMap<String, Object>();
        extraProps.put(ComponentConstants.COMPONENT_ID, 23);
        extraProps.put(ComponentConstants.COMPONENT_NAME, TransportChannelImpl.class.getName());
        extraProps.put("some random value that might be there", "blah");
        
        // Connection-less channel that is available
        activateChannel(false, true, extraProps);

        // different props should not match
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(TransportChannelImpl.TRANSPORT_NAME_PROP_KEY, "tl2");
        props.put(TransportChannelImpl.LOCAL_ADDRESS_PROP_KEY, "local-addr2");
        props.put(TransportChannelImpl.REMOTE_ADDRESS_PROP_KEY, "remote-addr2");
        assertThat(m_SUT.matches(props), is(false));
        
        // same props for transport and address should match, should ignore default props of a component set by OSGi
        props.put(TransportChannelImpl.TRANSPORT_NAME_PROP_KEY, "tl1");
        props.put(TransportChannelImpl.LOCAL_ADDRESS_PROP_KEY, "local-addr");
        props.put(TransportChannelImpl.REMOTE_ADDRESS_PROP_KEY, "remote-addr");
        assertThat(m_SUT.matches(props), is(true));
    }
/**
     * Verify the matches method returns true if the transport layer and address properties match
     */
Verify the matches method returns true if the transport layer and address properties match
Verify the matches method returns true if the transport layer and address properties match
@Test
    public void testMatches() throws CCommException
    {
        Map<String, Object> extraProps = new HashMap<String, Object>();
        extraProps.put(ComponentConstants.COMPONENT_ID, 23);
        extraProps.put(ComponentConstants.COMPONENT_NAME, TransportChannelImpl.class.getName());
        extraProps.put("some random value that might be there", "blah");
        activateChannel(false, true, extraProps);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(TransportChannelImpl.TRANSPORT_NAME_PROP_KEY, "tl2");
        props.put(TransportChannelImpl.LOCAL_ADDRESS_PROP_KEY, "local-addr2");
        props.put(TransportChannelImpl.REMOTE_ADDRESS_PROP_KEY, "remote-addr2");
        assertThat(m_SUT.matches(props), is(false));
        props.put(TransportChannelImpl.TRANSPORT_NAME_PROP_KEY, "tl1");
        props.put(TransportChannelImpl.LOCAL_ADDRESS_PROP_KEY, "local-addr");
        props.put(TransportChannelImpl.REMOTE_ADDRESS_PROP_KEY, "remote-addr");
        assertThat(m_SUT.matches(props), is(true));
    }
@ Test public void testMatches ( ) throws CCommException { Map < String , Object > extraProps = new HashMap < String , Object > ( ) ; extraProps . put ( ComponentConstants . COMPONENT_ID , 23 ) ; extraProps . put ( ComponentConstants . COMPONENT_NAME , TransportChannelImpl . class . getName ( ) ) ; extraProps . put ( "some random value that might be there" , "blah" ) ; activateChannel ( false , true , extraProps ) ; Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( TransportChannelImpl . TRANSPORT_NAME_PROP_KEY , "tl2" ) ; props . put ( TransportChannelImpl . LOCAL_ADDRESS_PROP_KEY , "local-addr2" ) ; props . put ( TransportChannelImpl . REMOTE_ADDRESS_PROP_KEY , "remote-addr2" ) ; assertThat ( m_SUT . matches ( props ) , is ( false ) ) ; props . put ( TransportChannelImpl . TRANSPORT_NAME_PROP_KEY , "tl1" ) ; props . put ( TransportChannelImpl . LOCAL_ADDRESS_PROP_KEY , "local-addr" ) ; props . put ( TransportChannelImpl . REMOTE_ADDRESS_PROP_KEY , "remote-addr" ) ; assertThat ( m_SUT . matches ( props ) , is ( true ) ) ; }
Verify the matches method returns true if the transport layer and address properties match
Verify the matches method returns true if the transport layer and address properties match
// Connection-less channel that is available // different props should not match // same props for transport and address should match, should ignore default props of a component set by OSGi