MCPcopy Create free account
hub / github.com/apache/tomcat / testPathParam

Method testPathParam

test/org/apache/coyote/http2/TestStream.java:41–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 * https://bz.apache.org/bugzilla/show_bug.cgi?id=61120
40 */
41 @Test
42 public void testPathParam() throws Exception {
43
44 enableHttp2();
45
46 Tomcat tomcat = getTomcatInstance();
47
48 Context ctxt = getProgrammaticRootContext();
49 Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
50 ctxt.addServletMappingDecoded("/simple", "simple");
51 Tomcat.addServlet(ctxt, "pathparam", new PathParam());
52 ctxt.addServletMappingDecoded("/pathparam", "pathparam");
53
54 tomcat.start();
55
56 openClientConnection();
57 doHttpUpgrade();
58 sendClientPreface();
59 validateHttp2InitialResponse();
60
61 byte[] frameHeader = new byte[9];
62 ByteBuffer headersPayload = ByteBuffer.allocate(128);
63 buildGetRequest(frameHeader, headersPayload, null, 3, "/pathparam;jsessionid=" + PathParam.EXPECTED_SESSION_ID);
64 writeFrame(frameHeader, headersPayload);
65
66 readSimpleGetResponse();
67
68 Assert.assertEquals("3-HeadersStart\n" + "3-Header-[:status]-[200]\n" +
69 "3-Header-[content-type]-[text/plain;charset=UTF-8]\n" + "3-Header-[content-length]-[2]\n" +
70 "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" + "3-HeadersEnd\n" + "3-Body-2\n" +
71 "3-EndOfStream\n", output.getTrace());
72 }
73
74
75 @Test

Callers

nothing calls this directly

Calls 15

addServletMethod · 0.95
startMethod · 0.95
enableHttp2Method · 0.80
getTomcatInstanceMethod · 0.80
openClientConnectionMethod · 0.80
sendClientPrefaceMethod · 0.80
buildGetRequestMethod · 0.80
writeFrameMethod · 0.80
readSimpleGetResponseMethod · 0.80
allocateMethod · 0.65

Tested by

no test coverage detected