summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.4/itest/jms-format/src/test
diff options
context:
space:
mode:
authorramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2008-12-02 11:17:24 +0000
committerramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2008-12-02 11:17:24 +0000
commiteed639ccf7fd95e0b31caf61787126e69592f207 (patch)
tree401cafc53175c67ac1aea5398986400b416bcde3 /branches/sca-java-1.4/itest/jms-format/src/test
parente2af7d8b2dc498e63375fec8d97186dc261a428f (diff)
Branch for 1.4
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@722428 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.4/itest/jms-format/src/test')
-rw-r--r--branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java64
-rw-r--r--branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java64
-rw-r--r--branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java66
-rw-r--r--branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java68
4 files changed, 262 insertions, 0 deletions
diff --git a/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
new file mode 100644
index 0000000000..a242206080
--- /dev/null
+++ b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.format;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.binding.jms.format.jmsbytes.helloworld.HelloWorldReference;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+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 FormatJMSBytesTestCase {
+
+ private static SCANode node;
+
+ @Before
+ public void init() {
+ SCANodeFactory factory = SCANodeFactory.newInstance();
+ node = factory.createSCANode("jmsbytes/helloworld.composite",
+ new SCAContribution("test", "./target/classes"));
+
+ node.start();
+ }
+
+ @Test
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldReference helloWorldService = ((SCAClient)node).getService(HelloWorldReference.class, "HelloWorldReferenceComponent");
+
+ System.out.println(helloWorldService.getGreetings("Fred Bloggs"));
+ assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
+
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
new file mode 100644
index 0000000000..c617a984ef
--- /dev/null
+++ b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.format;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.binding.jms.format.jmsmessage.helloworld.HelloWorldReference;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+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 FormatJMSMessageTestCase {
+
+ private static SCANode node;
+
+ @Before
+ public void init() {
+ SCANodeFactory factory = SCANodeFactory.newInstance();
+ node = factory.createSCANode("jmsmessage/helloworld.composite",
+ new SCAContribution("test", "./target/classes"));
+
+ node.start();
+ }
+
+ @Test
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldReference helloWorldService = ((SCAClient)node).getService(HelloWorldReference.class, "HelloWorldReferenceComponent");
+
+ System.out.println(helloWorldService.getGreetings("Fred Bloggs"));
+ assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
+
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java
new file mode 100644
index 0000000000..5306497a3f
--- /dev/null
+++ b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java
@@ -0,0 +1,66 @@
+/*
+ * 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.format;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.binding.jms.format.jmsobject.helloworld.HelloWorldReference;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+/**
+ * This shows how to test the JMS binding using a simple HelloWorld application.
+ */
+public class FormatJMSObjectTestCase {
+
+ private static SCANode node;
+
+ @Before
+ public void init() {
+ SCANodeFactory factory = SCANodeFactory.newInstance();
+ node = factory.createSCANode("jmsobject/helloworld.composite",
+ new SCAContribution("test", "./target/classes"));
+
+ node.start();
+ }
+
+ @Test
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldReference helloWorldService = ((SCAClient) node).getService(
+ HelloWorldReference.class, "HelloWorldReferenceComponent");
+
+ assertEquals("Hello Fred Hello Bloggs",
+ helloWorldService.getGreetings("Fred", "Bloggs"));
+
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java
new file mode 100644
index 0000000000..944e8e5905
--- /dev/null
+++ b/branches/sca-java-1.4/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java
@@ -0,0 +1,68 @@
+/*
+ * 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.format;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld.HelloWorldService;
+import org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld.Person;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+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 FormatJMSTextXMLTestCase {
+
+ private static SCANode node;
+
+ @Before
+ public void init() {
+ SCANodeFactory factory = SCANodeFactory.newInstance();
+ node = factory.createSCANode("jmstextxml/helloworld.composite",
+ new SCAContribution("test", "./target/classes"));
+
+ node.start();
+ }
+
+ @Test
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldService helloWorldService = ((SCAClient)node).getService(HelloWorldService.class, "HelloWorldReferenceComponent");
+
+ assertEquals("Hello Fred Bloggs Hello Fred Bloggs Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
+
+ Person person = new Person();
+ person.setFirstName("Fred");
+ person.setLastName("Bloggs");
+ assertEquals("Hello Fred Bloggs Hello Fred Bloggs Hello Fred Bloggs", helloWorldService.getPersonGreetings(person));
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}