use of org.jocean.idiom.rx.SubscriberHolder in project jocean-http by isdom.
the class DefaultHttpTradeTestCase method testTradeForReadyOutboundResponseAfterResponseOnNext.
@Test
public final void testTradeForReadyOutboundResponseAfterResponseOnNext() {
final HttpTrade trade = new DefaultHttpTrade(new EmbeddedChannel());
assertTrue(trade.isActive());
final SubscriberHolder<HttpObject> subsholder1 = new SubscriberHolder<>();
final Subscription subscription1 = trade.outbound(Observable.unsafeCreate(subsholder1));
assertNotNull(subscription1);
final DefaultHttpRequest req1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/");
Nettys4Test.emitHttpObjects(subsholder1.getAt(0), req1);
}
use of org.jocean.idiom.rx.SubscriberHolder in project jocean-http by isdom.
the class DefaultHttpTradeTestCase method testTradeForResponseAfterAbort.
@Test
public final void testTradeForResponseAfterAbort() {
final HttpTrade trade = new DefaultHttpTrade(new EmbeddedChannel());
trade.close();
assertFalse(trade.isActive());
final SubscriberHolder<HttpObject> subsholder = new SubscriberHolder<>();
final Subscription subscription = trade.outbound(Observable.unsafeCreate(subsholder));
assertNull(subscription);
assertEquals(0, subsholder.getSubscriberCount());
}
use of org.jocean.idiom.rx.SubscriberHolder in project jocean-http by isdom.
the class DefaultHttpTradeTestCase method testTradeForReadyOutboundResponseAfterResponseOnCompleted.
@Test
public final void testTradeForReadyOutboundResponseAfterResponseOnCompleted() {
final HttpTrade trade = new DefaultHttpTrade(new EmbeddedChannel());
assertTrue(trade.isActive());
final SubscriberHolder<HttpObject> subsholder1 = new SubscriberHolder<>();
final Subscription subscription1 = trade.outbound(Observable.unsafeCreate(subsholder1));
assertNotNull(subscription1);
subsholder1.getAt(0).onCompleted();
}
Aggregations