Browse Source

Andrew Huffs coverage tests for @AJ

AspectJ5_Development
aclement 19 years ago
parent
commit
2391a1ac43
46 changed files with 993 additions and 0 deletions
  1. 23
    0
      tests/java5/ataspectj/coverage/Test001.java
  2. 15
    0
      tests/java5/ataspectj/coverage/Test002.java
  3. 9
    0
      tests/java5/ataspectj/coverage/Test003.java
  4. 11
    0
      tests/java5/ataspectj/coverage/Test004.java
  5. 10
    0
      tests/java5/ataspectj/coverage/Test005.java
  6. 14
    0
      tests/java5/ataspectj/coverage/Test006.java
  7. 11
    0
      tests/java5/ataspectj/coverage/Test007.java
  8. 13
    0
      tests/java5/ataspectj/coverage/Test008.java
  9. 10
    0
      tests/java5/ataspectj/coverage/Test009.java
  10. 7
    0
      tests/java5/ataspectj/coverage/Test010.java
  11. 11
    0
      tests/java5/ataspectj/coverage/Test011.java
  12. 9
    0
      tests/java5/ataspectj/coverage/Test012.java
  13. 9
    0
      tests/java5/ataspectj/coverage/Test013.java
  14. 11
    0
      tests/java5/ataspectj/coverage/Test014.java
  15. 11
    0
      tests/java5/ataspectj/coverage/Test015.java
  16. 9
    0
      tests/java5/ataspectj/coverage/Test016.java
  17. 7
    0
      tests/java5/ataspectj/coverage/Test017.java
  18. 10
    0
      tests/java5/ataspectj/coverage/Test018.java
  19. 9
    0
      tests/java5/ataspectj/coverage/Test019.java
  20. 9
    0
      tests/java5/ataspectj/coverage/Test020.java
  21. 10
    0
      tests/java5/ataspectj/coverage/Test021.java
  22. 9
    0
      tests/java5/ataspectj/coverage/Test022.java
  23. 13
    0
      tests/java5/ataspectj/coverage/Test023.java
  24. 15
    0
      tests/java5/ataspectj/coverage/Test024.java
  25. 11
    0
      tests/java5/ataspectj/coverage/Test025.java
  26. 14
    0
      tests/java5/ataspectj/coverage/Test026.java
  27. 15
    0
      tests/java5/ataspectj/coverage/Test027.java
  28. 8
    0
      tests/java5/ataspectj/coverage/Test028.java
  29. 8
    0
      tests/java5/ataspectj/coverage/Test029.java
  30. 8
    0
      tests/java5/ataspectj/coverage/Test030.java
  31. 14
    0
      tests/java5/ataspectj/coverage/Test031.java
  32. 16
    0
      tests/java5/ataspectj/coverage/Test032.java
  33. 8
    0
      tests/java5/ataspectj/coverage/Test033.java
  34. 7
    0
      tests/java5/ataspectj/coverage/Test034.java
  35. 10
    0
      tests/java5/ataspectj/coverage/Test035.java
  36. 10
    0
      tests/java5/ataspectj/coverage/Test036.java
  37. 9
    0
      tests/java5/ataspectj/coverage/Test037.java
  38. 6
    0
      tests/java5/ataspectj/coverage/Test038.java
  39. 14
    0
      tests/java5/ataspectj/coverage/Test039.java
  40. 12
    0
      tests/java5/ataspectj/coverage/Test040.java
  41. 10
    0
      tests/java5/ataspectj/coverage/Test041.java
  42. 11
    0
      tests/java5/ataspectj/coverage/Test042.java
  43. 27
    0
      tests/java5/ataspectj/coverage/Test043.java
  44. 15
    0
      tests/java5/ataspectj/coverage/Test044.java
  45. 184
    0
      tests/src/org/aspectj/systemtest/ajc150/ataspectj/coverage/CoverageTests.java
  46. 311
    0
      tests/src/org/aspectj/systemtest/ajc150/ataspectj/coverage/coverage.xml

+ 23
- 0
tests/java5/ataspectj/coverage/Test001.java View File

@@ -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();
}
}

+ 15
- 0
tests/java5/ataspectj/coverage/Test002.java View File

