public void testJ() throws Exception {
System.out.println("J");
new Plant();
try {
final AtomicInteger counter = new AtomicInteger();
final NonBlockingReactor busReactor = new NonBlockingReactor();
final CommonReactor subscriberReactor = new NonBlockingReactor();
final RequestBus<Void> requestBus = new RequestBus<Void>(busReactor);
call(requestBus.sendsContentAOp(null));
assertEquals(counter.get(), 0);
call(new SubscribeAOp<Void>(requestBus, subscriberReactor) {
@Override
protected void processContent(final Void _content,
AsyncRequestImpl _asyncRequestImpl,
AsyncResponseProcessor<Void> _asyncResponseProcessor)
throws Exception {
System.out.println("ping");
counter.incrementAndGet();
_asyncResponseProcessor.processAsyncResponse(null);
}
});
call(requestBus.sendsContentAOp(null));
assertEquals(counter.get(), 1);
subscriberReactor.close();
try {
call(requestBus.sendsContentAOp(null));
} catch (final ReactorClosedException e) {
}
assertEquals(counter.get(), 1);