summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-04-24 11:49:38 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-04-24 11:49:38 +0000
commitfea84bc2dd440ae3c7d36990ad24455166455415 (patch)
treee36db25175db43c8915dfc154771d32e24fbb8b3 /branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding
parent89880933c273c7bdb71d78370054254ea3a8775b (diff)
TUSCANY-2930 main part of separating wireFormat.jmsdefault out from wireFormat.jmsTextXML. I've spotted a few more things that need fixing but this basic functionality passes all of our current JMS tests and now better matched what the specification says about default format.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@768263 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding')
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java
new file mode 100644
index 0000000000..7000ff9212
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.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.jmsdefault.helloworld.HelloWorldService;
+import org.apache.tuscany.sca.binding.jms.format.jmsdefault.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 FormatJMSDefaultTestCase {
+
+ private static SCANode node;
+
+ @Before
+ public void init() {
+ SCANodeFactory factory = SCANodeFactory.newInstance();
+ node = factory.createSCANode("jmsdefault/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();
+ }
+ }
+}