[jboss-svn-commits] JBL Code SVN: r36451 - in labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta: tests/src/org/jboss/soa/esb/listeners/message and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Dec 17 08:57:27 EST 2010
Author: tfennelly
Date: 2010-12-17 08:57:27 -0500 (Fri, 17 Dec 2010)
New Revision: 36451
Modified:
labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanContainerAction.java
labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/BeanContainerActionUnitTest.java
Log:
https://issues.jboss.org/browse/JBESB-3547
BeanContainerAction not rethrowing RuntimeException
Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanContainerAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanContainerAction.java 2010-12-17 11:45:51 UTC (rev 36450)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanContainerAction.java 2010-12-17 13:57:27 UTC (rev 36451)
@@ -184,6 +184,8 @@
Throwable targetException = e.getTargetException();
if(targetException instanceof ActionProcessingException) {
throw (ActionProcessingException) targetException;
+ } else if (targetException instanceof RuntimeException) {
+ throw (RuntimeException) targetException;
} else {
throw new ActionProcessingException("Bean Action '" + actionName + "' exception.", targetException);
}
Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/BeanContainerActionUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/BeanContainerActionUnitTest.java 2010-12-17 11:45:51 UTC (rev 36450)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/BeanContainerActionUnitTest.java 2010-12-17 13:57:27 UTC (rev 36451)
@@ -238,6 +238,21 @@
assertEquals("BodyString-aPay", message.getBody().get());
}
+ public void test_JBESB_3547() throws ConfigurationException, ActionProcessingException {
+ ConfigTree configTree = new ConfigTree("conf");
+ RuntimeExceptionThrowerAction action = new RuntimeExceptionThrowerAction();
+
+ BeanContainerAction containerAction = new BeanContainerAction(action, configTree);
+ Message message = MessageFactory.getInstance().getMessage();
+
+ message.getBody().add("BodyString");
+ try {
+ containerAction.process(message);
+ } catch(RuntimeException e) {
+ assertEquals(RuntimeExceptionThrowerAction.EXCEPTION_MESSAGE, e.getMessage());
+ }
+ }
+
public class EmptyBean {
}
@@ -360,6 +375,16 @@
}
}
+ public class RuntimeExceptionThrowerAction {
+
+ private static final String EXCEPTION_MESSAGE = "Some runtime error happened....";
+
+ @Process
+ public String process(String bodyString) {
+ throw new RuntimeException(EXCEPTION_MESSAGE);
+ }
+ }
+
public class PayloadObj implements Serializable {
private String name;
More information about the jboss-svn-commits
mailing list