From 7c7403152d1c7098ec225305be8d7efd761ae8d2 Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 30 Nov 2008 14:23:47 +0000 Subject: Remove delimited test as we don't have an example delimited wire format. Add a JMS Object example git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@721821 13f79535-47bb-0310-9956-ffa450edef68 --- .../helloworld/HelloWorldReference.java | 33 ------ .../helloworld/HelloWorldReferenceImpl.java | 42 ------- .../jmsdelimited/helloworld/HelloWorldService.java | 35 ------ .../helloworld/HelloWorldServiceImpl.java | 36 ------ .../jmsobject/helloworld/HelloWorldReference.java | 32 +++++ .../helloworld/HelloWorldReferenceImpl.java | 38 ++++++ .../jmsobject/helloworld/HelloWorldService.java | 32 +++++ .../helloworld/HelloWorldServiceImpl.java | 32 +++++ .../jms/format/jmsobject/helloworld/Person.java | 47 ++++++++ .../jms/format/jmstextxml/helloworld/Person.java | 36 +++--- .../main/resources/jmsbytes/helloworld.composite | 6 +- .../resources/jmsdelimited/helloworld.composite | 44 ------- .../main/resources/jmsdelimited/helloworld.wsdl | 129 --------------------- .../main/resources/jmsobject/helloworld.composite | 45 +++++++ .../src/main/resources/jmsobject/helloworld.wsdl | 129 +++++++++++++++++++++ .../jms/format/FormatJMSDelimitedTestCase.java | 70 ----------- .../jms/format/FormatJMSObjectTestCase.java | 66 +++++++++++ 17 files changed, 441 insertions(+), 411 deletions(-) delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReference.java delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReferenceImpl.java delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldServiceImpl.java create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.composite delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.wsdl create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.composite create mode 100644 branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.wsdl delete mode 100644 branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java create mode 100644 branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java (limited to 'branches/sca-java-1.x/itest') diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReference.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReference.java deleted file mode 100644 index ba563b658f..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReference.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.jmsdelimited.helloworld; - -import org.osoa.sca.annotations.Remotable; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -public interface HelloWorldReference { - - public String getGreetings(String firstName, - String lastName); - -} - diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReferenceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReferenceImpl.java deleted file mode 100644 index e5677169fe..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldReferenceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.jmsdelimited.helloworld; - -import org.osoa.sca.annotations.Reference; - - -public class HelloWorldReferenceImpl implements HelloWorldReference { - - @Reference - protected HelloWorldService helloWorldService1; - - public String getGreetings(String firstName, - String lastName){ - helloWorldService1.setGreetings(firstName, lastName); - - try { - Thread.sleep(2000); - } catch (Exception ex) { - // do nothing - } - - return HelloWorldServiceImpl.getGreetings(); - } -} - diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldService.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldService.java deleted file mode 100644 index 623fd43871..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.jmsdelimited.helloworld; - -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -public interface HelloWorldService { - - @OneWay - public void setGreetings(String firstName, - String lastName); - -} - diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldServiceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldServiceImpl.java deleted file mode 100644 index 72ae0a330e..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdelimited/helloworld/HelloWorldServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.jmsdelimited.helloworld; - - -public class HelloWorldServiceImpl implements HelloWorldService { - - private static String greetings = "not set"; - - public void setGreetings(String firstName, - String lastName){ - - greetings = "Hello " + firstName + " " + lastName; - } - - public static String getGreetings(){ - return greetings; - } -} - diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java new file mode 100644 index 0000000000..89bae83c77 --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java @@ -0,0 +1,32 @@ +/* + * 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.jmsobject.helloworld; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldReference { + + public String getGreetings(String firstName, String lastName); + +} + diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java new file mode 100644 index 0000000000..a2cb1b6763 --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java @@ -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. + */ +package org.apache.tuscany.sca.binding.jms.format.jmsobject.helloworld; + +import org.osoa.sca.annotations.Reference; + + +public class HelloWorldReferenceImpl implements HelloWorldReference { + + @Reference + protected HelloWorldService helloWorldService; + + public String getGreetings(String firstName, String lastName){ + Person person = new Person(); + person.setFirstName(firstName); + person.setLastName(lastName); + Person returnPerson = helloWorldService.getGreetings(person); + + return returnPerson.getFirstName() + " " + returnPerson.getLastName(); + } +} + diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..485e184f6c --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java @@ -0,0 +1,32 @@ +/* + * 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.jmsobject.helloworld; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldService { + + public Person getGreetings(Person person); + +} + diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java new file mode 100644 index 0000000000..4747136509 --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java @@ -0,0 +1,32 @@ +/* + * 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.jmsobject.helloworld; + + +public class HelloWorldServiceImpl implements HelloWorldService { + + public Person getGreetings(Person person){ + + person.setFirstName("Hello " + person.getFirstName()); + person.setLastName("Hello " + person.getLastName()); + + return person; + } +} + diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java new file mode 100644 index 0000000000..35c383ace9 --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java @@ -0,0 +1,47 @@ +/* + * 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.jmsobject.helloworld; + +import java.io.Serializable; + +public class Person implements Serializable { + + private static final long serialVersionUID = -6842761353978551779L; + + String firstName; + String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + +} + diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java index dd15a83453..8f9c3564f8 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java @@ -18,27 +18,25 @@ */ package org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld; -import org.osoa.sca.annotations.Remotable; +public class Person { + String firstName; + String lastName; + public String getFirstName() { + return firstName; + } -public class Person { - String firstName; - String lastName; - - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } } diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsbytes/helloworld.composite b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsbytes/helloworld.composite index ef66c5583c..ea6ed6c464 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsbytes/helloworld.composite +++ b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsbytes/helloworld.composite @@ -19,7 +19,7 @@ --> @@ -28,7 +28,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.composite b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.composite deleted file mode 100644 index f487996324..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.wsdl b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.wsdl deleted file mode 100644 index 092c56b31d..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsdelimited/helloworld.wsdl +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.composite b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.composite new file mode 100644 index 0000000000..1fc5c095f7 --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.composite @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.wsdl b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.wsdl new file mode 100644 index 0000000000..092c56b31d --- /dev/null +++ b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsobject/helloworld.wsdl @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java deleted file mode 100644 index 9f365ba3c1..0000000000 --- a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.jmsdelimited.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 FormatJMSDelimitedTestCase { - - private static SCANode node; - - @Before - public void init() { - SCANodeFactory factory = SCANodeFactory.newInstance(); - node = factory.createSCANode("jmsdelimited/helloworld.composite", - new SCAContribution("test", "./target/classes")); - - node.start(); - } - - /** - * The delimited wrie format is not yet implemented - * - */ - @Test - @Ignore - 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.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java b/branches/sca-java-1.x/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.x/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(); + } + } +} -- cgit v1.2.3