@@ -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(* *(..)) {
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test003.java View File

@@ -0,0 +1,9 @@
// "Codestyle Aspect with @Pointcut"

import org.aspectj.lang.annotation.*;

aspect A{
@Pointcut("call(* *.*(..))")
void someCall(int aNumber){
}
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test004.java View File

@@ -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(* *(..)) {
}
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test005.java View File

@@ -0,0 +1,10 @@
// "@Aspect class extending @Aspect class"

import org.aspectj.lang.annotation.*;

@Aspect
class A{
}
@Aspect
class B extends A{
}

+ 14
- 0
tests/java5/ataspectj/coverage/Test006.java View File

@@ -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(){
}
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test007.java View File

@@ -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(* *(..)) {
}
}

+ 13
- 0
tests/java5/ataspectj/coverage/Test008.java View File

@@ -0,0 +1,13 @@
// "@Pointcut not returning void"


import org.aspectj.lang.annotation.*;


@Aspect
class A{
@Pointcut("call(* *.*(..))")
int someCall(){
return 42;
}
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test009.java View File

@@ -0,0 +1,10 @@
// "@Pointcut on @Aspect class constructor"

import org.aspectj.lang.annotation.*;

@Aspect
class A{
@Pointcut("call(* *.*(..))")
A(){
}
}

+ 7
- 0
tests/java5/ataspectj/coverage/Test010.java View File

@@ -0,0 +1,7 @@
// "@Aspect on interface"

import org.aspectj.lang.annotation.*;

@Aspect
interface A{
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test011.java View File

@@ -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(){
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test012.java View File

@@ -0,0 +1,9 @@
// "@Before on non-aspect class method"

import org.aspectj.lang.annotation.*;

class A{
@Before("")
public void someCall(){
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test013.java View File

@@ -0,0 +1,9 @@
// "@Pointcut on Interface method"


import org.aspectj.lang.annotation.*;

interface A{
@Pointcut("call(* *.*(..))")
void someCall();
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test014.java View File

@@ -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(){
}
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test015.java View File

@@ -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");
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test016.java View File

@@ -0,0 +1,9 @@
// "@Pointcut with throws clause"

import org.aspectj.lang.annotation.*;

@Aspect
class A{
@Pointcut("call(* *.*(..))")
void someCall() throws Exception {}
}

+ 7
- 0
tests/java5/ataspectj/coverage/Test017.java View File

@@ -0,0 +1,7 @@
// "@Aspect used badly"

import org.aspectj.lang.annotation.*;

@Aspect{
void a(){}
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test018.java View File

@@ -0,0 +1,10 @@
// "@Before declared on @Aspect class constructor"

import org.aspectj.lang.annotation.*;

@Aspect
class A{
@Before("call(* org..*(..))")
A(){
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test019.java View File

@@ -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) {
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test020.java View File

@@ -0,0 +1,9 @@
// "@Before on non-public method"

import org.aspectj.lang.annotation.*;

aspect A{
@Before("call(* org..*(..))")
private void someCall(){
}
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test021.java View File

@@ -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;
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test022.java View File

@@ -0,0 +1,9 @@
// "@Pointcut with wrong number of args"

import org.aspectj.lang.annotation.*;

@Aspect
class A{
@Pointcut("call(* *.*(..))")
void someCall(int x) {}
}

+ 13
- 0
tests/java5/ataspectj/coverage/Test023.java View File

@@ -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{
}
}

+ 15
- 0
tests/java5/ataspectj/coverage/Test024.java View File

@@ -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{
}
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test025.java View File

@@ -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{
}

+ 14
- 0
tests/java5/ataspectj/coverage/Test026.java View File

@@ -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{
}
}

+ 15
- 0
tests/java5/ataspectj/coverage/Test027.java View File

@@ -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{
}
}

+ 8
- 0
tests/java5/ataspectj/coverage/Test028.java View File

@@ -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";
}

+ 8
- 0
tests/java5/ataspectj/coverage/Test029.java View File

@@ -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");
}

+ 8
- 0
tests/java5/ataspectj/coverage/Test030.java View File

@@ -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);
}

+ 14
- 0
tests/java5/ataspectj/coverage/Test031.java View File

@@ -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();
}
}

+ 16
- 0
tests/java5/ataspectj/coverage/Test032.java View File

@@ -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();
}
}

+ 8
- 0
tests/java5/ataspectj/coverage/Test033.java View File

@@ -0,0 +1,8 @@
// "@Before on Interface method"

import org.aspectj.lang.annotation.*;

interface A{
@Before("call(* *.*(..))")
void someCall();
}

+ 7
- 0
tests/java5/ataspectj/coverage/Test034.java View File

@@ -0,0 +1,7 @@
// "@Aspect Aspect double declaration"

import org.aspectj.lang.annotation.*;

@Aspect
aspect A {
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test035.java View File

@@ -0,0 +1,10 @@
// "@Before and @After on one method"

import org.aspectj.lang.annotation.*;

aspect A{
@Before("call(* *.*(..))")
@After("call(* *.*(..))")
public void someCall(){
}
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test036.java View File

@@ -0,0 +1,10 @@
//"@Before twice on one method"

import org.aspectj.lang.annotation.*;

aspect A{
@Before("call(* *.*(..))")
@Before("call(* *.*(..))")
public void someCall(){
}
}

+ 9
- 0
tests/java5/ataspectj/coverage/Test037.java View File

@@ -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(){
}
}

+ 6
- 0
tests/java5/ataspectj/coverage/Test038.java View File

@@ -0,0 +1,6 @@
// "isPrivileged=truu misspelling"

import org.aspectj.lang.annotation.*;

@Aspect(isPrivileged=truu)
class Foo {}

+ 14
- 0
tests/java5/ataspectj/coverage/Test039.java View File

@@ -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() {}
}

+ 12
- 0
tests/java5/ataspectj/coverage/Test040.java View File

@@ -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");
}
}

+ 10
- 0
tests/java5/ataspectj/coverage/Test041.java View File

@@ -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");
}
}

+ 11
- 0
tests/java5/ataspectj/coverage/Test042.java View File

@@ -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");
}
}

+ 27
- 0
tests/java5/ataspectj/coverage/Test043.java View File

@@ -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());
}
}

+ 15
- 0
tests/java5/ataspectj/coverage/Test044.java View File

@@ -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();
}
}

+ 184
- 0
tests/src/org/aspectj/systemtest/ajc150/ataspectj/coverage/CoverageTests.java View File

@@ -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");
}



}

+ 311
- 0
tests/src/org/aspectj/systemtest/ajc150/ataspectj/coverage/coverage.xml View File

@@ -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 &quot;}&quot; 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 &quot;interface JavaIdentifier&quot; 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 &amp;&amp; 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>

Loading…
Cancel
Save