@@ -0,0 +1,31 @@ | |||
// Simple - don't attempt to alter target for proceed, just change the arg | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A1 { | |||
@Around("call(void M.method(String)) && args(p)") | |||
public void a( ProceedingJoinPoint pjp, String p) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed( new Object[] { pjp.getTarget(),"faked" } ); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,38 @@ | |||
// Bind this and target on call and change it with proceed | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A10 { | |||
M newM2 = new M("2"); | |||
M newM3 = new M("3"); | |||
@Around("call(void M.method(String)) && args(p) && this(t) && target(t2)") | |||
public void a( ProceedingJoinPoint pjp, M t,String p, M t2) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{newM2,"faked",newM3}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,37 @@ | |||
// only bind arg subset and change that subset | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A11 { | |||
M newM2 = new M("2"); | |||
M newM3 = new M("3"); | |||
@Around("call(void M.method(..)) && args(*,p,*) && this(t) && target(t2)") | |||
public void a( ProceedingJoinPoint pjp, M t,String p, M t2) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{newM2,"_",newM3}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("x","y","z"); | |||
} | |||
public void methodCaller(String param,String param2,String param3) { | |||
method(param,param2,param3); | |||
} | |||
public void method(String a,String b,String c) { System.err.println(prefix+a+b+c); } | |||
} |
@@ -0,0 +1,31 @@ | |||
// Bind the target but forget to pass it on the proceed call | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A2 { | |||
@Around("call(void M.method(String)) && args(p) && target(t)") | |||
public void a( ProceedingJoinPoint pjp, M t, String p) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed( new Object[] { "faked" } ); // too few arguments to proceed? | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,33 @@ | |||
// Bind the target but pass args in wrong order on proceed | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A3 { | |||
@Around("call(void M.method(String)) && args(p) && target(t)") | |||
public void a( ProceedingJoinPoint pjp, M t, String p) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{"faked",t}); | |||
// Type mismatch: cannot convert from String to M | |||
// Type mismatch: cannot convert from M to String | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,31 @@ | |||
// Bind the target and pass in the right order | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A4 { | |||
@Around("call(void M.method(String)) && args(p) && target(t)") | |||
public void a( ProceedingJoinPoint pjp, M t, String p) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{t,"faked"}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,32 @@ | |||
// Bind the target and pass in the right order - but pass in a different target | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A5 { | |||
M newM = new M("2"); | |||
@Around("call(void M.method(String)) && args(p) && target(t)") | |||
public void a( ProceedingJoinPoint pjp, M t, String p) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{newM,"faked"}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,32 @@ | |||
// Bind the target but make it the third arg rather than the second | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A6 { | |||
M newM = new M("2"); | |||
@Around("call(void M.method(String)) && args(p) && target(t)") | |||
public void a( ProceedingJoinPoint pjp, String p, M t) throws Throwable { | |||
// System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{"faked",newM}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,37 @@ | |||
// Bind the this on a call and change it with proceed... makes no difference | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A7 { | |||
M newM = new M("2"); | |||
@Around("call(void M.method(String)) && args(p) && this(t)") | |||
public void a( ProceedingJoinPoint pjp, M t,String p) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{newM,"faked"}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,37 @@ | |||
// Bind the this on a call and change it with proceed... works | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A8 { | |||
M newM = new M("2"); | |||
@Around("execution(void M.method(String)) && args(p) && this(t)") | |||
public void a( ProceedingJoinPoint pjp, String p, M t) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{newM,"faked"}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,38 @@ | |||
// Bind this and target on execution and change it with proceed | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
public class A9 { | |||
M newM2 = new M("2"); | |||
M newM3 = new M("3"); | |||
@Around("execution(void M.method(String)) && args(p) && this(t) && target(t2)") | |||
public void a( ProceedingJoinPoint pjp, M t,String p, M t2) throws Throwable { | |||
System.err.println("advice from ataj aspect"); | |||
pjp.proceed(new Object[]{newM2,"faked",newM3}); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,29 @@ | |||
// Simple - don't attempt to alter target for proceed, just change the arg | |||
aspect X1 { | |||
void around(String p): call(void M.method(String)) && args(p) { | |||
System.err.println("advice from code aspect"); | |||
proceed( "faked" ); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,35 @@ | |||
// Bind the this and target on call and change it with proceed... | |||
aspect X10 { | |||
M newM2 = new M("2"); | |||
M newM3 = new M("3"); | |||
void around(M t,String p,M t2): call(void M.method(String)) && args(p) && this(t) && target(t2) { | |||
System.err.println("advice from code aspect"); | |||
proceed( newM2,"faked" , newM3); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,35 @@ | |||
// Bind the this and target on call and change it with proceed... but subset arguments in advice | |||
aspect X11 { | |||
M newM2 = new M("2"); | |||
M newM3 = new M("3"); | |||
void around(M t,String p,M t2): call(void M.method(..)) && args(*,p,*) && this(t) && target(t2) { | |||
System.err.println("advice from code aspect"); | |||
proceed( newM2,"_" , newM3); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("x","y","z"); | |||
} | |||
public void methodCaller(String param,String param2,String param3) { | |||
method(param,param2,param3); | |||
} | |||
public void method(String a,String b,String c) { System.err.println(prefix+a+b+c); } | |||
} |
@@ -0,0 +1,29 @@ | |||
// Bind the target but forget to pass it on the proceed call | |||
aspect X2 { | |||
void around(M t,String p): call(void M.method(String)) && args(p) && target(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed( "faked" ); // X2.java:7 [error] too few arguments to proceed, expected 2 | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,31 @@ | |||
// Bind the target but pass args in wrong order on proceed | |||
aspect X3 { | |||
void around(M t,String p): call(void M.method(String)) && args(p) && target(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed( "faked" , t); | |||
// X3.java:7 [error] Type mismatch: cannot convert from String to M | |||
// X3.java:7 [error] Type mismatch: cannot convert from M to String | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M(">"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(s); } | |||
} |
@@ -0,0 +1,30 @@ | |||
// Bind the target and pass in the right order | |||
aspect X4 { | |||
M newM = new M("2"); | |||
void around(M t,String p): call(void M.method(String)) && args(p) && target(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed( t , "faked" ); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,30 @@ | |||
// Bind the target and pass in the right order - but pass in a different target | |||
aspect X5 { | |||
M newM = new M("2"); | |||
void around(M t,String p): call(void M.method(String)) && args(p) && target(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed( newM , "faked" ); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,30 @@ | |||
// Bind the target but make it the second arg rather than the first | |||
aspect X6 { | |||
M newM = new M("2"); | |||
void around(String p,M t): call(void M.method(String)) && args(p) && target(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed( "faked" , newM); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.method("real"); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,34 @@ | |||
// Bind the this on a call and change it with proceed... it is ignored | |||
aspect X7 { | |||
M newM = new M("2"); | |||
void around(M t,String p): call(void M.method(String)) && args(p) && this(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed(newM, "faked"); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,34 @@ | |||
// Bind the this on execution and change it with proceed... works, modifies instance that executes | |||
aspect X8 { | |||
M newM = new M("2"); | |||
void around(M t,String p): execution(void M.method(String)) && args(p) && this(t) { | |||
System.err.println("advice from code aspect"); | |||
proceed( newM,"faked" ); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -0,0 +1,35 @@ | |||
// Bind the this and target on execution and change it with proceed... | |||
aspect X9 { | |||
M newM2 = new M("2"); | |||
M newM3 = new M("3"); | |||
void around(M t,String p,M t2): execution(void M.method(String)) && args(p) && this(t) && target(t2) { | |||
System.err.println("advice from code aspect"); | |||
proceed( newM2,"faked" , newM3); | |||
} | |||
public static void main(String []argv) { | |||
M.main(argv); | |||
} | |||
} | |||
class M { | |||
String prefix; | |||
public M(String prefix) { this.prefix = prefix; } | |||
public static void main( String[] args ) { | |||
M m = new M("1"); | |||
m.methodCaller("real"); | |||
} | |||
public void methodCaller(String param) { | |||
method(param); | |||
} | |||
public void method(String s) { System.err.println(prefix+s); } | |||
} |
@@ -20,6 +20,7 @@ public class AllTestsAspectJ151 { | |||
//$JUnit-BEGIN$ | |||
suite.addTest(Ajc151Tests.suite()); | |||
suite.addTest(NewarrayJoinpointTests.suite()); | |||
suite.addTest(AtAroundTests.suite()); | |||
//$JUnit-END$ | |||
return suite; | |||
} |
@@ -0,0 +1,78 @@ | |||
/******************************************************************************* | |||
* Copyright (c) 2006 IBM Corporation and others. | |||
* All rights reserved. This program and the accompanying materials | |||
* are made available under the terms of the Common Public License v1.0 | |||
* which accompanies this distribution, and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation | |||
*******************************************************************************/ | |||
package org.aspectj.systemtest.ajc151; | |||
import java.io.File; | |||
import junit.framework.Test; | |||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||
/** | |||
* This testcode shows what is possible with code style and the current limitations | |||
* of @AJ style. Each program is written in both styles and those variations | |||
* not currently possible are commented out. | |||
* | |||
* @author AndyClement | |||
* | |||
*/ | |||
public class AtAroundTests extends XMLBasedAjcTestCase { | |||
public void testCodeBasic() { runTest("code style - basic"); } | |||
public void testAtBasic() { runTest("annotation style - basic"); } | |||
public void testCodeErrorCase1() { runTest("code style - forget to pass target");} | |||
// Don't think we can report correct errors for @AJ as the parameters are specified as an object array | |||
// public void testAtErrorCase1() { runTest("annotation style - forget to pass target");} | |||
public void testCodeErrorCase2() { runTest("code style - incorrect arg types");} | |||
// Don't think we can report correct errors for @AJ as the parameters are specified as an object array | |||
// public void testAtErrorCase2() { runTest("annotation style - incorrect arg types");} | |||
public void testCodeBindingTarget() { runTest("code style - correct usage, binding and passing new target for call"); } | |||
public void testAtBindingTarget() { runTest("annotation style - correct usage, binding and passing new target for call"); } | |||
public void testCodeChangingTarget() { runTest("code style - changing target for call"); } | |||
public void testAtChangingTarget() { runTest("annotation style - changing target for call"); } | |||
public void testCodeChangingTargetDifferingOrder() { runTest("code style - changing target for call - reverse order"); } | |||
// @AJ cant cope with the changing of the order of arguments bound and passed through proceed | |||
//public void testAtChangingTargetDifferingOrder() { runTest("annotation style - changing target for call - reverse order"); } | |||
public void testCodeBindThisCallChangeProceed() { runTest("code style - bind this on call - change on proceed - no effect");} | |||
//public void testAtBindThisCallChangeProceed() { runTest("annotation style - bind this on call - change on proceed - no effect");} | |||
public void testCodeBindThisExecutionChangeProceed() { runTest("code style - bind this on execution - change on proceed - works");} | |||
//public void testAtBindThisExecutionChangeProceed() { runTest("annotation style - bind this on execution - change on proceed - works");} | |||
public void testCodeBindBothExecutionChangeProceed() { runTest("code style - bind this and target on execution - change on proceed - works");} | |||
//public void testAtBindBothExecutionChangeProceed() { runTest("annotation style - bind this and target on execution - change on proceed - works");} | |||
public void testCodeBindBothCallChangeProceed() { runTest("code style - bind this and target on call - change on proceed - works");} | |||
//public void testAtBindBothCallChangeProceed() { runTest("annotation style - bind this and target on call - change on proceed - works");} | |||
public void testCodeSubsetArguments() { runTest("code style - works with subset of arguments in advice");} | |||
//public void testAtSubsetArguments() { runTest("annotation style - works with subset of arguments in advice");} | |||
// | |||
public static Test suite() { | |||
return XMLBasedAjcTestCase.loadSuite(AtAroundTests.class); | |||
} | |||
protected File getSpecFile() { | |||
return new File("../tests/src/org/aspectj/systemtest/ajc151/ataround.xml"); | |||
} | |||
} |
@@ -0,0 +1,233 @@ | |||
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> | |||
<!-- AspectJ v1.5.1 Tests --> | |||
<suite> | |||
<ajc-test dir="features151/ataround" title="code style - basic"> | |||
<compile files="X1.java" options="-1.5"/> | |||
<run class="X1"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - basic"> | |||
<compile files="A1.java" options="-1.5"/> | |||
<run class="A1"> | |||
<stderr> | |||
<line text="advice from ataj aspect"/> | |||
<line text="faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - forget to pass target"> | |||
<compile files="X2.java" options="-1.5"> | |||
<message kind="error" line="7" text="too few arguments to proceed, expected 2"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - forget to pass target"> | |||
<compile files="A2.java" options="-1.5"> | |||
<message kind="error" line="7" text="too few arguments to proceed, expected 2"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - incorrect arg types"> | |||
<compile files="X3.java" options="-1.5"> | |||
<message kind="error" line="7" text="Type mismatch: cannot convert from String to M"/> | |||
<message kind="error" line="7" text="Type mismatch: cannot convert from M to String"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - incorrect arg types"> | |||
<compile files="A3.java" options="-1.5"> | |||
<message kind="error" line="7" text="too few arguments to proceed, expected 2"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - correct usage, binding and passing new target for call"> | |||
<compile files="X4.java" options="-1.5"/> | |||
<run class="X4"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="1faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - correct usage, binding and passing new target for call"> | |||
<compile files="A4.java" options="-1.5"/> | |||
<run class="A4"> | |||
<stderr> | |||
<line text="advice from ataj aspect"/> | |||
<line text="1faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - changing target for call"> | |||
<compile files="X5.java" options="-1.5"/> | |||
<run class="X5"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="2faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - changing target for call"> | |||
<compile files="A5.java" options="-1.5"/> | |||
<run class="A5"> | |||
<stderr> | |||
<line text="advice from ataj aspect"/> | |||
<line text="2faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - changing target for call - reverse order"> | |||
<compile files="X6.java" options="-1.5"/> | |||
<run class="X6"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="2faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - changing target for call - reverse order"> | |||
<compile files="A6.java" options="-1.5"/> | |||
<run class="A6"> | |||
<stderr> | |||
<line text="advice from ataj aspect"/> | |||
<line text="2faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - bind this on call - change on proceed - no effect"> | |||
<compile files="X7.java" options="-1.5"/> | |||
<run class="X7"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="1faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - bind this on call - change on proceed - no effect"> | |||
<compile files="A7.java" options="-1.5"/> | |||
<run class="A7"> | |||
<stderr> | |||
<line text="advice from ataj aspect"/> | |||
<line text="1faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - bind this on execution - change on proceed - works"> | |||
<compile files="X8.java" options="-1.5"/> | |||
<run class="X8"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="2faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - bind this on execution - change on proceed - works"> | |||
<compile files="A8.java" options="-1.5"/> | |||
<run class="A8"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="2faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - bind this and target on execution - change on proceed - works"> | |||
<compile files="X9.java" options="-1.5"/> | |||
<run class="X9"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="3faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - bind this and target on execution - change on proceed - works"> | |||
<compile files="A9.java" options="-1.5"/> | |||
<run class="A9"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="3faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - bind this and target on call - change on proceed - works"> | |||
<compile files="X10.java" options="-1.5"/> | |||
<run class="X10"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="3faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - bind this and target on call - change on proceed - works"> | |||
<compile files="A10.java" options="-1.5"/> | |||
<run class="A10"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="3faked"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="code style - works with subset of arguments in advice"> | |||
<compile files="X11.java" options="-1.5"/> | |||
<run class="X11"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="3x_z"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="features151/ataround" title="annotation style - works with subset of arguments in advice"> | |||
<compile files="A11.java" options="-1.5"/> | |||
<run class="A11"> | |||
<stderr> | |||
<line text="advice from code aspect"/> | |||
<line text="3x_z"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
</suite> |