Author: ccustine
Date: Mon May 25 23:24:42 2009
New Revision: 778535

URL: http://svn.apache.org/viewvc?rev=778535&view=rev
Log:
SMXCOMP-524 - Improve test coverage - ServiceMix :: JMS

Added:
    
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardConsumerEndpointTest.java
    
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardProviderEndpointTest.java
Modified:
    
servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java

Modified: 
servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java?rev=778535&r1=778534&r2=778535&view=diff
==============================================================================
--- 
servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java
 (original)
+++ 
servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java
 Mon May 25 23:24:42 2009
@@ -95,7 +95,7 @@
             }
             MessageConsumer consumer = session.createConsumer(destination);
             while (running.get()) {
-                Message message = consumer.receive();
+                Message message = consumer.receive(1000L);
                 if (message != null) {
                     onMessage(message);
                 }

Added: 
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardConsumerEndpointTest.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardConsumerEndpointTest.java?rev=778535&view=auto
==============================================================================
--- 
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardConsumerEndpointTest.java
 (added)
+++ 
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardConsumerEndpointTest.java
 Mon May 25 23:24:42 2009
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jms;
+
+import java.io.ByteArrayOutputStream;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.jbi.messaging.NormalizedMessage;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.common.JbiConstants;
+import org.apache.servicemix.components.util.EchoComponent;
+import org.apache.servicemix.components.util.MockServiceComponent;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jbi.util.FileUtil;
+import org.apache.servicemix.tck.MessageList;
+import org.apache.servicemix.tck.Receiver;
+import org.apache.servicemix.tck.ReceiverComponent;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.jms.core.MessageCreator;
+
+public class JmsStandardConsumerEndpointTest extends AbstractJmsTestSupport {
+
+    private static Log logger =  
LogFactory.getLog(JmsStandardConsumerEndpointTest.class);
+
+    /**
+     * Test property name.
+     */
+    private static final String MSG_PROPERTY = "PropertyTest";
+    private static final String MSG_PROPERTY_BLACKLISTED = "BadPropertyTest";
+
+    protected Receiver receiver;
+    protected SourceTransformer sourceTransformer = new SourceTransformer();
+    protected List<String> blackList;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        ReceiverComponent rec = new ReceiverComponent();
+        rec.setService(new QName("receiver"));
+        rec.setEndpoint("endpoint");
+        container.activateComponent(rec, "receiver");
+        receiver = rec;
+
+        EchoComponent echo = new EchoComponent();
+        echo.setService(new QName("echo"));
+        echo.setEndpoint("endpoint");
+        container.activateComponent(echo, "echo");
+
+        // initialize the black list
+        blackList = new LinkedList<String>();
+        blackList.add(MSG_PROPERTY_BLACKLISTED);
+    }
+
+    public void testWithoutProperties() throws Exception {
+        container.activateComponent(createEndpoint(), "servicemix-jms");
+        jmsTemplate.send("destination", new InternalCreator());
+        MessageList messageList = receiver.getMessageList();
+        messageList.assertMessagesReceived(1);
+        NormalizedMessage message = (NormalizedMessage) 
messageList.getMessages().get(0);
+        assertNull("Not expected property found", 
message.getProperty(MSG_PROPERTY));
+        assertNull("Not expected property found", 
message.getProperty(MSG_PROPERTY_BLACKLISTED));
+    }
+
+    public void testConsumerDefaultInOut() throws Exception {
+        JmsComponent component = new JmsComponent();
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("jms"));
+        endpoint.setEndpoint("endpoint");
+        endpoint.setTargetService(new QName("echo"));
+        endpoint.setRoleAsString("consumer");
+        endpoint.setProcessorName("standard");
+        endpoint.setConnectionFactory(connectionFactory);
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setJmsProviderReplyToName("replyDestination"); // Doesn't 
seem to work so have to use msg.replyto
+        endpoint.setDestinationStyle("queue");
+        endpoint.setDefaultMep(JbiConstants.IN_OUT);
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        jmsTemplate.send("destination", new InternalCreator());
+        jmsTemplate.setReceiveTimeout(4000);
+
+        TextMessage msg = (TextMessage) 
jmsTemplate.receive("replyDestination");
+        Element e = sourceTransformer.toDOMElement(new 
StringSource(msg.getText()));
+
+        assertEquals("hello", e.getTagName());
+        assertEquals("world", e.getTextContent());
+    }
+
+    public void testSoapConsumerSimple() throws Exception {
+        JmsComponent component = new JmsComponent();
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("uri:HelloWorld", "HelloService"));
+        endpoint.setEndpoint("HelloPort");
+        endpoint.setTargetService(new QName("mock"));
+        endpoint.setRoleAsString("consumer");
+        endpoint.setConnectionFactory(connectionFactory);
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setJmsProviderReplyToName("replyDestination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setSoap(true);
+        endpoint.setWsdlResource(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC.wsdl"));
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        MockServiceComponent mock = new MockServiceComponent();
+        mock.setService(new QName("mock"));
+        mock.setEndpoint("endpoint");
+        mock.setResponseXml(
+                "<jbi:message 
xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\";><jbi:part>hello</jbi:part></jbi:message>");
+        container.activateComponent(mock, "mock");
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input.xml").getInputStream(),
 baos);
+        jmsTemplate.send("destination", new InternalCreator(baos.toString()));
+
+        jmsTemplate.setReceiveTimeout(4000);
+        Message msg = jmsTemplate.receive("replyDestination");
+        assertNotNull(msg);
+        logger.info(((TextMessage) msg).getText());
+        
+    }
+
+    private JmsComponent createEndpoint() {
+        JmsComponent component = new JmsComponent();
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("jms"));
+        endpoint.setEndpoint("endpoint");
+        endpoint.setTargetService(new QName("receiver"));
+        endpoint.setProcessorName("standard");
+        endpoint.setRoleAsString("consumer");
+        endpoint.setDefaultMep(JbiConstants.IN_ONLY);
+        endpoint.setConnectionFactory(connectionFactory);
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        return component;
+    }
+
+    /**
+     * Simple interface implementation - sets message body and one property.
+     */
+    protected static class InternalCreator implements MessageCreator {
+        private String message;
+
+        public InternalCreator() {
+        }
+
+        public InternalCreator(String message) {
+            this.message = message;
+        }
+
+        public Message createMessage(Session session) throws JMSException {
+            TextMessage message = session.createTextMessage(null != 
this.message ? this.message : "<hello>world</hello>");
+            message.setJMSReplyTo(session.createQueue("replyDestination"));
+            message.setStringProperty(MSG_PROPERTY, "test");
+            message.setObjectProperty(MSG_PROPERTY_BLACKLISTED, new 
String("unwanted property"));
+            return message;
+        }
+    }
+}
\ No newline at end of file

