Пример #1
0
 @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);
 }
Пример #2
0
 @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);
   }
 }
Пример #3
0
 @Test
 public void testDisconnect1() throws Throwable {
   ChannelPool channelPool = new ChannelPool();
   channelPool.disconnect();
   assertNull("channelPool.current", channelPool.current);
 }