Package com.springsource.insight.intercept.operation

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


        GrailsControllerStateKeeper.setThreadLocalActionParams(Collections.singletonList(kvp));
        Operation op = new Operation();
        collector.processNormalExit(op, Object.class);

        assertUnknownOperationContents(op);
        OperationList actionParams = op.get("actionParams", OperationList.class);
        assertNotNull("No action params", actionParams);
        assertEquals("No params values", 1, actionParams.size());

        OperationMap map = actionParams.get(0, OperationMap.class);
        assertNotNull("No values map", map);
        assertEquals("Mismatched params values entries", 2, map.size());
        assertEquals("Mismatched param key", kvp.getKey(), map.get("key", String.class));
        assertEquals("Mismatched param value", kvp.getValue(), map.get("value", String.class));
    }
View Full Code Here


        assertOperationContents(op,
                getClass().getSimpleName(),
                getClass().getName(),
                GrailsControllerMetricCollector.UNKNOWN_ACTION);

        OperationList actionParams = op.get("actionParams", OperationList.class);
        assertNotNull("No action params", actionParams);
        assertEquals("Non-empty action params", 0, actionParams.size());
    }
View Full Code Here

    public void testLocalViewWithStatus() throws Exception {
        Operation operation = new Operation()
                .put("requestMethod", "PUT")
                .put("requestUri", "/my/uri")
                .put("actionName", "actionName");
        OperationList actionParams = operation.createList("actionParams");
        actionParams.createMap().put("key", "keyA").put("value", "valA");
        actionParams.createMap().put("key", "keyB").put("value", "valB");
        actionParams.createMap().put("key", "keyC").put("value", "valC");

        model.put("operation", operation.asMap());
        local.render(model, request, response);
        String content = response.getContentAsString();
        //System.err.println(content);
View Full Code Here

    private static OperationList assertValidationErrors(Operation op, Errors errors) {
        int numErrors = (errors == null) ? 0 : errors.getErrorCount();
        assertEquals("Mismatched number of errors", numErrors, op.getInt(ValidationJoinPointFinalizer.ERRORS_COUNT, (-1)));

        OperationList errDetails = op.get(ValidationJoinPointFinalizer.ERRORS_LIST, OperationList.class);
        if (numErrors > 0) {
            assertValidationErrors(errDetails, errors);
        } else {
            assertNull("Unexpected errors details: " + errDetails, errDetails);
        }
View Full Code Here

        assertEquals("Mismatched operation type", MongoDBOperationExternalResourceAnalyzer.TYPE, op.getType());
        assertEquals("Mismatched operation label", "MongoDB: DB.command()", op.getLabel());
        assertEquals("Mismatched DB name", db.getName(), op.get("dbName", String.class));

        if (!StringUtil.isEmpty(argVal)) {
            OperationList argsList = op.get("args", OperationList.class);
            assertNotNull("Missing arguments list");

            String actVal = argsList.get(0, String.class);
            assertEquals("Mismatched operation arguments", argVal, actVal);
        }

        return op;
    }
View Full Code Here

                    : RestServiceDefinitions.ROOT_PATH + "/" + pathDefinition;
            final String actTemplate = op.get("requestTemplate", String.class);
            assertEquals("Mismatched request template", expTemplate, actTemplate);

            if (!RestServiceDefinitions.ROOT_PATH.equals(pathDefinition)) {
                final OperationList opList = op.get("pathParams", OperationList.class);
                assertNotNull("Missing path parameters list", opList);
                assertEquals("Unexpected number of path parameters", 1, opList.size());

                final OperationMap opMap = opList.get(0, OperationMap.class);
                assertNotNull("Missing path parameters map", opMap);
                assertEquals("Unexpected number of mapped path parameters", 3, opMap.size());

                final String paramName = opMap.get("name", String.class);
                assertEquals("Mismatched path param name", RestServiceDefinitions.NOW_PARAM_NAME, paramName);
View Full Code Here

        Operation op = getLastEntered();
        assertNotNull("No operation", op);
        assertEquals("Mismatched type", RmiDefinitions.RMI_LIST, op.getType());

        OperationList list = op.get(RmiDefinitions.LIST_ATTR, OperationList.class);
        assertNotNull("Missing names list", list);
        assertEquals("Mismatched names list size", res.size(), list.size());
        for (int index = 0; index < list.size(); index++) {
            String expected = res.get(index), actual = list.get(index, String.class);
            assertEquals("Mismatched value @ index " + index, expected, actual);
        }
    }
View Full Code Here

        State state = GrailsControllerStateKeeper.getAndDestroyThreadLocalState();
        op.label(buildLabel(state))
                .sourceCodeLocation(buildSourceCodeLocation(state))
        ;

        OperationList actionParams = op.createList("actionParams");
        if ((state != null) && (state.actionParams != null)) {
            for (KeyValPair<String, String> param : state.actionParams) {
                actionParams.createMap().put("key", param.getKey()).put("value", param.getValue());
            }
        }
    }
View Full Code Here

    private void assertWebMethodInformation(final String callType, final Operation op) {
        assertOperationValue(callType, op, "op. name", "operationName", callType + JwsServiceDefinitions.OPERATION_SUFFIX);
        assertOperationValue(callType, op, "op. action", "action", callType + JwsServiceDefinitions.ACTION_SUFFIX);
        assertOperationValue(callType, op, "op. exclude", "exclude", Boolean.valueOf(JwsServiceDefinitions.EXCLUDE_METHOD), Boolean.class);

        final OperationList opList = op.get("webParams", OperationList.class);
        assertNotNull(callType + "[Missing path parameters list]", opList);
        assertEquals(callType + "[Unexpected number of path parameters]", 1, opList.size());
        assertWebParams(callType, opList.get(0, OperationMap.class));
    }
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.