Package com.springsource.insight.intercept.operation

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


            return Collections.emptyList();
        }

        List<ExternalResourceDescriptor> dbDescriptors = new ArrayList<ExternalResourceDescriptor>(dbFrames.size());
        for (Frame dbFrame : dbFrames) {
            Operation op = dbFrame.getOperation();
            String host = op.get("host", String.class);
            int port = op.getInt("port", (-1));
            String dbName = op.get("dbName", String.class);

            String mongoHash = MD5NameGenerator.getName(dbName + host + port);
            String color = colorManager.getColor(op);
            dbDescriptors.add(new ExternalResourceDescriptor(dbFrame,
                    "mongo:" + mongoHash,
View Full Code Here


    static Frame createFrame(Frame parent, URI uri) {
        return createFrame(parent, uri.toString());
    }

    static Frame createFrame(Frame parent, String uri) {
        Operation op = new Operation().type(HttpClientDefinitions.TYPE);
        op.createMap("request").put(OperationFields.URI, uri);

        return new SimpleFrame(FrameId.valueOf(String.valueOf(frameIdGenerator.incrementAndGet())),
                parent,
                op,
                TimeRange.milliTimeRange(0, 1),
View Full Code Here

    }

    @Override
    public void run() {
        OperationCollector collector = getCollector();
        Operation op = createRootOperation(Thread.currentThread());
        collector.enter(op);
        try {
            Runnable command = getRunner();
            command.run();
            collector.exitNormal();
View Full Code Here

            throw e;
        }
    }

    Operation createRootOperation(Thread curThread) {
        Operation op = new Operation()
                .type(RunExecDefinitions.RUN_OP)
                .label(rootLabel)
                .sourceCodeLocation(rootLocation)
                .put(RunExecDefinitions.THREADNAME_ATTR, curThread.getName())
                .put(RunExecDefinitions.RUNNERID_ATTR, getRunnerId());
View Full Code Here

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

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

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

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

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

        return trace.getAllFramesOfType(HttpClientDefinitions.TYPE);
    }

    @Override
    public TraceError locateFrameError(Frame httpFrame) {
        Operation op = (httpFrame == null) ? null : httpFrame.getOperation();
        // NOTE: if an IOException occurred we will not have a response either
        OperationMap response = (op == null) ? null : op.get("response", OperationMap.class);
        if (response == null) {
            return null;
        }

        int statusCode = response.getInt(STATUS_CODE_ATTR, (-1));
View Full Code Here

        final Frame lastChildFrame = children.get(children.size() - 2);
        return sameMethod(currentFrame, lastChildFrame);
    }

    private boolean sameMethod(final Frame currentFrame, final Frame lastChildFrame) {
        final Operation lastOperation = lastChildFrame.getOperation();
        final String lastMethod = getMethodAttribute(lastOperation);
        final Operation currentOperation = currentFrame.getOperation();
        final String currentMethod = getMethodAttribute(currentOperation);
        return lastMethod.equals(currentMethod);
    }
View Full Code Here

    }

    protected Operation assertTransactionOperation(String testName,
                                                   TransactionOperationStatus opStatus,
                                                   TransactionDefinition txDefinition) {
        Operation op = getLastEntered();
        assertNotNull(testName + ": No operation extracted", op);
        assertEquals(testName + ": Mismatched operation type", TransactionOperationCollectionAspect.TYPE, op.getType());
        assertEquals(testName + ": Mismatched name", txDefinition.getName(), op.get("name", String.class));
        assertEquals(testName + ": Mismatched read only value",
                Boolean.valueOf(txDefinition.isReadOnly()), op.get("readOnly", Boolean.class));
        assertEquals(testName + ": Mismatched timeout value", txDefinition.getTimeout(), op.getInt("timeout", (-1)));

        Operation dummyOp = new Operation()
                .put("propagation", txDefinition.getPropagationBehavior())
                .put("isolation", txDefinition.getIsolationLevel());
        assertEquals(testName + ": Mismatched propagation value",
                TransactionOperationFinalizer.normalizePropagation(dummyOp),
                op.get("propagation", String.class));
View Full Code Here

        }

        List<ExternalResourceDescriptor> queueDescriptors =
                new ArrayList<ExternalResourceDescriptor>(cacheFrames.size());
        for (Frame cacheFrame : cacheFrames) {
            Operation op = cacheFrame.getOperation();

            String label = buildLabel(op);

            String hashString = MD5NameGenerator.getName(label);
            String color = colorManager.getColor(op);
View Full Code Here

        if (obscureAttrs) {
            AbstractJMSCollectionAspect.OBFUSCATED_PROPERTIES.addAll(msgAttributesMap.keySet());
        }
        producer.send(_mockMessage);

        Operation op = getLastEntered();
        assertNotNull("No operation extracted", op);
        assertEquals("Mismatched operation type", JMSPluginOperationType.SEND.getOperationType(), op.getType());
        assertEquals("Mismatched label", JMSPluginOperationType.SEND.getLabel(), op.getLabel());
        assertEquals("Mismatched destination type", type.getLabel(), op.get("destinationType", String.class));

        JMSPluginUtilsTest.assertHeaders(_mockMessage, op);
        JMSPluginUtilsTest.assertAttributes(msgAttributesMap, op);

        assertObfuscatedValuesState(msgAttributesMap, obscureAttrs);
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.