@@ -0,0 +1,23 @@ | |||
//"@Aspect extending Aspect" | |||
// This ought to be possible, need to see where the 'can not extend' message | |||
// is coming from and see if you can check for attributes at that point. | |||
// not sure what would happen if these pieces were compiled separately - | |||
// suspect it would be OK if javac is used for class C but not if ajc is used. | |||
import org.aspectj.lang.annotation.*; | |||
abstract aspect B{ | |||
abstract void say(); | |||
} | |||
@Aspect | |||
class C extends B{ | |||
void say(){ } | |||
public static void Main(String[] args){ | |||
C thing = new C(); | |||
thing.say(); | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
//"@Aspect with codestyle pointcut" | |||
// 1. test name needs changing to @Aspect with codestyle advice declaration | |||
// Probably nothing can be done here because it is at parse time that we | |||
// decide this is a class so can't contain advice - at parse time we probably | |||
// can't go digging round for annotations on the type decl. | |||
// Documented limitation? | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
before(): call(* *(..)) { | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "Codestyle Aspect with @Pointcut" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Pointcut("call(* *.*(..))") | |||
void someCall(int aNumber){ | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
// "@Pointcut declared on codestyle advice" | |||
// Should have got a message about not allowing @Pointcut on advice | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Pointcut("call(* *.*(..))") | |||
before(): call(* *(..)) { | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
// "@Aspect class extending @Aspect class" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
} | |||
@Aspect | |||
class B extends A{ | |||
} |
@@ -0,0 +1,14 @@ | |||
// "class with @Before extending @Aspect class" | |||
// shouldn't allow advice in a non-aspect type | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
} | |||
class B extends A{ | |||
@Before("call(* org..*(..))") | |||
public void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
// "@Before declared on advice" | |||
// should be an error, check attr is on an ajc$ method and barf | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Before("call(* org..*(..))") | |||
before(): call(* *(..)) { | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
// "@Pointcut not returning void" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Pointcut("call(* *.*(..))") | |||
int someCall(){ | |||
return 42; | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
// "@Pointcut on @Aspect class constructor" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Pointcut("call(* *.*(..))") | |||
A(){ | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
// "@Aspect on interface" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
interface A{ | |||
} |
@@ -0,0 +1,11 @@ | |||
// "@Pointcut on non-aspect class method" | |||
// I dont think this test is valid, you can have pointcuts in classes | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
@Pointcut("call(* *.*(..))") | |||
void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "@Before on non-aspect class method" | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
@Before("") | |||
public void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "@Pointcut on Interface method" | |||
import org.aspectj.lang.annotation.*; | |||
interface A{ | |||
@Pointcut("call(* *.*(..))") | |||
void someCall(); | |||
} |
@@ -0,0 +1,11 @@ | |||
// "@Pointcut with garbage string" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Pointcut("call\n\n\n\n\n\n\n\n\n\n\n%dwdwudwdwbuill817pe;][{ | |||
grgrgnjk78877&&<:{{{+=``\") | |||
void somecall(){ | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
// "@Pointcut with non-empty method body" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Pointcut("call(* *.*(..))") | |||
void someCall(){ | |||
System.out.println("whoops"); | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "@Pointcut with throws clause" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Pointcut("call(* *.*(..))") | |||
void someCall() throws Exception {} | |||
} |
@@ -0,0 +1,7 @@ | |||
// "@Aspect used badly" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect{ | |||
void a(){} | |||
} |
@@ -0,0 +1,10 @@ | |||
// "@Before declared on @Aspect class constructor" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Before("call(* org..*(..))") | |||
A(){ | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "@AfterReturning with wrong number of args" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@AfterReturning(value="call(* *..*(..))",returning="f") | |||
public void itsAFoo(Object f, int x) { | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "@Before on non-public method" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Before("call(* org..*(..))") | |||
private void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
// "@Before on method not returning void" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Before("call(* org..*(..))") | |||
public int someCall(){ | |||
return 42; | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
// "@Pointcut with wrong number of args" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Pointcut("call(* *.*(..))") | |||
void someCall(int x) {} | |||
} |
@@ -0,0 +1,13 @@ | |||
// "@DeclareParents with interface extending interface" | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
} | |||
interface D{ | |||
} | |||
aspect B{ | |||
@DeclareParents("A") | |||
interface C extends D{ | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
// "@DeclareParents implementing more than one interface" | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
} | |||
interface D{ | |||
} | |||
interface E{ | |||
} | |||
Aspect B{ | |||
@DeclareParents("A") | |||
class C implements D, E{ | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
// "@DeclareParents used outside of an Aspect" | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
} | |||
interface D{ | |||
} | |||
@DeclareParents("A") | |||
class C implements D{ | |||
} |
@@ -0,0 +1,14 @@ | |||
// "@DeclareParents on an @Aspect" | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
} | |||
interface D{ | |||
} | |||
aspect B{ | |||
@Aspect | |||
@DeclareParents("A") | |||
class C implements D{ | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
// "@DeclareParents on an @Aspect with @DeclarePrecidence" | |||
import org.aspectj.lang.annotation.*; | |||
class A{ | |||
} | |||
interface D{ | |||
} | |||
aspect B{ | |||
@DeclareParents("A") | |||
@Aspect | |||
@DeclarePrecidence("") | |||
class C implements D{ | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
// "@DeclareWarning with a non-final String" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@DeclareWarning("within(org..*)") | |||
static String msg = "Let this be a warning to you"; | |||
} |
@@ -0,0 +1,8 @@ | |||
// "@DeclareWarning with a static final Object (that is a String)" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@DeclareWarning("within(org..*)") | |||
static final Object msg = new String("woo"); | |||
} |
@@ -0,0 +1,8 @@ | |||
// "@DeclareWarning with a static final Integer" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@DeclareWarning("within(org..*)") | |||
static final Integer msg = new Integer(22378008); | |||
} |
@@ -0,0 +1,14 @@ | |||
// "@Around given an extension of ProceedingJoinPoint" | |||
import org.aspectj.lang.annotation.*; | |||
import org.aspectj.lang.ProceedingJoinPoint; | |||
interface B extends ProceedingJoinPoint{ | |||
} | |||
aspect A{ | |||
@Around("call(* *.*(..))") | |||
public Object doNothing(B thisJoinPoint) { | |||
return thisJoinPoint.proceed(); | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
// "calling @Before advice explicitly as a method" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class A{ | |||
@Before("call(* *.*(..))") | |||
public void someCall(){ | |||
} | |||
} | |||
class B{ | |||
public static void main(String[] args){ | |||
A a = new A(); | |||
a.someCall(); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
// "@Before on Interface method" | |||
import org.aspectj.lang.annotation.*; | |||
interface A{ | |||
@Before("call(* *.*(..))") | |||
void someCall(); | |||
} |
@@ -0,0 +1,7 @@ | |||
// "@Aspect Aspect double declaration" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
aspect A { | |||
} |
@@ -0,0 +1,10 @@ | |||
// "@Before and @After on one method" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Before("call(* *.*(..))") | |||
@After("call(* *.*(..))") | |||
public void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
//"@Before twice on one method" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Before("call(* *.*(..))") | |||
@Before("call(* *.*(..))") | |||
public void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
//"@Before advice with empty string" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@Before("") // this should compile I think, it's just Before advice for no pointcut | |||
public void someCall(){ | |||
} | |||
} |
@@ -0,0 +1,6 @@ | |||
// "isPrivileged=truu misspelling" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect(isPrivileged=truu) | |||
class Foo {} |
@@ -0,0 +1,14 @@ | |||
// "@Pointcut with an empty string" | |||
import org.aspectj.lang.annotation.*; | |||
@Aspect | |||
class Foo { | |||
@Pointcut("call(* java.util.List.*(..))") // must qualify | |||
void listOperation() {} | |||
@Pointcut("") // should compile, I think - just matches no joinPoints | |||
void anyUtilityCall() {} | |||
} |
@@ -0,0 +1,12 @@ | |||
// "@Before with && in string" | |||
import org.aspectj.lang.annotation.*; | |||
class Foo{ | |||
} | |||
aspect A{ | |||
@Before("call(* org.aspectprogrammer..*(..)) && this(Foo)") | |||
public void callFromFoo() { | |||
System.out.println("Call from Foo"); | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
// "@AdviceName given an empty string" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@AdviceName("") | |||
before() : call(* org.aspectprogrammer..*(..)) { | |||
System.out.println("Call from Foo"); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
//"@AdviceName used on @Before advice" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@AdviceName("callFromFoo") | |||
@Before("call(* org.aspectprogrammer..*(..))") | |||
public void callFromFoo() { | |||
System.out.println("Call from Foo"); | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
//"The Moody example" | |||
import org.aspectj.lang.annotation.*; | |||
class Mood{ | |||
} | |||
@Aspect | |||
class MoodIndicator { | |||
public interface Moody { | |||
Mood getMood(); | |||
}; | |||
@DeclareParents("org.xzy..*") | |||
class MoodyImpl implements Moody { | |||
private Mood mood = new Mood(); | |||
public Mood getMood() { | |||
return mood; | |||
} | |||
} | |||
@Before("execution(* *.*(..)) && this(m)") | |||
void feelingMoody(Moody m) { | |||
System.out.println("I'm feeling " + m.getMood()); | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
// "@DeclareWarning" | |||
import org.aspectj.lang.annotation.*; | |||
aspect A{ | |||
@DeclareWarning("call(* *..warnedCall())") | |||
static final String aMessage = "This call is warned"; | |||
void warnedCall(){ | |||
} | |||
public static void main(String [] args){ | |||
warnedCall(); | |||
} | |||
} |
@@ -0,0 +1,184 @@ | |||
package org.aspectj.systemtest.ajc150.ataspectj.coverage; | |||
import java.io.File; | |||
import junit.framework.Test; | |||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||
public class CoverageTests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
public static Test suite() { | |||
return XMLBasedAjcTestCase.loadSuite(CoverageTests.class); | |||
} | |||
protected File getSpecFile() { | |||
return new File("../tests/src/org/aspectj/systemtest/ajc150/ataspectj/coverage/coverage.xml"); | |||
} | |||
public void test001(){ | |||
runTest("@Aspect extending Aspect"); | |||
} | |||
public void test002(){ | |||
runTest("@Aspect with codestyle pointcut"); | |||
} | |||
public void test003(){ | |||
runTest("Codestyle Aspect with @Pointcut"); | |||
} | |||
public void test004(){ | |||
runTest("@Pointcut declared on codestyle advice"); | |||
} | |||
public void test005(){ | |||
runTest("@Aspect class extending @Aspect class"); | |||
} | |||
public void test006(){ | |||
runTest("class with @Before extending @Aspect class"); | |||
} | |||
public void test007(){ | |||
runTest("@Before declared on codestyle advice"); | |||
} | |||
public void test008(){ | |||
runTest("@Pointcut not returning void"); | |||
} | |||
public void test009(){ | |||
runTest("@Pointcut on @Aspect class constructor"); | |||
} | |||
public void test010(){ | |||
runTest("@Aspect on interface"); | |||
} | |||
public void test011(){ | |||
runTest("@Pointcut on non-aspect class method"); | |||
} | |||
public void test012(){ | |||
runTest("@Before on non-aspect class method"); | |||
} | |||
public void test013(){ | |||
runTest("@Pointcut on Interface method"); | |||
} | |||
public void test014(){ | |||
runTest("@Pointcut with garbage string"); | |||
} | |||
public void test015(){ | |||
runTest("@Pointcut with non-empty method body"); | |||
} | |||
public void test016(){ | |||
runTest("@Pointcut with throws clause"); | |||
} | |||
public void test017(){ | |||
runTest("@Aspect used badly"); | |||
} | |||
public void test018(){ | |||
runTest("@Before declared on @Aspect class constructor"); | |||
} | |||
public void test019(){ | |||
runTest("@AfterReturning with wrong number of args"); | |||
} | |||
public void test020(){ | |||
runTest("@Before on non-public method"); | |||
} | |||
public void test021(){ | |||
runTest("@Before on method not returning void"); | |||
} | |||
public void test022(){ | |||
runTest("@Pointcut with wrong number of args"); | |||
} | |||
public void test023(){ | |||
runTest("@DeclareParents with interface extending interface"); | |||
} | |||
public void test024(){ | |||
runTest("@DeclareParents implementing more than one interface"); | |||
} | |||
public void test025(){ | |||
runTest("@DeclareParents used outside of an Aspect"); | |||
} | |||
public void test026(){ | |||
runTest("@DeclareParents on an @Aspect"); | |||
} | |||
public void test027(){ | |||
runTest("@DeclareParents on an @Aspect with @DeclarePrecidence"); | |||
} | |||
public void test028(){ | |||
runTest("@DeclareWarning with a non-final String"); | |||
} | |||
public void test029(){ | |||
runTest("@DeclareWarning with a static final Object (that is a String)"); | |||
} | |||
public void test030(){ | |||
runTest("@DeclareWarning with a static final Integer"); | |||
} | |||
public void test031(){ | |||
runTest("@Around given an extension of ProceedingJoinPoint"); | |||
} | |||
public void test032(){ | |||
runTest("calling @Before advice explicitly as a method"); | |||
} | |||
public void test033(){ | |||
runTest("@Before on Interface method"); | |||
} | |||
public void test034(){ | |||
runTest("@Aspect Aspect double declaration"); | |||
} | |||
public void test035(){ | |||
runTest("@Before and @After on one method"); | |||
} | |||
public void test036(){ | |||
runTest("@Before twice on one method"); | |||
} | |||
public void test037(){ | |||
runTest("@Before advice with empty string"); | |||
} | |||
public void test038(){ | |||
runTest("isPrivileged=truu misspelling"); | |||
} | |||
public void test039(){ | |||
runTest("@Pointcut with an empty string"); | |||
} | |||
public void test040(){ | |||
runTest("@Before with && in string"); | |||
} | |||
public void test041(){ | |||
runTest("@AdviceName given an empty string"); | |||
} | |||
public void test042(){ | |||
runTest("@AdviceName used on @Before advice"); | |||
} | |||
public void test043(){ | |||
runTest("The Moody example"); | |||
} | |||
public void test044(){ | |||
runTest("@DeclareWarning"); | |||
} | |||
} |
@@ -0,0 +1,311 @@ | |||
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> | |||
<!-- AspectJ v1.5.0 Tests --> | |||
<suite> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Aspect extending Aspect"> | |||
<compile files="Test001.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Aspect with codestyle pointcut"> | |||
<compile files="Test002.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="Codestyle Aspect with @Pointcut"> | |||
<compile files="Test003.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut declared on codestyle advice"> | |||
<compile files="Test004.java" options="-1.5"> | |||
<message kind="error" line="7" text="Can't declare @Pointcut on advice"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Aspect class extending @Aspect class"> | |||
<compile files="Test005.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="class with @Before extending @Aspect class"> | |||
<compile files="Test006.java" options="-1.5"> | |||
<message kind="error" line="8" text="class 'B' can not extend aspect 'A'"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before declared on codestyle advice"> | |||
<compile files="Test007.java" options="-1.5"> | |||
<message kind="error" line="7" text="@Before declaration should be followed by a method"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut not returning void"> | |||
<compile files="Test008.java" options="-1.5"> | |||
<message kind="error" line="8" text="Method following @Pointcut should have a void return type"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut on @Aspect class constructor"> | |||
<compile files="Test009.java" options="-1.5"> | |||
<message kind="error" line="7" text="The annotation @Pointcut is disallowed for this location"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Aspect on interface"> | |||
<compile files="Test010.java" options="-1.5"> | |||
<message kind="error" line="6" text="The annotation @Aspect must be followed by a class declaration"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut on non-aspect class method"> | |||
<compile files="Test011.java" options="-1.5"> | |||
<message kind="error" line="6" text="The annotation @Pointcut is disallowed for this location"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before on non-aspect class method"> | |||
<compile files="Test012.java" options="-1.5"> | |||
<message kind="error" line="6" text="The annotation @Before is disallowed for this location"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut on Interface method"> | |||
<compile files="Test013.java" options="-1.5"> | |||
<message kind="error" line="6" text="The annotation @Pointcut is disallowed for this location"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut with garbage string"> | |||
<compile files="Test014.java" options="-1.5"> | |||
<message kind="error" line="7" text="String literal is not properly closed by a double-quote"/> | |||
<message kind="error" line="8" text="Syntax error, insert "}" to complete BlockStatements"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut with non-empty method body"> | |||
<compile files="Test015.java" options="-1.5"> | |||
<message kind="error" line="9" text="@Pointcut method body must be empty"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut with throws clause"> | |||
<compile files="Test016.java" options="-1.5"> | |||
<message kind="error" line="8" text="@Pointcut method cannot throw anything"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Aspect used badly"> | |||
<compile files="Test017.java" options="-1.5"> | |||
<message kind="error" line="5" text="Syntax error, insert "interface JavaIdentifier" to complete InterfaceHeader"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before declared on @Aspect class constructor"> | |||
<compile files="Test018.java" options="-1.5"> | |||
<message kind="error" line="7" text="The annotation @Before is disallowed for this location"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@AfterReturning with wrong number of args"> | |||
<compile files="Test019.java" options="-1.5"> | |||
<message kind="error" line="5" text="formal unbound in pointcut"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before on non-public method"> | |||
<compile files="Test020.java" options="-1.5"> | |||
<message kind="error" line="6" text="@Before must be declared on a public method"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before on method not returning void"> | |||
<compile files="Test021.java" options="-1.5"> | |||
<message kind="error" line="6" text="@Before must be declared on a method returning void"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut with wrong number of args"> | |||
<compile files="Test022.java" options="-1.5"> | |||
<message kind="error" line="8" text="int x is not declared in the pointcut parameters"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareParents with interface extending interface"> | |||
<compile files="Test023.java" options="-1.5"> | |||
<message kind="error" line="11" text="@DeclareParents must be called before a class implementing a single interface"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareParents with interface extending interface"> | |||
<compile files="Test024.java" options="-1.5"> | |||
<message kind="error" line="13" text="@DeclareParents must be called before a class implementing a single interface"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareParents used outside of an Aspect"> | |||
<compile files="Test025.java" options="-1.5"> | |||
<message kind="error" line="9" text="@DeclareParents must be called inside an aspect"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareParents on an @Aspect"> | |||
<compile files="Test026.java" options="-1.5"> | |||
<message kind="error" line="11" text="@DeclareParents must be called before a class implementing a single interface"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareParents on an @Aspect with @DeclarePrecidence"> | |||
<compile files="Test027.java" options="-1.5"> | |||
<message kind="error" line="12" text="@DeclareParents must be called before a class implementing a single interface"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareWarning with a non-final String"> | |||
<compile files="Test028.java" options="-1.5"> | |||
<message kind="error" line="6" text="@DeclareWarning must be called before a static final String"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareWarning with a static final Object (that is a String)"> | |||
<compile files="Test029.java" options="-1.5"> | |||
<message kind="error" line="7" text="Is this an error?"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareWarning with a static final Integer"> | |||
<compile files="Test030.java" options="-1.5"> | |||
<message kind="error" line="6" text="@DeclareWarning must be called before a static final String"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Around given an extension of ProceedingJoinPoint"> | |||
<compile files="Test031.java" options="-1.5"> | |||
<message kind="error" line="9" text="Is this an error?"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="calling @Before advice explicitly as a method"> | |||
<compile files="Test032.java" options="-1.5"> | |||
<message kind="error" line="14" text="Advice should never be called explicitly"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before on Interface method"> | |||
<compile files="Test033.java" options="-1.5"> | |||
<message kind="error" line="4" text="The annotation @Before is disallowed for this location"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Aspect Aspect double declaration"> | |||
<compile files="Test034.java" options="-1.5"> | |||
<message kind="error" line="5" text="The annotation @Aspect is only allowed before a class definition"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before and @After on one method"> | |||
<compile files="Test035.java" options="-1.5"> | |||
<message kind="error" line="7" text="A method may only be declared as advice once"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before twice on one method"> | |||
<compile files="Test036.java" options="-1.5"> | |||
<message kind="error" line="7" text="A method may only be declared as advice once"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before advice with empty string"> | |||
<compile files="Test037.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="isPrivileged=truu misspelling"> | |||
<compile files="Test038.java" options="-1.5"> | |||
<message kind="error" line="5" text="truu is undefined"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Pointcut with an empty string"> | |||
<compile files="Test039.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@Before with && in string"> | |||
<compile files="Test040.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@AdviceName given an empty string"> | |||
<compile files="Test041.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@AdviceName used on @Before advice"> | |||
<compile files="Test042.java" options="-1.5"> | |||
<message kind="error" line="6" text="The @AdviceName annotation can only be used before codestyle advice"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="The Moody example"> | |||
<compile files="Test043.java" options="-1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="java5/ataspectj/coverage" | |||
pr="" title="@DeclareWarning"> | |||
<compile files="Test044.java" options="-1.5"> | |||
<message kind="warning" line="13" text="This call is warned"/> | |||
</compile> | |||
</ajc-test> | |||
</suite> |