Package com.springsource.insight.intercept.operation

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


        // Step 1: Execute test
        WebFlowExecutionTest webFlow = new WebFlowExecutionTest();
        webFlow.testTransition();

        // Step 2:  Get the Operation that was just created by our aspect
        Operation op = getLastEntered();

        // Step 3:  Validate
        assertNotNull(op);
        assert op.getType().getName().equals("wf-transition");

        assert "cancel".equals(op.get("codeId"));
        assert "cancel".equals(op.get("stateId"));

        OperationMap map = (OperationMap) op.get("attribs");
        assertNotNull(map.get("bind"));

        OperationList list = (OperationList) op.get("actions");
        assert "flowScope.persons=personDao.findPersons()".equals(list.get(0));
    }
View Full Code Here


    @Test
    public void testExtractTextMessageTypeAttributes() throws JMSException {
        TextMessage txtMessage = mock(TextMessage.class);
        when(txtMessage.getText()).thenReturn("test-text");

        Operation op = new Operation();

        extractMessageTypeAttributes(op, txtMessage);

        String type = op.get(MESSAGE_TYPE, String.class);
        String content = op.get(MESSAGE_CONTENT, String.class);

        assertEquals(MessageType.TextMessage.name(), type);
        assertEquals("test-text", content);
        assertNull(op.get(MESSAGE_CONTENT_MAP));
    }
View Full Code Here

    @Test
    public void testExtractBytesMessageTypeAttributes() throws JMSException {
        BytesMessage bytesMessage = mock(BytesMessage.class);

        Operation op = new Operation();

        extractMessageTypeAttributes(op, bytesMessage);

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

        assertEquals(MessageType.BytesMessage.name(), type);
        assertNull(op.get(MESSAGE_CONTENT));
        assertNull(op.get(MESSAGE_CONTENT_MAP));
    }
View Full Code Here

    @Test
    public void testExtractObjectMessageTypeAttributes() throws JMSException {
        ObjectMessage objectMessage = mock(ObjectMessage.class);

        Operation op = new Operation();

        extractMessageTypeAttributes(op, objectMessage);

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

        assertEquals(MessageType.ObjectMessage.name(), type);
        assertNull(op.get(MESSAGE_CONTENT));
        assertNull(op.get(MESSAGE_CONTENT_MAP));
    }
View Full Code Here

        final Date[] invocationArgs = {new Date(System.currentTimeMillis())};
        testedService.beforeCompletion();
        testedService.invokeMe(invocationArgs[0]);
        testedService.afterCompletion(true);

        final Operation op = getLastEntered();
        assertNotNull("No operation extracted", op);
        assertEquals("Mismatched " + annClass.getSimpleName() + " EJB operation type(s)", Ejb3LocalServiceDefinitions.TYPE, op.getType());

        // see JoinPointBreakDownSourceCodeLocationFinalizer#populateOperation
        assertEquals("Mismatched " + annClass.getSimpleName() + " class name", testedServiceClass.getName(), op.get(OperationFields.CLASS_NAME, String.class));
        assertEquals("Mismatched " + annClass.getSimpleName() + " invocation method", "invokeMe", op.get("methodName", String.class));

        final OperationList argsList = op.get(OperationFields.ARGUMENTS, OperationList.class);
        assertNotNull("Missing " + annClass.getSimpleName() + " invocation arguments", argsList);
        assertEquals("Mismatched " + annClass.getSimpleName() + " num. of invocation arguments", invocationArgs.length, argsList.size());

        for (int aIndex = 0; aIndex < invocationArgs.length; aIndex++) {
            final Object expArg = invocationArgs[aIndex], actArg = argsList.get(aIndex);
View Full Code Here

    @Test
    public void testExtractStreamMessageTypeAttributes() throws JMSException {
        StreamMessage objectMessage = mock(StreamMessage.class);

        Operation op = new Operation();

        extractMessageTypeAttributes(op, objectMessage);

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

        assertEquals(MessageType.StreamMessage.name(), type);
        assertNull(op.get(MESSAGE_CONTENT));
        assertNull(op.get(MESSAGE_CONTENT_MAP));
    }
View Full Code Here

        // Step 1: Execute test
        WebFlowExecutionTest webFlow = new WebFlowExecutionTest();
        webFlow.testFullFlow();

        // Step 2:  Get the Operation that was just created by our aspect
        Operation op = getLastEntered();

        // Step 3:  Validate
        assertNotNull(op);
        assert op.getType().getName().equals("wf-start");

        assertNotNull(op.get("flowId"));
        assertNotNull(op.get("initParams"));

        OperationMap map = (OperationMap) op.get("initParams");
        assertNotNull(map.get("id"));
    }
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

                    throw e;
                } finally {
                    context.close();
                }

                Operation op = assertContextOperation(TEST_NAME, BASE_DN, environment);
                assertEquals(TEST_NAME + ": Mismatched filter",
                        TEST_FILTER, op.get(LdapDefinitions.LOOKUP_FILTER_ATTR, String.class));
                assertExternalResourceAnalysis(TEST_NAME, op, (String) environment.get(Context.PROVIDER_URL));
                Mockito.reset(spiedOperationCollector); // prepare for next iteration
            }
        }
    }
View Full Code Here

    public void testUntrackedConnectionClose() throws SQLException {
        OperationCollectionAspectSupport aspectInstance = getAspect();
        final AtomicReference<Operation> opRef = new AtomicReference<Operation>(null);
        aspectInstance.setCollector(new OperationCollector() {
            public void enter(Operation operation) {
                Operation prev = opRef.getAndSet(operation);
                assertNull("Multiple enter calls", prev);
            }

            public void exitNormal() {
                // ignored
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.