mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/channel/TestChannelMgrImpl.java
private SocketChannel createMockSocketChannel(String hostName, int portNum, ChannelStatus status)
    {
      //mocking
        SocketChannel socketChannel = mock(SocketChannel.class);
        when(socketChannel.getChannelType()).thenReturn(RemoteChannelTypeEnum.SOCKET);
        when(socketChannel.getStatus()).thenReturn(status);
        when(socketChannel.getHost()).thenReturn(hostName);
        when(socketChannel.getPort()).thenReturn(portNum);
        when(socketChannel.getBytesTransmitted()).thenReturn(991L);
        when(socketChannel.getBytesReceived()).thenReturn(402L);
        when(socketChannel.getQueuedMessageCount()).thenReturn(1);
        
        return socketChannel;
    }
/**
     * Creates a mocked socket channel based on the hostname and port number 
     * passed in.
     * @param hostName
     *  the hostname that the mocked socket channel should have.
     * @param portNum
     *  the port number that the mocked socket should have
     * @param status
     *  the status of the channel
     * @return
     *  the mocked socket channel
     */
Creates a mocked socket channel based on the hostname and port number
passed in.
@param hostName
the hostname that the mocked socket channel should have.
@param portNum
the port number that the mocked socket should have
@param status
the status of the channel
@return
the mocked socket channel
Creates a mocked socket channel based on the hostname and port number passed in . @param hostName the hostname that the mocked socket channel should have . @param portNum the port number that the mocked socket should have @param status the status of the channel @return the mocked socket channel
private SocketChannel createMockSocketChannel(String hostName, int portNum, ChannelStatus status)
    {
        SocketChannel socketChannel = mock(SocketChannel.class);
        when(socketChannel.getChannelType()).thenReturn(RemoteChannelTypeEnum.SOCKET);
        when(socketChannel.getStatus()).thenReturn(status);
        when(socketChannel.getHost()).thenReturn(hostName);
        when(socketChannel.getPort()).thenReturn(portNum);
        when(socketChannel.getBytesTransmitted()).thenReturn(991L);
        when(socketChannel.getBytesReceived()).thenReturn(402L);
        when(socketChannel.getQueuedMessageCount()).thenReturn(1);
        return socketChannel;
    }
private SocketChannel createMockSocketChannel ( String hostName , int portNum , ChannelStatus status ) { SocketChannel socketChannel = mock ( SocketChannel . class ) ; when ( socketChannel . getChannelType ( ) ) . thenReturn ( RemoteChannelTypeEnum . SOCKET ) ; when ( socketChannel . getStatus ( ) ) . thenReturn ( status ) ; when ( socketChannel . getHost ( ) ) . thenReturn ( hostName ) ; when ( socketChannel . getPort ( ) ) . thenReturn ( portNum ) ; when ( socketChannel . getBytesTransmitted ( ) ) . thenReturn ( 991L ) ; when ( socketChannel . getBytesReceived ( ) ) . thenReturn ( 402L ) ; when ( socketChannel . getQueuedMessageCount ( ) ) . thenReturn ( 1 ) ; return socketChannel ; }
Creates a mocked socket channel based on the hostname and port number
 passed in.
Creates a mocked socket channel based on the hostname and port number passed in .
//mocking