Search in sources :

Example 1 with MonitorException

use of com.twitter.common.net.pool.DynamicHostSet.MonitorException in project commons by twitter.

the class CompoundServerSetTest method testMonitorFailure.

@Test(expected = MonitorException.class)
public void testMonitorFailure() throws Exception {
    serverSet1.watch(EasyMock.<HostChangeMonitor<ServiceInstance>>anyObject());
    expectLastCall().andThrow(new MonitorException("Monitor exception", null));
    control.replay();
    compoundServerSet.watch(compoundMonitor);
}
Also used : ServiceInstance(com.twitter.thrift.ServiceInstance) MonitorException(com.twitter.common.net.pool.DynamicHostSet.MonitorException) EasyMockTest(com.twitter.common.testing.easymock.EasyMockTest) Test(org.junit.Test)

Aggregations

MonitorException (com.twitter.common.net.pool.DynamicHostSet.MonitorException)1 EasyMockTest (com.twitter.common.testing.easymock.EasyMockTest)1 ServiceInstance (com.twitter.thrift.ServiceInstance)1 Test (org.junit.Test)1