Package com.springsource.insight.intercept.operation

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


        return createRunnerId(runner, resolveRunnerClass(runner));
    }

    public static OperationMap setSpawnLocation(Operation op, Runnable runner) {
        Class<?> runnerClass = resolveRunnerClass(runner);
        SourceCodeLocation scl = new SourceCodeLocation(runnerClass.getName(), "run", (-1));
        return setSpawnLocation(op, scl);
    }
View Full Code Here


        }

        String className = op.get(OperationFields.CLASS_NAME, String.class),
                methodName = op.get(OperationFields.METHOD_NAME, String.class);
        Integer lineNumber = op.get(LINE_NUMBER_ATTR, Integer.class);
        return new SourceCodeLocation(className, methodName, lineNumber.intValue());
    }
View Full Code Here

            throw new IllegalStateException("No spawn location");
        }

        Class<?> runnerClass = RunExecDefinitions.resolveRunnerClass(runnable);
        runnerId = RunExecDefinitions.createRunnerId(runnable, runnerClass);
        rootLocation = new SourceCodeLocation(runnerClass.getName(), "run", (-1));
        rootLabel = rootLocation.getClassName() + "#" + rootLocation.getMethodName() + "()";
    }
View Full Code Here

    private Operation getTestOperation(String methodName) {
        return new Operation()
                .type(JdbcOperationExternalResourceAnalyzer.TYPE)
                .label(methodName)
                .sourceCodeLocation(new SourceCodeLocation(getClass().getName(), methodName, -1))
                ;
    }
View Full Code Here

        {
            Operation op = assertLastExecutionOperation(runner);
            List<Operation> opsList = TEST_COLLECTOR.getCollectedOperations();
            assertEquals("Mismatched number of operations generated", 2, opsList.size());

            SourceCodeLocation scl = op.getSourceCodeLocation();
            assertEquals("Mismatched class name", SignallingRunnable.class.getName(), scl.getClassName());
            assertEquals("Mismatched method name", "run", scl.getMethodName());
        }

        {
            Operation op = assertCurrentThreadExecution();
            SourceCodeLocation scl = op.getSourceCodeLocation();
            assertEquals("Mismatched class name", getClass().getName(), scl.getClassName());
            assertEquals("Mismatched method name", "execute", scl.getMethodName());
        }
    }
View Full Code Here

         */
        Operation op = assertLastExecutionOperation(executor.waitForThread());
        List<Operation> opsList = TEST_COLLECTOR.getCollectedOperations();
        assertEquals("Mismatched number of operations generated", 2, opsList.size());

        SourceCodeLocation scl = op.getSourceCodeLocation();
        assertEquals("Mismatched class name", TestRunnable.class.getName(), scl.getClassName());
        assertEquals("Mismatched method name", "run", scl.getMethodName());
    }
View Full Code Here

        String compType = op.get(StereotypedSpringBeanMethodOperationCollectionAspectSupport.COMP_TYPE_ATTR, String.class);
        // make sure not intercepted by one of the stereotyped beans aspects
        assertNull("Unexpected stereotyped bean method collection: " + compType, compType);

        SourceCodeLocation scl = op.getSourceCodeLocation();
        assertEquals("Mismatched method", methodName, scl.getMethodName());
        return op;
    }
View Full Code Here

                put("findPathMatchingResources", "classpath*:" + pkg.getName().replace('.', '/') + "/**/*.class");
            }
        };
        for (Operation captured : opCaptor.getAllValues()) {
            Operation op = assertScanOperation(captured);
            SourceCodeLocation scl = op.getSourceCodeLocation();
            String methodName = scl.getMethodName();
            String expectedLocation = locationsMap.remove(methodName);
            assertNotNull("Unnown method: " + methodName, expectedLocation);

            String actualLocation = op.get(SpringLifecycleMethodOperationCollectionAspect.EVENT_ATTR, String.class);
            assertEquals(methodName + ": Mismatched location", expectedLocation, actualLocation);
View Full Code Here

        request.setMethod("PUT");
        ModelAndView model = testHelper.handleURI("/my/uri", mockRequest, new HashMap<String, String>());
        assertEquals(Boolean.TRUE, model.getModelMap().get("success"));
        Operation op = getLastEntered();
        assertEquals("MyClass#gettinAction", op.getLabel());
        SourceCodeLocation sourceCode = op.getSourceCodeLocation();
        assertEquals("my.controller.MyClass", sourceCode.getClassName());
        assertEquals("gettinAction", sourceCode.getMethodName());
        assertEquals(1, sourceCode.getLineNumber());
        assertEquals("param1", op.get("actionParams", OperationList.class).get(0, OperationMap.class).get("key"));
        assertEquals("/my/uri", op.get("requestUri"));
        assertEquals("PUT", op.get("requestMethod"));
    }
View Full Code Here

                                                     String shortName,
                                                     String fullName,
                                                     String actionName) {
        assertEquals("Mismatched label", shortName + "#" + actionName, op.getLabel());

        SourceCodeLocation scl = op.getSourceCodeLocation();
        assertEquals("Mismatched class name", fullName, scl.getClassName());
        assertEquals("Mismatched method name", actionName, scl.getMethodName());
        return op;
    }
View Full Code Here

TOP

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

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.