You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/10/06 12:04:32 UTC

svn commit: r822184 - in /tuscany/java/sca/itest/jms/non-sca-client: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/sca/ src/main/java/org/apache/tuscany/...

Author: antelder
Date: Tue Oct  6 10:04:31 2009
New Revision: 822184

URL: http://svn.apache.org/viewvc?rev=822184&view=rev
Log:
Separate the non-sca-client test out og the jms general itests

Added:
    tuscany/java/sca/itest/jms/non-sca-client/   (with props)
    tuscany/java/sca/itest/jms/non-sca-client/pom.xml
    tuscany/java/sca/itest/jms/non-sca-client/src/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
    tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
    tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/META-INF/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml
    tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/jndi.properties
    tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/nonSCAclient/
    tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite
    tuscany/java/sca/itest/jms/non-sca-client/src/test/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/
    tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java

Propchange: tuscany/java/sca/itest/jms/non-sca-client/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct  6 10:04:31 2009
@@ -0,0 +1,20 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+derby.log
+maven.log
+maven-eclipse.xml
+build.xml
+build-dependency.xml
+velocity.log*
+junit*.properties
+surefire*.properties
+.project
+.classpath
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders

Added: tuscany/java/sca/itest/jms/non-sca-client/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/pom.xml?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/pom.xml (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/pom.xml Tue Oct  6 10:04:31 2009
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-itest</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>itest-jms-non-sca-client-broker</artifactId>
+    <name>Apache Tuscany SCA iTest JMS with Non SCA Client</name>
+
+    <dependencies>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>        
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-impl</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>        
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-jms-runtime</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-core</artifactId>
+            <version>5.2.0</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.geronimo.specs</groupId>
+           <artifactId>geronimo-jms_1.1_spec</artifactId>
+           <version>1.1</version>
+           <scope>provided</scope>
+           <exclusions>
+               <exclusion>
+                   <groupId>org.apache.geronimo.specs</groupId>
+                   <artifactId>geronimo-jms_1.1_spec</artifactId>
+               </exclusion>
+           </exclusions>
+        </dependency>         
+                
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
+</project>

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java Tue Oct  6 10:04:31 2009
@@ -0,0 +1,29 @@
+/*
+ * 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.tuscany.sca.binding.jms;
+
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface OneWayObjectService {
+
+    @OneWay
+    void sayHello(Object name);
+}

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java Tue Oct  6 10:04:31 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.tuscany.sca.binding.jms;
+
+public class OneWayObjectServiceImpl implements OneWayObjectService {
+
+    public static Object mutex = new Object();
+    public static Object name;
+
+    public void sayHello(Object name) {
+        OneWayObjectServiceImpl.name = name;
+        synchronized (OneWayObjectServiceImpl.mutex) {
+            OneWayObjectServiceImpl.mutex.notify();
+        }
+    }
+
+}

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java Tue Oct  6 10:04:31 2009
@@ -0,0 +1,29 @@
+/*
+ * 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.tuscany.sca.binding.jms;
+
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface OneWayService {
+    
+    @OneWay
+    void sayHello(String name);
+}

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java Tue Oct  6 10:04:31 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.tuscany.sca.binding.jms;
+
+public class OneWayServiceImpl implements OneWayService {
+
+    public static Object mutex = new Object();
+    public static String name;
+    
+    public void sayHello(String name) {
+        OneWayServiceImpl.name = name;
+        synchronized (OneWayServiceImpl.mutex) {
+            OneWayServiceImpl.mutex.notify();
+        }
+    }
+
+}

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml Tue Oct  6 10:04:31 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+              xmlns:itest="http://itest">
+   <deployable composite="itest:ServiceComposite"/>
+</contribution>
\ No newline at end of file

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/jndi.properties
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/jndi.properties?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/jndi.properties (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/jndi.properties Tue Oct  6 10:04:31 2009
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as. 
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.RequestQueue = RequestQueue
+queue.ResponseQueue = ResponseQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi

Added: tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite Tue Oct  6 10:04:31 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+           targetNamespace="http://itest"
+           name="ServiceComposite">
+
+    <component name="DefaultService">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
+        <service name="OneWayService">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623">
+                <tuscany:wireFormat.jmsTextXML/>
+            </binding.jms>
+        </service>
+    </component>
+
+    <component name="TextService">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
+        <service name="OneWayService">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623"
+                         uri="jms:TextDest">
+                <tuscany:wireFormat.jmsText/>
+            </binding.jms>
+        </service>
+    </component>
+
+    <component name="ObjectService">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayObjectServiceImpl"/>
+        <service name="OneWayObjectService">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623"
+                         uri="jms:ObjectDest">
+                <tuscany:wireFormat.jmsObject /> <!-- test that wrapSingle default works -->
+            </binding.jms>
+        </service>
+    </component>
+
+</composite>

Added: tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java?rev=822184&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java (added)
+++ tuscany/java/sca/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java Tue Oct  6 10:04:31 2009
@@ -0,0 +1,144 @@
+/*
+ * 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.tuscany.sca.binding.jms;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryImpl;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This shows how to test the JMS binding using a simple HelloWorld application.
+ */
+public class NonSCAClientTestCase {
+
+    private static Node node;
+
+    @Before
+    public void init() throws Exception {
+        startBroker();
+        node = NodeFactory.newInstance().createNode().start();
+    }
+
+    @After
+    public void end() throws Exception {
+        if (node != null) {
+            node.stop();
+        }
+        stopBroker();
+    }
+
+
+    @Test
+    public void testXMLText() throws Exception {
+
+        synchronized (OneWayServiceImpl.mutex) {
+
+            sendTextMessage("dynamicQueues/OneWayService", "<ns2:sayHello xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><arg0>Petra</arg0></ns2:sayHello>");
+
+            // wait up to 10 seconds but it will likely be a lot less
+            // as the service invocation will wake this up earlier
+            if (OneWayServiceImpl.name == null) {
+                OneWayServiceImpl.mutex.wait(10000);
+            }
+        }
+        assertEquals("Petra", OneWayServiceImpl.name);
+    }
+
+    @Test
+    public void testText() throws Exception {
+
+        synchronized (OneWayServiceImpl.mutex) {
+
+            sendTextMessage("dynamicQueues/TextDest", "Petra");
+
+            // wait up to 10 seconds but it will likely be a lot less
+            // as the service invocation will wake this up earlier
+            OneWayServiceImpl.mutex.wait(10000);
+        }
+        assertEquals("Petra", OneWayServiceImpl.name);
+    }
+
+    @Test
+    public void testObject() throws Exception {
+
+        Set<Integer> arg = new HashSet<Integer>();
+        arg.add(new Integer(3));
+
+        synchronized (OneWayObjectServiceImpl.mutex) {
+
+            sendObjectMessage("dynamicQueues/ObjectDest", arg);
+
+            // wait up to 10 seconds but it will likely be a lot less
+            // as the service invocation will wake this up earlier
+            OneWayObjectServiceImpl.mutex.wait(10000);
+        }
+        assertEquals(arg, OneWayObjectServiceImpl.name);
+    }
+
+    private static BrokerService broker;
+    protected static void startBroker() throws Exception {
+        broker = new BrokerService();
+        broker.setPersistent(false);
+        broker.setUseJmx(false);
+        broker.addConnector("tcp://localhost:61623");
+        broker.start();
+    }
+
+    protected static void stopBroker() throws Exception {
+        if (broker != null) {
+            broker.stop();
+        }
+    }
+
+    protected static void sendTextMessage(String destName, String payload) throws JMSException, NamingException {
+        JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, null, "tcp://localhost:61623");
+        Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageProducer p = session.createProducer(rf.lookupDestination(destName));
+        rf.getConnection().start();
+        session.run();
+        p.send(session.createTextMessage(payload));
+        rf.closeConnection();
+    }
+
+    protected static void sendObjectMessage(String destName, Object payload) throws JMSException, NamingException {
+        JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, null, "tcp://localhost:61623");
+        Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageProducer p = session.createProducer(rf.lookupDestination(destName));
+        rf.getConnection().start();
+        session.run();
+        p.send(session.createObjectMessage((Serializable)payload));
+        rf.closeConnection();
+    }
+}