mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestRemoteChannelLookupImpl.java
@SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void testNewServerSocketChannel()
    {
        // mock the input
        Socket socket = mock(Socket.class);
        
        // run the method to test
        SocketChannel channel = m_SUT.newServerSocketChannel(socket);
        
        // should be the socket channel that gets created by the factory
        ArgumentCaptor<Dictionary> dictionaryCaptor = ArgumentCaptor.forClass(Dictionary.class);
        verify(m_ServerSocketChannelFactory).newInstance(dictionaryCaptor.capture());
        assertThat(channel, is(m_ServerSocketChannel));
        // verify socket is created with proper properties
        assertThat((Socket)dictionaryCaptor.getValue().get(ServerSocketChannel.SOCKET_PROP_KEY), is(socket));
    }
/**
     * Verify that this will create a new server socket channel, no need to check lookup though as it won't be there 
     * yet.
     */
Verify that this will create a new server socket channel, no need to check lookup though as it won't be there
yet.
Verify that this will create a new server socket channel no need to check lookup though as it won ' t be there yet .
@SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void testNewServerSocketChannel()
    {
        Socket socket = mock(Socket.class);
        SocketChannel channel = m_SUT.newServerSocketChannel(socket);
        ArgumentCaptor<Dictionary> dictionaryCaptor = ArgumentCaptor.forClass(Dictionary.class);
        verify(m_ServerSocketChannelFactory).newInstance(dictionaryCaptor.capture());
        assertThat(channel, is(m_ServerSocketChannel));
        assertThat((Socket)dictionaryCaptor.getValue().get(ServerSocketChannel.SOCKET_PROP_KEY), is(socket));
    }
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) @ Test public void testNewServerSocketChannel ( ) { Socket socket = mock ( Socket . class ) ; SocketChannel channel = m_SUT . newServerSocketChannel ( socket ) ; ArgumentCaptor < Dictionary > dictionaryCaptor = ArgumentCaptor . forClass ( Dictionary . class ) ; verify ( m_ServerSocketChannelFactory ) . newInstance ( dictionaryCaptor . capture ( ) ) ; assertThat ( channel , is ( m_ServerSocketChannel ) ) ; assertThat ( ( Socket ) dictionaryCaptor . getValue ( ) . get ( ServerSocketChannel . SOCKET_PROP_KEY ) , is ( socket ) ) ; }
Verify that this will create a new server socket channel, no need to check lookup though as it won't be there
 yet.
Verify that this will create a new server socket channel no need to check lookup though as it won ' t be there yet .
// mock the input // run the method to test // should be the socket channel that gets created by the factory // verify socket is created with proper properties