Package com.springsource.insight.intercept.operation

Examples of com.springsource.insight.intercept.operation.Operation


                new TestClientHttpRequest(HttpMethod.GET,
                        new URI("http://somewhere:7365/testExecutionCollected"),
                        createIdentityHttpHeaders(Arrays.asList("Req-Header1", "Req-Header2")),
                        createMockClientHttpResponse(HttpStatus.OK, createIdentityHttpHeaders(Arrays.asList("Rsp-Header1", "Rsp-Header2"))));
        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


        return resSet;
    }

    ExternalResourceDescriptor extractExternalResourceDescriptor(Frame frame) {
        Operation op = (frame == null) ? null : frame.getOperation();
        OperationMap requestDetails = (op == null) ? null : op.get("request", OperationMap.class);
        String uriValue = (requestDetails == null) ? null : requestDetails.get(OperationFields.URI, String.class);
        if (StringUtil.getSafeLength(uriValue) <= 0) {
            return null;
        }

        try {
            URI uri = new URI(uriValue);
            String host = uri.getHost();
            int port = resolvePort(uri);

            String color = colorManager.getColor(op);
            String app = null;
            String ser = null;
            String ep = null;

            OperationMap responseDetails = (op == null) ? null : op.get("response", OperationMap.class);

            if (responseDetails != null) {
                OperationList headersList = responseDetails.get("headers", OperationList.class);

                if (headersList != null) {
View Full Code Here

    public void testRun2() throws Exception {
        // Step 1: Execute test
        tests.test_Traverse2();

        // Step 2:  Get the Operation that was just created by our aspect
        Operation op = getLastEntered();
        assertNotNull("No Neo4J.Traverse operation data is intercepted", op);

        // Step 3:  Validate
        assertEquals("Invalid operation type", OperationCollectionTypes.TRAVERSE_TYPE.type, op.getType());

        assertEquals("Invalid Label", OperationCollectionTypes.TRAVERSE_TYPE.label, op.getLabel());

        assertNotNull("Parameter 'start' does not exists", op.get("start"));
        assertNotNull("Parameter 'traversalDescription' does not exists", op.get("traversalDescription"));
    }
View Full Code Here

                new TestClientHttpRequest(HttpMethod.GET,
                        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

        return op;
    }

    private Operation assertExecuteRequest(ClientHttpRequest request) {
        Operation op = getLastEntered();
        assertNotNull("No operation collected", op);
        assertEquals("Mismatched type", ClientHttpRequestOperationCollector.TYPE, op.getType());

        URI uri = request.getURI();
        HttpMethod method = request.getMethod();
        assertEquals("Mismatched label", method + " " + uri.toString(), op.getLabel());
        return op;
    }
View Full Code Here

        invocation.setAttributes(Collections.singletonMap("testSuccessfulRemoteInvocation", (Serializable) Long.valueOf(System.currentTimeMillis())));

        HttpInvokerClientConfiguration config =
                createMockConfiguration(invocation.getMethodName(), "http://hello/world", "http://here/testSuccessfulRemoteInvocation");
        RemoteInvocationResult result = invoker.executeRequest(config, invocation);
        Operation op = assertRemotingOperation(config, invocation, result);
        ExternalResourceDescriptor desc = assertExternalResource(op);
        assertNull("Unexpected external descriptor: " + desc, desc);
    }
View Full Code Here

        invocation.setAttributes(Collections.singletonMap("testFailedRemoteInvocation", (Serializable) Long.valueOf(System.currentTimeMillis())));

        HttpInvokerClientConfiguration config =
                createMockConfiguration(invocation.getMethodName(), "http://goodbye/world", "http://there/testFailedRemoteInvocation");
        RemoteInvocationResult result = invoker.executeRequest(config, invocation);
        Operation op = assertRemotingOperation(config, invocation, result);
        ExternalResourceDescriptor desc = assertExternalResource(op);
        assertNull("Unexpected external descriptor: " + desc, desc);
        assertTraceError(op, result);
    }
View Full Code Here

    protected abstract AbstractMongoDBExternalResourceAnalyzer createMongoAnalyzer();

    @Test
    public void testLocateDatabaseURI() throws Exception {
        Operation op = new Operation();
        op.type(getType());
        op.put("host", "localhost");
        op.put("port", 6379);
        op.put("dbName", "dbName");
        Frame frame = new SimpleFrame(FrameId.valueOf("0"),
                null,
                op,
                TimeRange.milliTimeRange(0, 1),
                Collections.<Frame>emptyList());
View Full Code Here

    }

    protected Operation assertRemotingOperation(HttpInvokerClientConfiguration config,
                                                RemoteInvocation invocation,
                                                RemoteInvocationResult result) {
        Operation op = assertRemotingOperation(config);
        assertRemoteInvocation(op, invocation);
        assertRemoteResult(op, result);
        return op;
    }
View Full Code Here

        assertEquals(Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }

    @Test
    public void testExactlyTwoDifferentExternalResourceNames() {
        Operation op1 = new Operation();
        op1.type(getType());
        op1.put("host", "127.0.0.1");
        op1.put("port", 6379);
        op1.put("dbName", "dbName");

        Operation op2 = new Operation();
        op2.type(getType());

        op2.put("port", 6379);
        op2.put("dbName", "dbName2");

        Operation dummyOp = new Operation();

        SimpleFrameBuilder builder = new SimpleFrameBuilder();
        builder.enter(new Operation().type(OperationType.HTTP));
        builder.enter(op2);
        builder.exit();
        builder.enter(dummyOp);
        builder.enter(op1);
        builder.exit();
View Full Code Here

TOP

Related Classes of com.springsource.insight.intercept.operation.Operation

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.