Examples of EndPointAnalysis


Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    }

    @Test
    public void testLocateEndPointNoHttp() {
        Trace trace = createNonHttpTrace();
        EndPointAnalysis analysis = analyzer.locateEndPoint(trace);
        assertNull("Unexpected success: " + analysis, analysis);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    @Override
    protected EndPointAnalysis makeEndPoint(Frame lifecycleFrame, int depth) {
        Operation op = lifecycleFrame.getOperation();
        String endPointExample = op.get("event", String.class);

        return new EndPointAnalysis(ENDPOINT_NAME, ENDPOINT_LABEL, endPointExample, getOperationScore(op, depth), op);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        String example = EndPointAnalysis.createHttpExampleRequest(request);
        if (StringUtil.isEmpty(example)) {
            example = op.getLabel();
        }

        return new EndPointAnalysis(EndPointName.valueOf(endPointKey), endPointLabel, example, getOperationScore(op, depth), op);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        b.enter(new Operation());
        Frame simpleFrame = b.exit();
        assertNotNull("No simple frame", simpleFrame);
        Frame httpFrame = b.exit();
        Trace trace = Trace.newInstance(app, TraceId.valueOf("0"), httpFrame);
        EndPointAnalysis ep = endPointAnalyzer.locateEndPoint(trace);
        assertNull("Unexpected result: " + ep, ep);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        Trace trace = Trace.newInstance(app, TraceId.valueOf("0"), httpFrame);
        assertEndpointAnalysis(trace, grailsFrame, httpFrame);
    }

    private static EndPointAnalysis assertEndpointAnalysis(Trace trace, Frame grailsFrame, Frame httpFrame) {
        EndPointAnalysis ep = endPointAnalyzer.locateEndPoint(trace);
        assertNotNull("No analysis", ep);

        Operation operation = grailsFrame.getOperation();
        String resourceKey = GrailsControllerMethodEndPointAnalyzer.makeResourceKey(operation.getSourceCodeLocation());
        EndPointName epName = EndPointName.valueOf(resourceKey);
        assertEquals("Mismatched endpoint name", epName, ep.getEndPointName());

        assertEquals("Mismatched label", operation.getLabel(), ep.getResourceLabel());
        assertEquals("Mismatched score", EndPointAnalysis.depth2score(FrameUtil.getDepth(grailsFrame)), ep.getScore());

        if (httpFrame == null) {
            assertEquals("Mismatched grails example", operation.getLabel(), ep.getExample());
        } else {
            String expected = EndPointAnalysis.createHttpExampleRequest(httpFrame);
            assertEquals("Mismatched http example", expected, ep.getExample());
        }

        return ep;
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        Operation controllerOp = controllerFrame.getOperation();
        String examplePath = EndPointAnalysis.getHttpExampleRequest(controllerFrame);
        EndPointName endPointName = EndPointName.valueOf(controllerOp);
        String endPointLabel = controllerOp.getLabel();

        return new EndPointAnalysis(endPointName, endPointLabel, examplePath, getOperationScore(controllerOp, depth), controllerOp);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        b.enter(new Operation());
        Thread.sleep(100);
        b.exit();
        Frame integrationFrame = b.exit();
        Trace trace = Trace.newInstance(app, TraceId.valueOf("0"), integrationFrame);
        EndPointAnalysis endPoint = endPointAnalyzer.locateEndPoint(trace);
        assertEquals(EndPointName.valueOf("MessageChannel#test"), endPoint.getEndPointName());
        assertEquals(integrationFrame.getRange(), trace.getRange());
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        b.enter(new Operation());
        Thread.sleep(100);
        b.exit();
        Frame integrationFrame = b.exit();
        Trace trace = Trace.newInstance(app, TraceId.valueOf("0"), integrationFrame);
        EndPointAnalysis endPoint = endPointAnalyzer.locateEndPoint(trace);
        assertEquals(EndPointName.valueOf("MessageHandler#test"), endPoint.getEndPointName());
        assertEquals(integrationFrame.getRange(), trace.getRange());
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

        Operation op = si.getOperation();
        String exampleRequest = op.get(SpringIntegrationDefinitions.SI_COMPONENT_TYPE_ATTR, String.class);
        String opLabel = op.getLabel();
        EndPointName name = EndPointName.valueOf(opLabel);
        String label = name.getName();
        return new EndPointAnalysis(name, label, exampleRequest, ANALYSIS_SCORE, op);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    @Override
    protected EndPointAnalysis makeEndPoint(Frame frame, int depth) {
        Operation operation = frame.getOperation();
        NamedPropertySource props = toPropertySource(operation);
        String endpointName = PropertiesUtil.format(getSettingFormat(ENDPOINT_FORMAT), props);
        return new EndPointAnalysis(EndPointName.valueOf(endpointName),
                PropertiesUtil.format(getSettingFormat(LABEL_FORMAT), props),
                PropertiesUtil.format(getSettingFormat(EXAMPLE_FORMAT), props),
                getOperationScore(operation, depth),
                operation);
    }
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.