From 2962982a4536e6ae5bec907f72c696137d68c728 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 23 Jan 2009 17:49:30 +0000 Subject: [PATCH] 262154: test and fix --- .../base/src/DeliveryCallbackInterceptor.java | 32 +++++++++++++++++++ .../inc1/src/DeliveryCallbackInterceptor.java | 32 +++++++++++++++++++ .../tools/MultiProjectIncrementalTests.java | 27 ++++++++++------ 3 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 tests/multiIncremental/pr262154/base/src/DeliveryCallbackInterceptor.java create mode 100644 tests/multiIncremental/pr262154/inc1/src/DeliveryCallbackInterceptor.java diff --git a/tests/multiIncremental/pr262154/base/src/DeliveryCallbackInterceptor.java b/tests/multiIncremental/pr262154/base/src/DeliveryCallbackInterceptor.java new file mode 100644 index 000000000..ddc189992 --- /dev/null +++ b/tests/multiIncremental/pr262154/base/src/DeliveryCallbackInterceptor.java @@ -0,0 +1,32 @@ +import java.util.Map; + +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +//@Goo("abc") +@SuppressWarnings("unchecked") +public class DeliveryCallbackInterceptor { + @Pointcut("execution(boolean org.springframework.integration.message.MessageHandler+.handleMessage(Message))&& args(message)") + public void handleMethod(Message message) { + } + + @AfterThrowing(pointcut = "handleMethod(message)", throwing = "e") + public void invokeDeliveryCallback(Message message, Throwable e) { + ((DeliveryFailureCallback) message.getHeaders().get("errorcallback")).onDeliveryFailed(message, e); + } +} + +class DeliveryFailureCallback { + public void onDeliveryFailed(Object o, Object p) { + } +} + +class Message { + public Map getHeaders() { + return null; + } +} + +@interface Goo { String value(); } diff --git a/tests/multiIncremental/pr262154/inc1/src/DeliveryCallbackInterceptor.java b/tests/multiIncremental/pr262154/inc1/src/DeliveryCallbackInterceptor.java new file mode 100644 index 000000000..229dddf72 --- /dev/null +++ b/tests/multiIncremental/pr262154/inc1/src/DeliveryCallbackInterceptor.java @@ -0,0 +1,32 @@ +import java.util.Map; + +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +//@Goo("abc") +@SuppressWarnings("unchecked") +public class DeliveryCallbackInterceptor { + @Pointcut("execution(boolean org.springframework.integration.message.MessageHandler+.handleMessage(Message))&& args(message)") + public void handleMethod(Message message) { + } + + @AfterThrowing(pointcut = "handleMethod(message, e)", throwing = "e") + public void invokeDeliveryCallback(Message message, Throwable e) { + ((DeliveryFailureCallback) message.getHeaders().get("errorcallback")).onDeliveryFailed(message, e); + } +} + +class DeliveryFailureCallback { + public void onDeliveryFailed(Object o, Object p) { + } +} + +class Message { + public Map getHeaders() { + return null; + } +} + +@interface Goo { String value(); } diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 74710c1c5..8e8eb585f 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -244,6 +244,17 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa assertEquals("=BrokenHandles