@Test public void testDisconnect() throws Throwable { ChannelPool channelPool = new ChannelPool(); channelPool.addChannel(new BASE24TCPChannel()); channelPool.disconnect(); assertEquals("channelPool.pool.size()", 1, channelPool.pool.size()); assertNull("channelPool.current", channelPool.current); }
@Test public void testDisconnectThrowsNullPointerException1() throws Throwable { ChannelPool channelPool = new ChannelPool(); channelPool.addChannel((ISOChannel) null); try { channelPool.disconnect(); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertEquals("channelPool.pool.size()", 1, channelPool.pool.size()); assertNull("channelPool.current", channelPool.current); } }
@Test public void testDisconnect1() throws Throwable { ChannelPool channelPool = new ChannelPool(); channelPool.disconnect(); assertNull("channelPool.current", channelPool.current); }