diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-06 11:15:45 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-06 11:15:45 +0000 |
commit | 881f8d2bf9283e9087530898d059c8e7c7a7c018 (patch) | |
tree | f811fcf1ab2cefcb549288564f7c77571c3c5119 /branches/sca-java-1.x/itest/jms-format/src | |
parent | b0a546d5031b286358f3971c90abe2de0203eaeb (diff) |
TUSCANY-2799 Fix NPE in JMS Object wire format when a null object is returned. Add a test also.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@741535 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
4 files changed, 14 insertions, 2 deletions
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 index a2cb1b6763..e0611f3ddc 100644 --- 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 @@ -31,8 +31,15 @@ public class HelloWorldReferenceImpl implements HelloWorldReference { person.setFirstName(firstName); person.setLastName(lastName); Person returnPerson = helloWorldService.getGreetings(person); + Person returnNullPerson = helloWorldService.getNullGreetings(person); - return returnPerson.getFirstName() + " " + returnPerson.getLastName(); + String returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName(); + + if (returnNullPerson == null){ + returnString += " null"; + } + + return returnString; } } 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 index 485e184f6c..fdbc894d3c 100644 --- 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 @@ -27,6 +27,7 @@ import org.osoa.sca.annotations.Remotable; public interface HelloWorldService { public Person getGreetings(Person person); + public Person getNullGreetings(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 index 4747136509..73f415cc3f 100644 --- 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 @@ -28,5 +28,9 @@ public class HelloWorldServiceImpl implements HelloWorldService { return person; } + + public Person getNullGreetings(Person person){ + return null; + } } 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 index 5306497a3f..aa34a53d01 100644 --- 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 @@ -52,7 +52,7 @@ public class FormatJMSObjectTestCase { HelloWorldReference helloWorldService = ((SCAClient) node).getService( HelloWorldReference.class, "HelloWorldReferenceComponent"); - assertEquals("Hello Fred Hello Bloggs", + assertEquals("Hello Fred Hello Bloggs null", helloWorldService.getGreetings("Fred", "Bloggs")); } |