Package com.springsource.insight.intercept.operation

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


        assertNullValue("Unexpected parameters map", operation.get(JdbcOperationFinalizer.PARAMS_VALUES));
    }

    @Test
    public void testIndexedParamsValuesClearedBetweenSuccessiveInvocations() {
        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


        assertEquals("Mismatched number of results", 0, res.size());
    }

    @Test
    public void testNoRemoteFrame() throws Exception {
        Operation op = new Operation();
        op.type(GemFireDefenitions.TYPE_REGION.getType());

        Frame frame = new SimpleFrame(FrameId.valueOf("0"),
                null,
                op,
                TimeRange.milliTimeRange(0, 1),
View Full Code Here

    public void testCreateLabelStatement() {
        assertEquals("JDBC STATEMENT", JdbcOperationFinalizer.createLabel("ALTER MY DRESS"));
    }

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

        assertEquals("Gemfire external incoming", Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }

    @Test
    public void testUnknownPort() throws Exception {
        Operation op = new Operation();
        op.type(GemFireDefenitions.TYPE_REMOTE.getType());
        String host = "localhost";
        op.put(GemFireDefenitions.FIELD_HOST, host);

        Frame frame = new SimpleFrame(FrameId.valueOf("0"),
                null,
                op,
                TimeRange.milliTimeRange(0, 1),
View Full Code Here

    @Test
    public void testAddDestinationDetailsToMapIfNeeded() throws JMSException {
        Queue queue = mock(Queue.class);
        when(queue.getQueueName()).thenReturn("mock-queue");

        Operation op = new Operation();
        OperationMap map = op.createMap("test-map");

        addDestinationDetailsToMapIfNeeded(queue, map, null, Collections.<String>emptyList(), "test");

        String type = map.get("test" + TYPE, String.class);
        String name = map.get("test" + NAME, String.class);

        assertNotNull(type);
        assertNotNull(name);

        assertEquals(type, DestinationType.Queue.name());
        assertEquals(name, "mock-queue");

        queue = null;
        op = new Operation();
        map = op.createMap("test-map");

        addDestinationDetailsToMapIfNeeded(queue, map, null, Collections.<String>emptyList(), "test");
        type = map.get("test" + TYPE, String.class);
        name = map.get("test" + NAME, String.class);
View Full Code Here

        assertEquals("Gemfire external incoming", Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }

    @Test
    public void testUnknownHost() throws Exception {
        Operation op = new Operation();
        op.type(GemFireDefenitions.TYPE_REMOTE.getType());
        int port = 12345;
        op.put(GemFireDefenitions.FIELD_PORT, port);

        Frame frame = new SimpleFrame(FrameId.valueOf("0"),
                null,
                op,
                TimeRange.milliTimeRange(0, 1),
View Full Code Here

        assertEquals("Mismatched number of results", 0, res.size());
    }

    @Test
    public void testNoRemoteFrame() throws Exception {
        Operation op = new Operation();
        op.type(GemFireDefenitions.TYPE_REGION.getType());

        Frame frame = new SimpleFrame(FrameId.valueOf("0"),
                null,
                op,
                TimeRange.milliTimeRange(0, 1),
View Full Code Here

    public void testExtractMessageAttributes() throws JMSException {
        Message message = mock(Message.class);

        final Map<String, Object> mockMap = mockAttributes(message);

        Operation op = new Operation();
        extractMessageProperties(op, message, null, Collections.<String>emptyList());
        assertAttributes(mockMap, op);
    }
View Full Code Here

    public void testExtractMessageHeaders() throws JMSException {
        Message message = mock(Message.class);

        mockHeaders(message);

        Operation op = new Operation();

        extractMessageHeaders(op, message, null, Collections.<String>emptyList());
        assertHeaders(message, op);
    }
View Full Code Here

            public void describeTo(Description desc) {
                // do nothing
            }
        }))).thenReturn(mockMap.get("test-key"));

        Operation op = new Operation();

        extractMessageTypeAttributes(op, mapMessage);

        String type = op.get(MESSAGE_TYPE, String.class);
        OperationMap contentMap = op.get(MESSAGE_CONTENT_MAP, OperationMap.class);

        assertNotNull(contentMap);
        assertEquals(mockMap.size(), contentMap.size());
        assertEquals(mockMap.get("test-key"), contentMap.get("test-key"));
        assertEquals(MessageType.MapMessage.name(), type);
        assertNull(op.get(MESSAGE_CONTENT));
    }
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.