diff options
author | aclement <aclement> | 2008-11-01 17:23:54 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-11-01 17:23:54 +0000 |
commit | 44bef3e41af9839f1be28a80e53b7014c8e76133 (patch) | |
tree | 654aefd596d638e0f16267a8b48fa81cbaf2f26a /tests/bugs163 | |
parent | cf313e4d42dc1fc17dea3c06f6d727681140f2c7 (diff) | |
download | aspectj-44bef3e41af9839f1be28a80e53b7014c8e76133.tar.gz aspectj-44bef3e41af9839f1be28a80e53b7014c8e76133.zip |
194314: lvt tests
Diffstat (limited to 'tests/bugs163')
-rw-r--r-- | tests/bugs163/pr194314/IService.java | 4 | ||||
-rw-r--r-- | tests/bugs163/pr194314/Main.java | 8 | ||||
-rw-r--r-- | tests/bugs163/pr194314/Service.java | 7 | ||||
-rw-r--r-- | tests/bugs163/pr194314/ServiceInterceptor.java | 17 | ||||
-rw-r--r-- | tests/bugs163/pr194314/ServiceInterceptorCodeStyle.java | 15 |
5 files changed, 51 insertions, 0 deletions
diff --git a/tests/bugs163/pr194314/IService.java b/tests/bugs163/pr194314/IService.java new file mode 100644 index 000000000..ed383d0e6 --- /dev/null +++ b/tests/bugs163/pr194314/IService.java @@ -0,0 +1,4 @@ + +public interface IService { + void method(long l) throws Exception; +} diff --git a/tests/bugs163/pr194314/Main.java b/tests/bugs163/pr194314/Main.java new file mode 100644 index 000000000..f90107620 --- /dev/null +++ b/tests/bugs163/pr194314/Main.java @@ -0,0 +1,8 @@ + +public class Main { + + public static void main(String[] args) throws Exception { + IService service = new Service(); + service.method(42L); + } +} diff --git a/tests/bugs163/pr194314/Service.java b/tests/bugs163/pr194314/Service.java new file mode 100644 index 000000000..f3302fa40 --- /dev/null +++ b/tests/bugs163/pr194314/Service.java @@ -0,0 +1,7 @@ + +public class Service implements IService { + + public void method(long l) throws Exception { + System.err.println("Original impl of service method, arg " + l); + } +} diff --git a/tests/bugs163/pr194314/ServiceInterceptor.java b/tests/bugs163/pr194314/ServiceInterceptor.java new file mode 100644 index 000000000..00bb779fd --- /dev/null +++ b/tests/bugs163/pr194314/ServiceInterceptor.java @@ -0,0 +1,17 @@ + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + +@Aspect +public class ServiceInterceptor { + + @Around("execution(void test.Service.method(long))") + public void method(ProceedingJoinPoint pjp) throws Throwable { + Object[] args = pjp.getArgs(); + long id = (Long) args[0]; + System.out.println("in advice, arg = " + id + " (before proceed)"); + pjp.proceed(pjp.getArgs()); + System.out.println("in advice (after proceed)"); + } +} diff --git a/tests/bugs163/pr194314/ServiceInterceptorCodeStyle.java b/tests/bugs163/pr194314/ServiceInterceptorCodeStyle.java new file mode 100644 index 000000000..b08047d6b --- /dev/null +++ b/tests/bugs163/pr194314/ServiceInterceptorCodeStyle.java @@ -0,0 +1,15 @@ + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + +public aspect ServiceInterceptorCodeStyle { + + void around(): execution(void Service.method(long)) { + Object[] args = thisJoinPoint.getArgs(); + long id = (Long) args[0]; + System.out.println("in advice, arg = " + id + " (before proceed)"); + proceed(); + System.out.println("in advice (after proceed)"); + } +} |