Package com.springsource.insight.intercept.operation

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


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

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

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

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

        assertNotNull("Parameter 'indexName' does not exists", op.get("indexName"));
        assertNotNull("Parameter 'field' does not exists", op.get("field"));
        assertNotNull("Parameter 'value' does not exists", op.get("value"));
    }
View Full Code Here


            }
            obfuscator.incrementalUpdate(HttpObfuscator.OBFUSCATED_HEADERS_SETTING, StringUtil.implode(headerSet, ","));
        }

        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

    //execution(* DBCursor.sort(DBSort));
    @Test
    public void sort() throws Exception {
        testCursor().sort(new BasicDBObject("sort", "this"));
        Operation op = getLastEntered();
        assertNotNull(op);
        assertEquals("MongoDB: DBCursor.sort()", op.getLabel());
        assertEquals("{ \"sort\" : \"this\"}", ((OperationList) op.get("args")).get(0));
        standardAsserts(op);
    }
View Full Code Here

    //execution(* DBCursor.batchSize(int));
    @Test
    public void batchSize() throws Exception {
        testCursor().batchSize(14);
        Operation op = getLastEntered();
        assertNotNull(op);
        assertEquals("MongoDB: DBCursor.batchSize()", op.getLabel());
        assertEquals("14", ((OperationList) op.get("args")).get(0));
        standardAsserts(op);
    }
View Full Code Here

    @Test
    public void testExecuteQuery() {
        for (QueryExecutor qe : QueryExecutor.values()) {
            qe.executeQuery(mockSession);

            Operation op = assertQueryExecutionOperation(qe.name(), qe.name());
            qe.assertQueryArguments(op);
            Mockito.reset(spiedOperationCollector); // prepare for next iteration
        }
    }
View Full Code Here

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

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

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

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

        assertNotNull("Parameter 'indexedType' does not exists", op.get("indexedType"));
        assertNotNull("Parameter 'propertyName' does not exists", op.get("propertyName"));
        assertNotNull("Parameter 'value' does not exists", op.get("value"));
    }
View Full Code Here

    public ModelAttributeOperationCollectionAspect getAspect() {
        return ModelAttributeOperationCollectionAspect.aspectOf();
    }

    private Operation assertModelAttributeOperation(String name, String value) {
        Operation op = getLastEntered();
        assertNotNull("No extracted operation", op);
        assertEquals("Mismatched operation type", ModelAttributeOperationCollector.TYPE, op.getType());
        assertEquals("Mismatched attribute name", name, op.get(ModelAttributeOperationCollector.MODEL_ATTR_NAME, String.class));
        assertEquals("Mismatched attribute value", value, op.get(ModelAttributeOperationCollector.MODEL_ATTR_VALUE, String.class));

        return op;
    }
View Full Code Here

    protected AbstractControllerOperationCollectionAspectTestSupport(boolean isLegacy) {
        legacyAPI = Boolean.valueOf(isLegacy);
    }

    protected Operation assertControllerOperation() {
        Operation op = getLastEntered();
        assertNotNull("No operation entered", op);
        assertEquals("Mismatched operation type", ControllerEndPointAnalyzer.CONTROLLER_METHOD_TYPE, op.getType());
        assertEquals("Mismatched legacy flag value", legacyAPI, op.get(ControllerEndPointAnalyzer.LEGACY_PROPNAME, Boolean.class));
        return op;
    }
View Full Code Here

    protected Operation assertEncodeReturnModelValues(TestSupportController controller) {
        return assertEncodeModelValues(ControllerOperationCollector.RETURN_VALUE_MODEL_MAP, controller.returnModel);
    }

    protected Operation assertControllerView(String expected) {
        Operation op = assertControllerOperation();
        assertControllerView(op, expected);
        return op;
    }
View Full Code Here

        assertEquals("Mismatched view name", expected, viewName);
        return viewName;
    }

    protected Operation assertEncodeModelValues(String mapName, Map<String, ?> expected) {
        Operation op = assertControllerOperation();
        assertEncodeModelValues(op, mapName, expected);
        return op;
    }
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.