summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest/jms-nulls
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-19 18:41:18 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-19 18:41:18 +0000
commit38161c22705d912c8ef0e2c82f4a4a8dd0cc0651 (patch)
tree7557442db773298116a815c125ab9f0287d2a6a7 /branches/sca-java-1.x/itest/jms-nulls
parent614a2e5ec9d9f1ddebf2e100d3ec82032d72af02 (diff)
TUSCANY-2861: Add an itest for sending/receiving null
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@745956 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/itest/jms-nulls')
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/.externalToolBuilders/Maven_Ant_Builder.launch24
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/maven-eclipse.xml8
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/pom.xml99
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java41
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java28
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java28
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/src/main/resources/jndi.properties38
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/src/main/resources/nulls.composite58
-rw-r--r--branches/sca-java-1.x/itest/jms-nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java59
9 files changed, 383 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/itest/jms-nulls/.externalToolBuilders/Maven_Ant_Builder.launch b/branches/sca-java-1.x/itest/jms-nulls/.externalToolBuilders/Maven_Ant_Builder.launch
new file mode 100644
index 0000000000..a4b59297f2
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/.externalToolBuilders/Maven_Ant_Builder.launch
@@ -0,0 +1,24 @@
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+ <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+ <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
+ <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+ <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+ <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="itest-jms-nulls"/>
+ <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+ <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${build_project}/maven-eclipse.xml"/>
+ <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/>
+ <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+ <booleanAttribute key="org.eclipse.debug.core.capture_output" value="false"/>
+ <stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&apos;1.0&apos;?&gt;&lt;launchConfigurationWorkingSet editPageId=&apos;org.eclipse.ui.resourceWorkingSetPage&apos; factoryID=&apos;org.eclipse.ui.internal.WorkingSetFactory&apos; label=&apos;workingSet&apos; name=&apos;workingSet&apos;&gt;&lt;item factoryID=&apos;org.eclipse.ui.internal.model.ResourceFactory&apos; path=&apos;itest-jms-nulls&apos; type=&apos;4&apos;/&gt;&lt;/launchConfigurationWorkingSet&gt;}"/>
+ <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+ <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+ <booleanAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON" value="false"/>
+ <booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+ <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/itest-jms-nulls/maven-eclipse.xml"/>
+ </listAttribute>
+</launchConfiguration> \ No newline at end of file
diff --git a/branches/sca-java-1.x/itest/jms-nulls/maven-eclipse.xml b/branches/sca-java-1.x/itest/jms-nulls/maven-eclipse.xml
new file mode 100644
index 0000000000..17287010ed
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/maven-eclipse.xml
@@ -0,0 +1,8 @@
+<project default="copy-resources">
+ <target name="init"/>
+ <target name="copy-resources" depends="init">
+ <copy todir="target/classes/META-INF" filtering="true">
+ <fileset dir="." includes="LICENSE|NOTICE"/>
+ </copy>
+ </target>
+</project> \ No newline at end of file
diff --git a/branches/sca-java-1.x/itest/jms-nulls/pom.xml b/branches/sca-java-1.x/itest/jms-nulls/pom.xml
new file mode 100644
index 0000000000..3cbba615b7
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/pom.xml
@@ -0,0 +1,99 @@
+<?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>1.5-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-jms-nulls</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Nulls</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jms-asf</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- uses ActiveMQ 5.1 as 4.1 Session.createQueue does not work using
+ a temporary queue name -->
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>5.1.0</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java b/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
new file mode 100644
index 0000000000..f7f930f443
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
@@ -0,0 +1,41 @@
+/*
+ * 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.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the OneWay service.
+ */
+@Service(MyService.class)
+public class ClientImpl implements MyService {
+
+ private MyService serviceA;
+
+ @Reference
+ public void setServiceA(MyService service) {
+ this.serviceA = service;
+ }
+
+ public void sayHello() {
+ serviceA.sayHello();
+ }
+
+}
diff --git a/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java b/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
new file mode 100644
index 0000000000..5c43f02ca4
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
@@ -0,0 +1,28 @@
+/*
+ * 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.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface MyService {
+
+ void sayHello();
+
+}
diff --git a/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java b/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
new file mode 100644
index 0000000000..89758becff
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
@@ -0,0 +1,28 @@
+/*
+ * 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 ServiceImpl implements MyService {
+
+ public void sayHello() {
+ }
+
+}
diff --git a/branches/sca-java-1.x/itest/jms-nulls/src/main/resources/jndi.properties b/branches/sca-java-1.x/itest/jms-nulls/src/main/resources/jndi.properties
new file mode 100644
index 0000000000..bb431a592b
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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&broker.useJmx=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory, ConnectionFactory2
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+topic.ServiceTopic = ServiceTopic
+
+# END SNIPPET: jndi
diff --git a/branches/sca-java-1.x/itest/jms-nulls/src/main/resources/nulls.composite b/branches/sca-java-1.x/itest/jms-nulls/src/main/resources/nulls.composite
new file mode 100644
index 0000000000..99717d4c0f
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/src/main/resources/nulls.composite
@@ -0,0 +1,58 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://jms"
+ xmlns:itest="http://jms"
+ name="Nulls">
+
+ <component name="Client1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:MyService" />
+ </reference>
+ </component>
+
+ <component name="Service1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
+ <service name="MyService">
+ <binding.jms />
+ </service>
+ </component>
+
+ <component name="Client2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:MyService2">
+ <tuscany:wireFormat.jmsObject/>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="Service2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
+ <service name="MyService">
+ <binding.jms uri="jms:MyService2">
+ <tuscany:wireFormat.jmsObject/>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-1.x/itest/jms-nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java b/branches/sca-java-1.x/itest/jms-nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java
new file mode 100644
index 0000000000..e8aa803369
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ */
+public class NullsTestCase {
+
+ private static SCADomain scaDomain;
+
+ @Before
+ public void init() {
+ scaDomain = SCADomain.newInstance("http://localhost", "/", "nulls.composite");
+ }
+
+ @Test
+ public void testSayHello() throws Exception {
+ MyService client1 = scaDomain.getService(MyService.class, "Client1");
+
+ client1.sayHello();
+
+ }
+
+ @Test
+ public void testSayHelloObjectFormat() throws Exception {
+ MyService client1 = scaDomain.getService(MyService.class, "Client2");
+
+ client1.sayHello();
+
+ }
+
+ @After
+ public void end() {
+ if (scaDomain != null) {
+ scaDomain.close();
+ }
+ }
+}