diff options
Diffstat (limited to '')
3 files changed, 23 insertions, 4 deletions
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java index 1032bd0f40..efed4842ea 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java @@ -33,7 +33,10 @@ public class HelloWorldReferenceImpl implements HelloWorldReference { try { helloWorldService1.throwChecked(name.getBytes()); } catch (Exception e) { - stringValue += " " + e.getMessage(); + // Test to see what happens if we talk to a service + // that declares a checked exception through an + // interface that doesn't + stringValue += " " + e.getCause().getMessage(); } try { diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java index e0fb31de78..a0429aa59f 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java +++ b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java @@ -51,11 +51,19 @@ public class FormatJMSBytesTestCase { HelloWorldReference helloWorldService = ((SCAClient)node).getService(HelloWorldReference.class, "HelloWorldReferenceComponent"); System.out.println(helloWorldService.getGreetings("Fred Bloggs")); +/* TUSCANY-2967 - disable this change while we decide what to do and + * return faults as JMSObject messages to be consistent + * again with other wire formats assertEquals("Hello Fred Bloggs " + "org.apache.tuscany.sca.binding.jms.format.jmsbytes.helloworld.CheckedException: foo " + "org.osoa.sca.ServiceRuntimeException: java.lang.RuntimeException: bla", helloWorldService.getGreetings("Fred Bloggs")); - +*/ + assertEquals("Hello Fred Bloggs " + + "foo " + + "remote service exception, see nested exception" , + helloWorldService.getGreetings("Fred Bloggs")); + } @After diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java index 6ffbabd2b0..5d1990eb90 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java @@ -45,13 +45,16 @@ public class BytesMessageProcessor extends AbstractMessageProcessor { super(jmsBinding); } +/* TUSCANY-2967 - disable this change while we decide what to do and + * return faults as JMSObject messages to be consistent + * again with other wire formats @Override public Object extractPayloadFromJMSMessage(Message msg) { byte [] bytes = (byte [])extractPayload(msg); try { if (msg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) { - return new InvocationTargetException(new ServiceRuntimeException(bytes.toString())); + return new InvocationTargetException(new ServiceRuntimeException(new String(bytes))); } else { return bytes; } @@ -59,6 +62,7 @@ public class BytesMessageProcessor extends AbstractMessageProcessor { throw new JMSBindingException(e); } } +*/ @Override protected Object extractPayload(Message msg) { @@ -79,6 +83,9 @@ public class BytesMessageProcessor extends AbstractMessageProcessor { } } +/* TUSCANY-2967 - disable this change while we decide what to do and + * return faults as JMSObject messages to be consistent + * again with other wire formats @Override public Message createFaultMessage(Session session, Throwable o) { try { @@ -88,7 +95,8 @@ public class BytesMessageProcessor extends AbstractMessageProcessor { } catch (JMSException e) { throw new JMSBindingException(e); } - } + } +*/ @Override protected Message createJMSMessage(Session session, Object o) { |