Package com.springsource.insight.intercept.trace

Examples of com.springsource.insight.intercept.trace.TraceError


        ClientHttpResponse response = request.execute();
        Operation op = assertExecuteRequest(request);
        assertRequestDetails(op, request);
        assertResponseDetails(op, response);

        TraceError err = assertTraceError(op, response);
        assertNull("Unexpected trace error: " + err, err);
    }
View Full Code Here


                        new URI("http://somewhere:7365/testExecutionCollected"),
                        createIdentityHttpHeaders(Arrays.asList("Req-Header1", "req-value1", "Req-Header2", "req-value2")),
                        createMockClientHttpResponse(HttpStatus.GATEWAY_TIMEOUT, createIdentityHttpHeaders(Arrays.asList("Rsp-Header1", "Rsp-Header2"))));
        ClientHttpResponse response = request.execute();
        Operation op = assertExecuteRequest(request);
        TraceError err = assertTraceError(op, response);
        assertNotNull("No error detected", err);
    }
View Full Code Here

        String reasonPhrase = rsp.getStatusText();
        List<TraceError> errors = errAnalyzer.locateErrors(creatMockOperationTraceWrapper(op));
        if (ClientHttpRequestTraceErrorAnalyzer.httpStatusIsError(statusCode)) {
            assertEquals("Mismatched number of errors", 1, ListUtil.size(errors));

            TraceError err = errors.get(0);
            assertEquals("Mismatched error message", ClientHttpRequestTraceErrorAnalyzer.createErrorMessage(statusCode, reasonPhrase), err.getMessage());
            return err;
        } else {
            assertEquals("Unexpected errors: " + errors, 0, ListUtil.size(errors));
            return null;
        }
View Full Code Here

        if ((statusCode < 0) /* no code */ || (!httpStatusIsError(statusCode))) {
            return null;
        }

        String reasonPhrase = response.get(REASON_PHRASE_ATTR, String.class);
        return new TraceError(createErrorMessage(statusCode, reasonPhrase));
    }
View Full Code Here

    }

    @Override
    public TraceError locateFrameError(Frame frame) {
        Operation op = frame.getOperation();
        return new TraceError(op.getLabel());
    }
View Full Code Here

        if ((statusCode < 0) /* no code */ || (!httpStatusIsError(statusCode))) {
            return null;
        }

        String reasonPhrase = response.get(REASON_PHRASE_ATTR, String.class);
        return new TraceError(createErrorMessage(statusCode, reasonPhrase));
    }
View Full Code Here

        Operation op = httpFrame.getOperation();
        OperationMap response = op.get("response", OperationMap.class);

        int statusCode = (response == null) ? (-1) : response.getInt(STATUS_CODE_ATTR, (-1));
        if ((statusCode >= 0) && httpStatusIsError(statusCode)) {
            return new TraceError(createErrorMessage(statusCode, response.get(REASON_PHRASE_ATTR, String.class)));
        }

        OperationMap request = op.get("request", OperationMap.class);
        Boolean contextAvailable = (request == null) ? null : request.get(OperationFields.CONTEXT_AVAILABLE, Boolean.class);
        if ((contextAvailable != null) && (!contextAvailable.booleanValue())) {
View Full Code Here

        Operation op = frame.getOperation();
        String remoteError = op.get(HttpInvokerRequestExecutorOperationCollector.REMOTE_EXCEPTION, String.class);
        if (StringUtil.isEmpty(remoteError)) {
            return null;
        } else {
            return new TraceError(remoteError);
        }
    }
View Full Code Here

        if ((statusCode < 0) /* no code */ || (!httpStatusIsError(statusCode))) {
            return null;
        }

        String reasonPhrase = response.get(REASON_PHRASE_ATTR, String.class);
        return new TraceError(createErrorMessage(statusCode, reasonPhrase));
    }
View Full Code Here

    protected static List<TraceError> assertTraceError(Operation op, RemoteInvocationResult result) {
        List<TraceError> errors = errorsAnalyzer.locateErrors(creatMockOperationTraceWrapper(op));
        assertEquals("Mismatched number of errors", 1, ListUtil.size(errors));

        TraceError err = errors.get(0);
        Throwable exc = result.getException();
        assertEquals("Mismatched error text", StringFormatterUtils.formatStackTrace(exc), err.getMessage());
        return errors;
    }
View Full Code Here

TOP

Related Classes of com.springsource.insight.intercept.trace.TraceError

Copyright © 2018 www.massapicom. 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.