()
| 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 |
nothing calls this directly
no test coverage detected