Package org.apache.tomcat.util.buf

Examples of org.apache.tomcat.util.buf.ByteChunk.recycle()


        Map<String,List<String>> reqHeaders2 = new HashMap<>();
        reqHeaders2.put(CLIENT_AUTH_HEADER, auth);

        Map<String,List<String>> respHeaders2 = new HashMap<>();

        bc.recycle();
        rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders2,
                respHeaders2);

        if (expectedReject2) {
            assertEquals(expectedRC2, rc);
View Full Code Here


                bc, null, null);

        assertTrue(bc.getLength() > 0);
        assertEquals(403, rc);

        bc.recycle();

        rc = getUrl("http://localhost:" + getPort() + "/unprotected.jsp",
                bc, null, null);

        assertEquals(200, rc);
View Full Code Here

            ioe.printStackTrace();
        }

        assertEquals(HttpServletResponse.SC_OK, rc);

        body.recycle();

        rc = getUrl("http://localhost:" + getPort() + "/bug54178ServletB",
                body, null);

        assertEquals(HttpServletResponse.SC_OK, rc);
View Full Code Here

        ByteChunk bc = new ByteChunk();
        int rc = getUrl("http://localhost:" + getPort() +
                "/test/bug5nnnn/bug54801a.jspx", bc, null);
        Assert.assertEquals(HttpServletResponse.SC_OK, rc);

        bc.recycle();
        rc = getUrl("http://localhost:" + getPort() +
                "/test/bug5nnnn/bug54801b.jspx", bc, null);
        Assert.assertEquals(HttpServletResponse.SC_OK, rc);
    }
View Full Code Here

        ByteChunk bc = new ByteChunk();
        int rc = getUrl("http://localhost:" + getPort() +
                "/test/bug5nnnn/bug54821a.jspx", bc, null);
        Assert.assertEquals(HttpServletResponse.SC_OK, rc);

        bc.recycle();
        rc = getUrl("http://localhost:" + getPort() +
                "/test/bug5nnnn/bug54821b.jspx", bc, null);
        Assert.assertEquals(HttpServletResponse.SC_OK, rc);
   }
}
View Full Code Here

                    "null", getAuthToken(respHeaders1, OPAQUE),
                    nc1, cnonce, QOP));
        }
        reqHeaders2.put(CLIENT_AUTH_HEADER, auth);

        bc.recycle();
        rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders2,
                respHeaders2);

        if (req2expect200) {
            assertEquals(200, rc);
View Full Code Here

        ByteChunk bc = new ByteChunk();
        int rc = getUrl("http://localhost:" + getPort() + uri, bc, reqHeaders,
                respHeaders);
        assertEquals(401, rc);
        assertTrue(bc.getLength() > 0);
        bc.recycle();

        // Second request should succeed (if we use the server nonce)
        auth.clear();
        if (useServerNonce) {
            if (useServerOpaque) {
View Full Code Here

            assertTrue(bc.getLength() > 0);
        }

        // Third request should succeed if we increment nc
        auth.clear();
        bc.recycle();
        bc.reset();
        auth.add(buildDigestResponse(user, pwd, digestUri, realm,
                getNonce(respHeaders), getOpaque(respHeaders), nc2, cnonce,
                qop));
        rc = getUrl("http://localhost:" + getPort() + uri, bc, reqHeaders,
View Full Code Here

                int rc = getUrl("http://localhost:" + getPort() + "/servlet" + i, bc, null, respHeaders);
                assertEquals(HttpServletResponse.SC_OK, rc);
                System.out.println("Client received "+bc.getLength() + " bytes in "+(System.currentTimeMillis()-start)+" ms.");
                assertEquals(EXPECTED_CONTENT_LENGTH * (i+1), bc.getLength());

                bc.recycle();
            }
        } finally {
            for (File f : files) {
                f.delete();
            }
View Full Code Here

        ByteChunk bc = new ByteChunk();
        int rc = getUrl("http://localhost:" + getPort() + uri, bc, reqHeaders,
                respHeaders);
        assertEquals(401, rc);
        assertTrue(bc.getLength() > 0);
        bc.recycle();

        // Second request should succeed (if we use the server nonce)
        auth.clear();
        if (useServerNonce) {
            if (useServerOpaque) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.