Added TransactionInterceptorTests.

This commit is contained in:
Mark Fisher
2008-07-01 22:04:17 +00:00
parent d0fe157d0a
commit 9dad71117b
6 changed files with 226 additions and 2 deletions

View File

@@ -104,11 +104,11 @@ public abstract class AbstractMessageHandlerAdapter extends AbstractMethodInvoki
}
catch (InvocationTargetException e) {
throw new MessageHandlingException(message, "Handler method '"
+ this.getMethod() + "' threw an Exception.", e.getTargetException());
+ this.getMethodName() + "' threw an Exception.", e.getTargetException());
}
catch (Throwable e) {
throw new MessageHandlingException(message, "Failed to invoke handler method '"
+ this.getMethod() + "' with arguments: " + ObjectUtils.nullSafeToString(args), e);
+ this.getMethodName() + "' with arguments: " + ObjectUtils.nullSafeToString(args), e);
}
}

View File

@@ -74,6 +74,10 @@ public abstract class AbstractMethodInvokingAdapter implements MethodInvoker, In
this.methodName = methodName;
}
protected String getMethodName() {
return this.methodName;
}
public void setOrder(int order) {
this.order = order;
}
@@ -102,6 +106,7 @@ public abstract class AbstractMethodInvokingAdapter implements MethodInvoker, In
throw new ConfigurationException("An ambiguity exists between the 'method' and 'methodName' properties. " +
"Note that only one of them is required, but if both are provided they must match.");
}
this.methodName = this.method.getName();
this.invoker = new DefaultMethodInvoker(this.object, this.method);
}
else {