@Test public void testRemoveChannelThrowsNotFoundException() throws Throwable { ChannelPool channelPool = new ChannelPool(); try { channelPool.removeChannel("testChannelPoolName1"); fail("Expected NotFoundException to be thrown"); } catch (NameRegistrar.NotFoundException ex) { assertEquals("ex.getMessage()", "channel.testChannelPoolName1", ex.getMessage()); assertEquals("channelPool.pool.size()", 0, channelPool.pool.size()); } }
@Test public void testRemoveChannel() throws Throwable { ChannelPool channelPool = new ChannelPool(); channelPool.removeChannel(new BASE24TCPChannel()); assertEquals("channelPool.pool.size()", 0, channelPool.pool.size()); }