Пример #1
0
 @Test
 public void testSetConfiguration() throws Throwable {
   ChannelPool channelPool = new ChannelPool();
   Configuration cfg = new SimpleConfiguration();
   channelPool.setConfiguration(cfg);
   assertSame("channelPool.cfg", cfg, channelPool.cfg);
 }
Пример #2
0
 @Test
 public void testSetConfigurationThrowsNullPointerException() throws Throwable {
   ChannelPool channelPool = new ChannelPool();
   Configuration cfg = new SubConfiguration();
   try {
     channelPool.setConfiguration(cfg);
     fail("Expected NullPointerException to be thrown");
   } catch (NullPointerException ex) {
     assertSame("channelPool.cfg", cfg, channelPool.cfg);
     assertNull("ex.getMessage()", ex.getMessage());
     assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
   }
 }