Examples of IAgent


Examples of org.jacoco.agent.rt.IAgent

     * @throws IOException
     */
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        if(EXEC_PATH.equals(req.getPathInfo())) {
            final IAgent agent = getAgent();
            if (agent == null) {
                final String msg = "The Jacoco agent MBean is not available\n\n";
                resp.sendError(HttpServletResponse.SC_NOT_FOUND, msg + getUsageInfo());
            } else {
                sendJacocoData(req, resp, false);
View Full Code Here

Examples of org.jacoco.agent.rt.IAgent

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        sendJacocoData(req, resp, true);
    }
   
    private void sendJacocoData(HttpServletRequest req, HttpServletResponse resp, boolean resetAgent) throws IOException {
        final IAgent agent = getAgent();
        if (agent == null) {
            final String msg = "The Jacoco agent MBean is not available\n\n";
            resp.sendError(HttpServletResponse.SC_NOT_FOUND, msg + getUsageInfo());
        } else {
            resp.setContentType("application/octet-stream");
            final String sessionId = req.getParameter(PARAM_SESSION_ID);
            log.info("Getting JaCoCo execution data, resetAgent={}", resetAgent);
            byte[] data = agent.getExecutionData(resetAgent);
            if(sessionId != null) {
                log.info("Setting JaCoCo sessionId={}", sessionId);
                agent.setSessionId(sessionId);
            }
            resp.getOutputStream().write(data);
            resp.getOutputStream().flush();
        }
    }
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.