diff options
author | aclement <aclement> | 2009-11-26 23:32:49 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-11-26 23:32:49 +0000 |
commit | c0e4ac70fe7394dd2c99932b0bf2b24210567ba6 (patch) | |
tree | e74d2adc676dce9e3ea0a964cf261afd251827fb /tests | |
parent | ca9c264a8ececec929040a9bf6e4100fccfa791b (diff) | |
download | aspectj-c0e4ac70fe7394dd2c99932b0bf2b24210567ba6.tar.gz aspectj-c0e4ac70fe7394dd2c99932b0bf2b24210567ba6.zip |
296054: testcase: npe on model building for bad code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs167/pr296054/AnnotAspect.aj | 10 | ||||
-rw-r--r-- | tests/bugs167/pr296054/Demo.java | 3 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc167/Ajc167Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc167/ajc167.xml | 8 |
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/bugs167/pr296054/AnnotAspect.aj b/tests/bugs167/pr296054/AnnotAspect.aj new file mode 100644 index 000000000..28541f276 --- /dev/null +++ b/tests/bugs167/pr296054/AnnotAspect.aj @@ -0,0 +1,10 @@ +@SuppressWarnings("nls") +public aspect AnnotAspect { + declare @field : * AnnotDemo.* : @Demo(myValues={"alfa", "beta", "gamma"}); + +} +class AnnotDemo { +// that works fine in the java class +//@Demo(myValues={"alfa", "beta", "gamma"}) +private int annotateMe; +} diff --git a/tests/bugs167/pr296054/Demo.java b/tests/bugs167/pr296054/Demo.java new file mode 100644 index 000000000..014c1220c --- /dev/null +++ b/tests/bugs167/pr296054/Demo.java @@ -0,0 +1,3 @@ +public @interface Demo { + Class[] myValues() default { }; +} diff --git a/tests/src/org/aspectj/systemtest/ajc167/Ajc167Tests.java b/tests/src/org/aspectj/systemtest/ajc167/Ajc167Tests.java index 144362473..98a7a6f5f 100644 --- a/tests/src/org/aspectj/systemtest/ajc167/Ajc167Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc167/Ajc167Tests.java @@ -18,6 +18,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc167Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testNpeOnBrokenCode_296054() { + runTest("npe on broken code"); + } + public void testBrokenGeneratedCode_296040() { runTest("broken generated code"); } diff --git a/tests/src/org/aspectj/systemtest/ajc167/ajc167.xml b/tests/src/org/aspectj/systemtest/ajc167/ajc167.xml index d71b90dc9..1ab32fc08 100644 --- a/tests/src/org/aspectj/systemtest/ajc167/ajc167.xml +++ b/tests/src/org/aspectj/systemtest/ajc167/ajc167.xml @@ -2,6 +2,14 @@ <suite> + + <ajc-test dir="bugs167/pr296054" title="npe on broken code"> + <compile files="Demo.java AnnotAspect.aj" options="-1.5 -emacssym"> + <message kind="error" text="The value for"/> + <message kind="error" text="cannot convert"/> + </compile> + </ajc-test> + <ajc-test dir="bugs167/pr296040" title="broken generated code"> <compile files="ErrorClass.java" options="-1.5" classpath="gc10rc4.jar"/> <run class="ErrorClass"/> |