use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testAddTest5.
@Test
public void testAddTest5() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
MultiMap headers = new CaseInsensitiveHeaders();
assertEquals("", mmap.addAll(headers).toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testAddTest11.
@Test
public void testAddTest11() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "";
String strVal = "";
assertEquals(": \n", mmap.add(name, strVal).toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testSize.
@Test
public void testSize() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
assertEquals(0, mmap.size());
mmap.add("header", "value");
assertEquals(1, mmap.size());
mmap.add("header2", "value2");
assertEquals(2, mmap.size());
mmap.add("header", "value3");
assertEquals(2, mmap.size());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testIsEmptyTest2.
@Test
public void testIsEmptyTest2() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
mmap.add("a", "b");
assertFalse(mmap.isEmpty());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class Http2ClientConnection method onPushPromiseRead.
@Override
public synchronized void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) throws Http2Exception {
Http2ClientStream stream = (Http2ClientStream) streams.get(streamId);
if (stream != null) {
Handler<HttpClientRequest> pushHandler = stream.pushHandler();
if (pushHandler != null) {
context.executeFromIO(() -> {
String rawMethod = headers.method().toString();
HttpMethod method = HttpUtils.toVertxMethod(rawMethod);
String uri = headers.path().toString();
String host = headers.authority() != null ? headers.authority().toString() : null;
MultiMap headersMap = new Http2HeadersAdaptor(headers);
Http2Stream promisedStream = handler.connection().stream(promisedStreamId);
int port = remoteAddress().port();
HttpClientRequestPushPromise pushReq = new HttpClientRequestPushPromise(this, promisedStream, http2Pool.client, isSsl(), method, rawMethod, uri, host, port, headersMap);
if (metrics.isEnabled()) {
pushReq.metric(metrics.responsePushed(queueMetric, metric(), localAddress(), remoteAddress(), pushReq));
}
streams.put(promisedStreamId, pushReq.getStream());
pushHandler.handle(pushReq);
});
return;
}
}
handler.writeReset(promisedStreamId, Http2Error.CANCEL.code());
}
Aggregations