/** @throws java.lang.Exception */ @After public void tearDown() throws Exception { client.shutdown(); client.waitForShutdown(); dispatcher.shutdown(); dispatcher.waitForShutdown(); }
/** @throws java.lang.Exception */ @Before public void setUp() throws Exception { config = new ReplicationConfig( RequestHandlerTest.class.getResource("/config/replication_server0.test").getPath(), conf0); dispatcher = new RequestDispatcher(config); dispatcher.setLifeCycleListener(this); Map<Integer, Operation> testOps = new HashMap<Integer, Operation>(); testOps.put(operationId, operation); RequestHandler handler = new RequestHandlerMock(MAX_Q, interfaceId, testOps); dispatcher.addHandler(handler); // control = handler; dispatcher.start(); dispatcher.waitForStartup(); client = new RPCNIOSocketClient( config.getSSLOptions(), RQ_TIMEOUT, CON_TIMEOUT, "BabuDB Replication Unittest"); client.start(); client.waitForStartup(); }