use of com.alibaba.otter.shared.arbitrate.impl.setl.MainStemArbitrateEvent in project otter by alibaba.
the class MainStemArbitrateEventTest method test_mainStem.
@Test
public void test_mainStem() {
// 启动
channelEvent.start(channelId);
mainStemEvent = new MainStemArbitrateEvent();
try {
mainStemEvent.await(pipelineId);
MainStemEventData eventData = new MainStemEventData();
eventData.setPipelineId(pipelineId);
eventData.setStatus(MainStemEventData.Status.OVERTAKE);
mainStemEvent.single(eventData);
PermitMonitor permit = ArbitrateFactory.getInstance(pipelineId, PermitMonitor.class);
// 阻塞等待授权
permit.waitForPermit();
} catch (InterruptedException e) {
want.fail();
}
boolean check = mainStemEvent.check(pipelineId);
want.bool(check).is(true);
// 删除mainStem节点
mainStemEvent.release(pipelineId);
}
Aggregations