Added: 
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardProviderEndpointTest.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardProviderEndpointTest.java?rev=778535&view=auto
==============================================================================
--- 
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardProviderEndpointTest.java
 (added)
+++ 
servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsStandardProviderEndpointTest.java
 Mon May 25 23:24:42 2009
@@ -0,0 +1,297 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jms;
+
+import java.io.ByteArrayOutputStream;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jbi.util.FileUtil;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.jms.core.MessageCreator;
+
+public class JmsStandardProviderEndpointTest extends AbstractJmsTestSupport {
+
+    /**
+     * Test property name.
+     */
+    private static final String MSG_PROPERTY = "PropertyTest";
+    private static final String MSG_PROPERTY_BLACKLISTED = "BadPropertyTest";
+
+    protected List<String> blackList;
+
+    public void testSendWithoutProperties() throws Exception {
+        container.activateComponent(createEndpoint(), "servicemix-jms");
+
+        InOnly me = client.createInOnlyExchange();
+        NormalizedMessage inMessage = me.getInMessage();
+        inMessage.setProperty(MSG_PROPERTY, "Test-Value");
+        inMessage.setProperty(MSG_PROPERTY_BLACKLISTED, "Unwanted value");
+        inMessage.setContent(new StringSource("<hello>world</hello>"));
+        me.setService(new QName("jms"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.DONE, me.getStatus());
+
+        Message msg = jmsTemplate.receive("destination");
+        assertNull("Found not expected property", msg
+            .getStringProperty(MSG_PROPERTY));
+        assertNull("Found blacklisted property", msg
+                   .getStringProperty(MSG_PROPERTY_BLACKLISTED));
+        assertNotNull(msg);
+    }
+
+    public void testProviderInOnlyWithoutReplyDest() throws Exception {
+        JmsComponent component = new JmsComponent();
+
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("uri:HelloWorld", "HelloService"));
+        endpoint.setEndpoint("HelloPort");
+        endpoint.setRoleAsString("provider");
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setProcessorName("standard");
+        endpoint.setConnectionFactory(connectionFactory);
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input-OneWay.xml").getInputStream(),
 baos);
+        InOnly me = client.createInOnlyExchange();
+        me.getInMessage().setContent(new StringSource(baos.toString()));
+
+        me.setOperation(new QName("uri:HelloWorld", "OneWay"));
+        me.setService(new QName("uri:HelloWorld", "HelloService"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.DONE, me.getStatus());
+
+        Message msg = jmsTemplate.receive("destination");
+        assertNotNull(msg);
+        System.err.println(((TextMessage) msg).getText());
+    }
+
+    public void testProviderInOutWithoutReplyDest() throws Exception {
+        JmsComponent component = new JmsComponent();
+
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("uri:HelloWorld", "HelloService"));
+        endpoint.setEndpoint("HelloPort");
+        endpoint.setRoleAsString("provider");
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setProcessorName("standard");
+        endpoint.setConnectionFactory(connectionFactory);
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        Thread th = new Thread() {
+            public void run() {
+                try {
+                    final Message msg = jmsTemplate.receive("destination");
+                    assertNotNull(msg);
+                    final ByteArrayOutputStream baos = new 
ByteArrayOutputStream();
+                    FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Output.xml")
+                                .getInputStream(), baos);
+                    jmsTemplate.send(msg.getJMSReplyTo(), new MessageCreator() 
{
+                        public Message createMessage(Session session) throws 
JMSException {
+                            TextMessage rep = 
session.createTextMessage(baos.toString());
+                            rep.setJMSCorrelationID(msg.getJMSCorrelationID() 
!= null ? msg.getJMSCorrelationID() : msg.getJMSMessageID());
+                            return rep;
+                        }
+                    });
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        };
+        th.start();
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input-OneWay.xml").getInputStream(),
 baos);
+        InOut me = client.createInOutExchange();
+        me.getInMessage().setContent(new StringSource(baos.toString()));
+        me.setOperation(new QName("uri:HelloWorld", "OneWay"));
+        me.setService(new QName("uri:HelloWorld", "HelloService"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
+        assertNotNull(me.getOutMessage());
+        assertNotNull(me.getOutMessage().getContent());
+        System.err.println(new 
SourceTransformer().contentToString(me.getOutMessage()));
+        client.done(me);
+    }
+
+    public void testSoapProviderInOnly() throws Exception {
+        JmsComponent component = new JmsComponent();
+
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("uri:HelloWorld", "HelloService"));
+        endpoint.setEndpoint("HelloPort");
+        endpoint.setRoleAsString("provider");
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setProcessorName("standard");
+        endpoint.setConnectionFactory(connectionFactory);
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        endpoint.setWsdlResource(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC.wsdl"));
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input-OneWay.xml").getInputStream(),
 baos);
+        InOnly me = client.createInOnlyExchange();
+        me.getInMessage().setContent(new StringSource(baos.toString()));
+
+        me.setOperation(new QName("uri:HelloWorld", "OneWay"));
+        me.setService(new QName("uri:HelloWorld", "HelloService"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.DONE, me.getStatus());
+    }
+
+    public void testSoapProviderInOut() throws Exception {
+        JmsComponent component = new JmsComponent();
+
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("uri:HelloWorld", "HelloService"));
+        endpoint.setEndpoint("HelloPort");
+        endpoint.setRoleAsString("provider");
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setProcessorName("standard");
+        endpoint.setConnectionFactory(connectionFactory);
+        endpoint.setJmsProviderReplyToName("reply");
+        endpoint.setWsdlResource(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC.wsdl"));
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        Thread th = new Thread() {
+            public void run() {
+                try {
+                    final Message msg = jmsTemplate.receive("destination");
+                    assertNotNull(msg);
+                    final ByteArrayOutputStream baos = new 
ByteArrayOutputStream();
+                    FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Output.xml")
+                                .getInputStream(), baos);
+                    jmsTemplate.send("reply", new MessageCreator() {
+                        public Message createMessage(Session session) throws 
JMSException {
+                            TextMessage rep = 
session.createTextMessage(baos.toString());
+                            rep.setJMSCorrelationID(msg.getJMSCorrelationID() 
!= null ? msg.getJMSCorrelationID() : msg.getJMSMessageID());
+                            return rep;
+                        }
+                    });
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        };
+        th.start();
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input-Hello.xml").getInputStream(),
 baos);
+        InOut me = client.createInOutExchange();
+        me.getInMessage().setContent(new StringSource(baos.toString()));
+        me.setOperation(new QName("uri:HelloWorld", "Hello"));
+        me.setService(new QName("uri:HelloWorld", "HelloService"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
+        assertNotNull(me.getOutMessage());
+        assertNotNull(me.getOutMessage().getContent());
+        System.err.println(new 
SourceTransformer().contentToString(me.getOutMessage()));
+        client.done(me);
+    }
+
+    public void testSoapProviderInOutWithoutReplyDest() throws Exception {
+        JmsComponent component = new JmsComponent();
+
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("uri:HelloWorld", "HelloService"));
+        endpoint.setEndpoint("HelloPort");
+        endpoint.setRoleAsString("provider");
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setProcessorName("standard");
+        endpoint.setConnectionFactory(connectionFactory);
+        endpoint.setJmsProviderReplyToName("reply");
+        endpoint.setWsdlResource(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC.wsdl"));
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        container.activateComponent(component, "servicemix-jms");
+
+        Thread th = new Thread() {
+            public void run() {
+                try {
+                    final Message msg = jmsTemplate.receive("destination");
+                    assertNotNull(msg);
+                    final ByteArrayOutputStream baos = new 
ByteArrayOutputStream();
+                    FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Output.xml")
+                                .getInputStream(), baos);
+                    jmsTemplate.send(msg.getJMSReplyTo(), new MessageCreator() 
{
+                        public Message createMessage(Session session) throws 
JMSException {
+                            TextMessage rep = 
session.createTextMessage(baos.toString());
+                            rep.setJMSCorrelationID(msg.getJMSCorrelationID() 
!= null ? msg.getJMSCorrelationID() : msg.getJMSMessageID());
+                            return rep;
+                        }
+                    });
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        };
+        th.start();
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(new 
ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input-Hello.xml").getInputStream(),
 baos);
+        InOut me = client.createInOutExchange();
+        me.getInMessage().setContent(new StringSource(baos.toString()));
+        me.setOperation(new QName("uri:HelloWorld", "Hello"));
+        me.setService(new QName("uri:HelloWorld", "HelloService"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
+        assertNotNull(me.getOutMessage());
+        assertNotNull(me.getOutMessage().getContent());
+        System.err.println(new 
SourceTransformer().contentToString(me.getOutMessage()));
+        client.done(me);
+
+    }
+
+    private JmsComponent createEndpoint() {
+        // initialize the black list
+        blackList = new LinkedList<String>();
+        blackList.add(MSG_PROPERTY_BLACKLISTED);
+
+        JmsComponent component = new JmsComponent();
+        JmsEndpoint endpoint = new JmsEndpoint();
+        endpoint.setService(new QName("jms"));
+        endpoint.setEndpoint("endpoint");
+        endpoint.setRoleAsString("provider");
+        endpoint.setConnectionFactory(connectionFactory);
+        endpoint.setJmsProviderDestinationName("destination");
+        endpoint.setDestinationStyle("queue");
+        endpoint.setProcessorName("standard");
+        component.setEndpoints(new JmsEndpoint[] {endpoint});
+        return component;
+    }
+}
\ No newline at end of file


Reply via email to