use of org.webpieces.httpclient.Http2CloseListener in project webpieces by deanhiller.
the class TestCancelStream method setup.
@Before
public void setup() {
SimpleMeterRegistry metrics = new SimpleMeterRegistry();
TwoPools pool = new TwoPools("client.bufferpool", metrics);
httpClient = Http2to11ClientFactory.createHttpClient("myClient2", mockChanMgr, new SimpleMeterRegistry(), pool);
mockChannel.setConnectFuture(XFuture.completedFuture(null));
mockChanMgr.addTCPChannelToReturn(mockChannel);
httpSocket = httpClient.createHttpSocket(new Http2CloseListener());
}
use of org.webpieces.httpclient.Http2CloseListener in project webpieces by deanhiller.
the class TestConnecting method testConnecting.
@Test
public void testConnecting() {
mockChannelMgr.addTCPChannelToReturn(mockChannel);
Http2Socket socket = httpClient.createHttpSocket(new Http2CloseListener());
XFuture<Void> future1 = new XFuture<Void>();
mockChannel.setConnectFuture(future1);
XFuture<Void> future = socket.connect(new InetSocketAddress(8080));
Assert.assertFalse(future.isDone());
future1.complete(null);
Assert.assertTrue(future.isDone());
}
use of org.webpieces.httpclient.Http2CloseListener in project webpieces by deanhiller.
the class TestWriteReads method setup.
@Before
public void setup() throws InterruptedException, ExecutionException, TimeoutException {
BufferPool pool = new TwoPools("pl", new SimpleMeterRegistry());
httpClient = Http2to11ClientFactory.createHttpClient("myClient4", mockChannelMgr, new SimpleMeterRegistry(), pool);
mockChannelMgr.addTCPChannelToReturn(mockChannel);
socket = httpClient.createHttpSocket(new Http2CloseListener());
mockChannel.setConnectFuture(XFuture.completedFuture(null));
XFuture<Void> future = socket.connect(new InetSocketAddress(8080));
future.get(2, TimeUnit.SECONDS);
}
use of org.webpieces.httpclient.Http2CloseListener in project webpieces by deanhiller.
the class TestHttp1Backpressure method setup.
@Before
public void setup() throws InterruptedException, ExecutionException, TimeoutException {
BufferPool pool = new TwoPools("pl", new SimpleMeterRegistry());
httpClient = Http2to11ClientFactory.createHttpClient("myClient3", mockChannelMgr, new SimpleMeterRegistry(), pool);
mockChannelMgr.addTCPChannelToReturn(mockChannel);
socket = httpClient.createHttpSocket(new Http2CloseListener());
mockChannel.setConnectFuture(XFuture.completedFuture(null));
XFuture<Void> future = socket.connect(new InetSocketAddress(8080));
future.get(2, TimeUnit.SECONDS);
}
Aggregations