Package com.springsource.insight.intercept.operation

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


        }

        int response = httpClient.executeMethod(method);
        Operation op = assertExecutionResult(uri, method, response, false);
        OperationMap reqDetails = op.get("request", OperationMap.class);
        OperationList reqHeaders = reqDetails.get("headers", OperationList.class);
        Map<String, String> requestHeaders = toHeadersMap(reqHeaders);
        OperationMap rspDetails = op.get("response", OperationMap.class);
        OperationList rspHeaders = rspDetails.get("headers", OperationList.class);
        Map<String, String> responseHeaders = toHeadersMap(rspHeaders);
        Map<String, String> hdrsMap = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
        if (MapUtil.size(requestHeaders) > 0) {
            hdrsMap.putAll(requestHeaders);
        }
View Full Code Here


        }
    }

    private void assertHeadersContents(String uri, String type, OperationMap details,
                                       HttpMethod method, boolean useRequestHeaders) {
        OperationList headers = details.get("headers", OperationList.class);
        assertNotNull("No " + type + " headers for " + uri, headers);

        Header[] hdrArray = useRequestHeaders ? method.getRequestHeaders() : method.getResponseHeaders();
        int numHdrs = (hdrArray == null) ? 0 : hdrArray.length;
        assertEquals("Mismatched " + type + " number of headers", numHdrs, headers.size());
        if (numHdrs <= 0) {
            return;
        }

        Map<String, String> opHdrs = toHeadersMap(headers);
View Full Code Here

            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) {
                    for (int i = 0; i < headersList.size(); i++) {
                        OperationMap map = headersList.get(i, OperationMap.class);

                        String headerName = map.get(OperationUtils.NAME_KEY, String.class);
                        String headerValue = map.get(OperationUtils.VALUE_KEY, String.class);

                        if ((app == null) && EndPointAnalyzersRegistry.APP_TOKEN_NAME.equals(headerName)) {
View Full Code Here

        return details;
    }

    private void assertHeadersContents(String uri, String type, OperationMap details, HttpMessage message) {
        OperationList headers = details.get("headers", OperationList.class);
        assertNotNull("No " + type + " headers for " + uri, headers);

        Header[] hdrArray = message.getAllHeaders();
        int numHdrs = (hdrArray == null) ? 0 : hdrArray.length;
        assertEquals("Mismatched " + type + " number of headers", numHdrs, headers.size());
        if (numHdrs <= 0) {
            return;
        }

        Map<String, String> opHdrs = toHeadersMap(headers);
View Full Code Here

        Operation operation = getTestOperation("testSetParameterInSequence");
        JdbcOperationFinalizer.addParam(operation, 1, "a"); // this is 1-based index
        JdbcOperationFinalizer.addParam(operation, 2, "b"); // this is 1-based index
        JdbcOperationFinalizer.finalize(operation);

        OperationList params = operation.get(JdbcOperationFinalizer.PARAMS_VALUES, OperationList.class);
        assertNotNull("Missing parameters list", params);
        assertEquals("Mismatched number of parameters", 2, params.size());
        assertEquals("Mismatched 1st parameter", "a", params.get(0));
        assertEquals("Mismatched 2nd parameter", "b", params.get(1));
    }
View Full Code Here

        Operation operation = getTestOperation("testSetParameterOutOfSequence");
        JdbcOperationFinalizer.addParam(operation, 2, "b"); // this is 1-based index
        JdbcOperationFinalizer.addParam(operation, 1, "a"); // this is 1-based index
        JdbcOperationFinalizer.finalize(operation);

        OperationList params = operation.get(JdbcOperationFinalizer.PARAMS_VALUES, OperationList.class);
        assertNotNull("Missing parameters list", params);
        assertEquals("Mismatched number of parameters", 2, params.size());
        assertEquals("Mismatched 1st parameter", "a", params.get(0));
        assertEquals("Mismatched 2nd parameter", "b", params.get(1));
    }
View Full Code Here

        Operation operation = getTestOperation("testIndexedParamsValuesClearedBetweenSuccessiveInvocations");
        JdbcOperationFinalizer.addParam(operation, 1, "a"); // this is 1-based index
        JdbcOperationFinalizer.addParam(operation, 2, "b"); // this is 1-based index
        JdbcOperationFinalizer.finalize(operation);

        OperationList params = operation.get(JdbcOperationFinalizer.PARAMS_VALUES, OperationList.class);
        assertNotNull("Missing parameters list", params);

        JdbcOperationFinalizer.finalize(operation);
        assertNullValue("Unexpected parameters list", operation.get(JdbcOperationFinalizer.PARAMS_VALUES));
    }
View Full Code Here

        assert "cancel".equals(op.get("stateId"));

        OperationMap map = (OperationMap) op.get("attribs");
        assertNotNull(map.get("bind"));

        OperationList list = (OperationList) op.get("actions");
        assert "flowScope.persons=personDao.findPersons()".equals(list.get(0));
    }
View Full Code Here

        // see JoinPointBreakDownSourceCodeLocationFinalizer#populateOperation
        assertEquals("Mismatched " + annClass.getSimpleName() + " class name", testedServiceClass.getName(), op.get(OperationFields.CLASS_NAME, String.class));
        assertEquals("Mismatched " + annClass.getSimpleName() + " invocation method", "invokeMe", op.get("methodName", String.class));

        final OperationList argsList = op.get(OperationFields.ARGUMENTS, OperationList.class);
        assertNotNull("Missing " + annClass.getSimpleName() + " invocation arguments", argsList);
        assertEquals("Mismatched " + annClass.getSimpleName() + " num. of invocation arguments", invocationArgs.length, argsList.size());

        for (int aIndex = 0; aIndex < invocationArgs.length; aIndex++) {
            final Object expArg = invocationArgs[aIndex], actArg = argsList.get(aIndex);
            final String expStr = StringFormatterUtils.formatObject(expArg),
                    actStr = StringFormatterUtils.formatObject(actArg);
            assertEquals("Mismatched " + annClass.getSimpleName() + " invocation arguments #" + aIndex, expStr, actStr);
        }
    }
View Full Code Here

        delegator.setString(1, "Agim");
        delegator.execute();

        Operation op = getLastEntered();
        assertEquals(sql, op.get("sql"));
        OperationList parameters = op.get("params", OperationList.class);
        assertEquals(1, parameters.size());
        assertEquals("Agim", parameters.get(0));
    }
View Full Code Here

TOP

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

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.