diff options
Diffstat (limited to 'branches')
3 files changed, 11 insertions, 8 deletions
diff --git a/branches/sca-java-1.x/itest/jms-nonscaclient-exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/branches/sca-java-1.x/itest/jms-nonscaclient-exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java index 2ccdbc021b..1dec4a6f92 100644 --- a/branches/sca-java-1.x/itest/jms-nonscaclient-exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java +++ b/branches/sca-java-1.x/itest/jms-nonscaclient-exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java @@ -42,7 +42,6 @@ import org.apache.tuscany.sca.host.embedded.SCADomain; import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.osoa.sca.ServiceRuntimeException;
import org.xml.sax.SAXException;
/**
@@ -103,7 +102,9 @@ public class ExceptionsTestCase { // FIXME: what should the response message be for unchecked exceptions with wireFormat.textXML???
Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof ServiceRuntimeException);
+ assertTrue(o instanceof RuntimeException);
+ assertTrue("java.lang.RuntimeException".equals(o.getClass().getName()));
+ assertEquals("java.lang.RuntimeException: bla", ((RuntimeException)o).getMessage());
}
@Test
@@ -147,9 +148,9 @@ public class ExceptionsTestCase { sendJMSObjectRequest("throwUnChecked");
Message m = receiveJMSResponse();
Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof ServiceRuntimeException);
- assertTrue(((ServiceRuntimeException)o).getCause() instanceof RuntimeException);
- assertEquals("bla", ((ServiceRuntimeException)o).getCause().getMessage());
+ assertTrue(o instanceof RuntimeException);
+ assertTrue("java.lang.RuntimeException".equals(o.getClass().getName()));
+ assertEquals("java.lang.RuntimeException: bla", ((RuntimeException)o).getMessage());
}
@After
diff --git a/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java index 0c56e09d52..bd326b36d2 100644 --- a/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java +++ b/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java @@ -96,7 +96,7 @@ public class ExceptionsTestCase { service.throwUnChecked(); fail(); } catch (Exception e) { - assertEquals("bla", e.getCause().getCause().getMessage()); + assertEquals("java.lang.RuntimeException: bla", e.getCause().getMessage()); } } diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java index c69bac7641..d65522e541 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java @@ -109,9 +109,11 @@ public abstract class AbstractMessageProcessor implements JMSMessageProcessor { try { ObjectMessage message = session.createObjectMessage(); - if (o instanceof ServiceRuntimeException && ((ServiceRuntimeException)o).getCause() instanceof InvocationTargetException) { - message.setObject(o.getCause() ); + String causeMsg; + if (o instanceof RuntimeException) { + message.setObject(new RuntimeException(o.getMessage())); } else { + // for a checked exception return the checked exception message.setObject(o); } message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true); |