Search in sources :

Example 1 with ShutdownRegistryImpl

use of com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl in project commons by twitter.

the class ServerSetModuleTest method mySetUp.

@Before
public void mySetUp() {
    control = EasyMock.createControl();
    serverSet = control.createMock(ServerSet.class);
    shutdownRegistry = new ShutdownRegistryImpl();
    zooKeeperClient = createZkClient();
    Set<ServiceRunner> localServices = ImmutableSet.of();
    localServiceRegistry = new LocalServiceRegistry(Providers.of(localServices), shutdownRegistry);
}
Also used : LocalServiceRegistry(com.twitter.common.application.modules.LocalServiceRegistry) ServerSet(com.twitter.common.zookeeper.ServerSet) ShutdownRegistryImpl(com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl) ServiceRunner(com.twitter.common.application.modules.LifecycleModule.ServiceRunner) Before(org.junit.Before)

Example 2 with ShutdownRegistryImpl

use of com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl in project commons by twitter.

the class BaseZooKeeperTest method setUp.

@Before
public final void setUp() throws Exception {
    final ShutdownRegistryImpl shutdownRegistry = new ShutdownRegistryImpl();
    addTearDown(new TearDown() {

        @Override
        public void tearDown() {
            shutdownRegistry.execute();
        }
    });
    zkTestServer = new ZooKeeperTestServer(0, shutdownRegistry, defaultSessionTimeout);
    zkTestServer.startNetwork();
}
Also used : TearDown(com.google.common.testing.TearDown) ShutdownRegistryImpl(com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl) Before(org.junit.Before)

Aggregations

ShutdownRegistryImpl (com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl)2 Before (org.junit.Before)2 TearDown (com.google.common.testing.TearDown)1 ServiceRunner (com.twitter.common.application.modules.LifecycleModule.ServiceRunner)1 LocalServiceRegistry (com.twitter.common.application.modules.LocalServiceRegistry)1 ServerSet (com.twitter.common.zookeeper.ServerSet)1