Package org.jboss.soa.esb.message

Examples of org.jboss.soa.esb.message.Message


    @SuppressWarnings("unchecked")
    public void test_OgnlMap_ResponseProcessing_1() throws ConfigurationException, ActionProcessingException {
        ConfigTree actionConfig = configUtil.getActionConfig("OrderNotificationService", "soapui-client-action-02");
        SOAPClient soapClient = new SOAPClient(actionConfig);
        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, response_01);
        Map<String, String> response = (Map<String, String>) message.getBody().get();
        assertEquals("true", response.get("customerOrderAck"));

        soapClient.processResponse(message, response_02);
        response = (Map<String, String>) message.getBody().get();
        assertEquals("false", response.get("customerOrderAck"));
    }
View Full Code Here


    public void test_OgnlMap_ResponseProcessing_2() throws ConfigurationException, ActionProcessingException {
        ConfigTree actionConfig = configUtil.getActionConfig("OrderNotificationService", "soapui-client-action-05");
        SOAPClient soapClient = new SOAPClient(actionConfig);
        String responseString = new String(StreamUtils.readStream(getClass().getResourceAsStream("soap-message-01.xml")));
        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, new Response(responseString));
        @SuppressWarnings("unused")
    Order order = (Order) message.getBody().get();
        //assertEquals();
    }
View Full Code Here

    @Test
    public void ensureSecurityContextWasMappedToJbpmMap() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
    {
        final SealedObject securityContext = createSealedObject("dummy string");
        final Message message = MessageFactory.getInstance().getMessage();
        message.getContext().setContext(SecurityService.CONTEXT, securityContext);

        final HashMap<String,?> map = mapper.mapSecurityContextFromEsbMessageToJBpmMap(message);
        assertNotNull("Should never return null. Can return an empty map though", map);
        assertTrue(map.containsKey(Constants.SECURITY_CONTEXT));
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void test_OgnlMap_ResponseProcessing_3() throws ConfigurationException, ActionProcessingException {
        ConfigTree actionConfig = configUtil.getActionConfig("OrderNotificationService", "soapui-client-action-02");
        SOAPClient soapClient = new SOAPClient(actionConfig);
        String responseString = new String(StreamUtils.readStream(getClass().getResourceAsStream("soap-message-01.xml")));
        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, new Response(responseString));
        Map<String, String> responseMap = (Map<String, String>) message.getBody().get();

        assertEquals("{customerOrder.orderheader.customerName=Tom Fennelly, customerOrder.items[0].partNumber=1, customerOrder.items[0].description=desc-1, customerOrder.items[0].quantity=1, customerOrder.items[0].price=1.1, customerOrder.items[0].extensionAmount=1, customerOrder.items[1].partNumber=2, customerOrder.items[1].description=desc-2, customerOrder.items[1].quantity=2, customerOrder.items[1].price=2.2, customerOrder.items[1].extensionAmount=2}", responseMap.toString());
    }
View Full Code Here

    @Test
    public void ensureAuthRequestWasMappedToJbpmMap() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
    {
        //  Doesn't need to be encrypted as this is only passed along and never descrypted.
        byte[] encryptedAuthRequest = new byte[100];
        final Message message = MessageFactory.getInstance().getMessage();
        message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);

        final HashMap<String,?> map = mapper.mapAuthRequestFromEsbMessageToJBpmMap(message);
        assertNotNull("Should never return null. Can return an empty map though", map);
        assertTrue(map.containsKey(Constants.AUTH_REQUEST));
    }
View Full Code Here

                          " processOrderResponse.OrderStatus.lineItems[1].comments[0]=Item2 Comments1," +
                          " processOrderResponse.OrderStatus.lineItems[1].comments[1]=Item2 Comments2," +
                          " processOrderResponse.OrderStatus.lineItems[1].comments[2]=Item2 Comments3," +
                          " processOrderResponse.OrderStatus.lineItems[1].comments[3]=Item2 Comments4}";

        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, new Response(responseString));
        Map<String, String> responseMap = (Map<String, String>) message.getBody().get();

        assertEquals(expected, responseMap.toString());
    }
View Full Code Here

        String expected = "{orderResponse.orderStatus[0].id=1," +
                          " orderResponse.orderStatus[0].comment=order 1 processed," +
                          " orderResponse.orderStatus[1].id=2," +
                          " orderResponse.orderStatus[1].comment=order 2 processed}";

        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, new Response(responseString));
        Map<String, String> responseMap = (Map<String, String>) message.getBody().get();

        assertEquals(expected, responseMap.toString());
    }
View Full Code Here

    }

    public void test_No_ResponseProcessing() throws ConfigurationException, ActionProcessingException {
        ConfigTree actionConfig = configUtil.getActionConfig("OrderNotificationService", "soapui-client-action-03");
        SOAPClient soapClient = new SOAPClient(actionConfig);
        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, response_01);
        assertEquals(response_01.getBody(), message.getBody().get());
    }
View Full Code Here

    }

    public void test_ResponseLocation() throws ConfigurationException, ActionProcessingException {
        ConfigTree actionConfig = configUtil.getActionConfig("OrderNotificationService", "soapui-client-action-04");
        SOAPClient soapClient = new SOAPClient(actionConfig);
        Message message = MessageFactory.getInstance().getMessage();

        soapClient.processResponse(message, response_01);
        assertEquals(response_01.getBody(), message.getBody().get("myTestLocation"));
    }
View Full Code Here

            wsEndpointServer.start();
            try {
                new AbstractTestRunner() {
                    public void test() throws Exception {
                        ServiceInvoker invoker = new ServiceInvoker("OrderManagement", "GoodbyeService");
                        Message message = MessageFactory.getInstance().getMessage();
                        Map params = new HashMap();

                        params.put("sayGoodbye.message", "Goodbye Henry!!");
                        message.getBody().add(params);

                        message = invoker.deliverSync(message, 10000);

                        String soapResponse = (String) message.getBody().get();
                        assertEquals("<response/>", soapResponse);
                    }
                }.setServiceConfig(esbConfig).run();
            } finally {
                wsEndpointServer.stop();
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.message.Message

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.