diff options
author | aclement <aclement> | 2006-10-16 13:04:42 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-16 13:04:42 +0000 |
commit | d701aa00e0747e5b14180867bd8f3d5213c90a71 (patch) | |
tree | d6308a138509a634bc37c0b10f36251761c29130 /tests | |
parent | 9030415d5741f7d4ac96cd055e860c7760d93d37 (diff) | |
download | aspectj-d701aa00e0747e5b14180867bd8f3d5213c90a71.tar.gz aspectj-d701aa00e0747e5b14180867bd8f3d5213c90a71.zip |
tests and fixes for 160469: handle problems
Diffstat (limited to 'tests')
-rw-r--r-- | tests/model/expected/pr160469_1.txt | 32 | ||||
-rw-r--r-- | tests/model/expected/pr160469_2.txt | 29 | ||||
-rw-r--r-- | tests/model/pr160469_1/AbstractBeanConfigurerAspect.aj | 14 | ||||
-rw-r--r-- | tests/model/pr160469_1/AnnotationBeanConfigurerAspect.aj | 7 | ||||
-rw-r--r-- | tests/model/pr160469_1/README.txt | 3 | ||||
-rw-r--r-- | tests/model/pr160469_1/Simple.java | 8 | ||||
-rw-r--r-- | tests/model/pr160469_1/aspects.jar | bin | 0 -> 2027 bytes | |||
-rw-r--r-- | tests/model/pr160469_2/AbstractBeanConfigurerAspect.aj | 9 | ||||
-rw-r--r-- | tests/model/pr160469_2/AnnotationBeanConfigurerAspect.aj | 6 | ||||
-rw-r--r-- | tests/model/pr160469_2/README.txt | 3 | ||||
-rw-r--r-- | tests/model/pr160469_2/Simple.java | 8 | ||||
-rw-r--r-- | tests/model/pr160469_2/aspects.jar | bin | 0 -> 1975 bytes | |||
-rw-r--r-- | tests/src/org/aspectj/systemtest/model/ModelTests.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/model/model.xml | 9 |
14 files changed, 130 insertions, 0 deletions
diff --git a/tests/model/expected/pr160469_1.txt b/tests/model/expected/pr160469_1.txt new file mode 100644 index 000000000..7a0d90850 --- /dev/null +++ b/tests/model/expected/pr160469_1.txt @@ -0,0 +1,32 @@ +=== MODEL STATUS REPORT ========= After a batch build +<root> [java source file] + test [package] + Simple.java [java source file] TEST_SANDBOX\Simple.java:1: + import declarations [import reference] + Simple [class] TEST_SANDBOX\Simple.java:3: + Simple() [constructor] TEST_SANDBOX\Simple.java:5: + pkg [package] + AbstractBeanConfigurerAspect.class (binary) [class] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: + import declarations [import reference] + AbstractBeanConfigurerAspect [aspect] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: + beanCreation() [pointcut] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: + afterReturning(): beanCreation.. [advice] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:6: + before(): beanCreation.. [advice] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:11: +=== END OF MODEL REPORT ========= +=== RELATIONSHIPS REPORT ========= After a batch build +(targets=1) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&afterReturning (advises) <test{Simple.java[Simple~Simple +(targets=1) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&before (advises) <test{Simple.java[Simple~Simple +(targets=2) <test{Simple.java[Simple~Simple (advised by) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&afterReturning +(targets=2) <test{Simple.java[Simple~Simple (advised by) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&before +=== END OF RELATIONSHIPS REPORT == +=== Properties of the model and relationships map ===== +import reference=2 +aspect=1 +constructor=1 +class=2 +advice=2 +pointcut=1 +RelationshipMapSize=3 +FileMapSize=1 +package=2 +java source file=2 diff --git a/tests/model/expected/pr160469_2.txt b/tests/model/expected/pr160469_2.txt new file mode 100644 index 000000000..9ea21547e --- /dev/null +++ b/tests/model/expected/pr160469_2.txt @@ -0,0 +1,29 @@ +=== MODEL STATUS REPORT ========= After a batch build +<root> [java source file] + test [package] + Simple.java [java source file] TEST_SANDBOX\Simple.java:1: + import declarations [import reference] + Simple [class] TEST_SANDBOX\Simple.java:3: + Simple() [constructor] TEST_SANDBOX\Simple.java:5: + pkg [package] + AbstractBeanConfigurerAspect.class (binary) [class] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: + import declarations [import reference] + AbstractBeanConfigurerAspect [aspect] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: + beanCreation() [pointcut] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: + declare warning: "warning" [declare warning] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:7: +=== END OF MODEL REPORT ========= +=== RELATIONSHIPS REPORT ========= After a batch build +(targets=1) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect`declare warning (matched by) <test{Simple.java[Simple~Simple +(targets=1) <test{Simple.java[Simple~Simple (matches declare) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect`declare warning +=== END OF RELATIONSHIPS REPORT == +=== Properties of the model and relationships map ===== +import reference=2 +aspect=1 +declare warning=1 +constructor=1 +class=2 +pointcut=1 +RelationshipMapSize=2 +FileMapSize=1 +package=2 +java source file=2 diff --git a/tests/model/pr160469_1/AbstractBeanConfigurerAspect.aj b/tests/model/pr160469_1/AbstractBeanConfigurerAspect.aj new file mode 100644 index 000000000..adaec2476 --- /dev/null +++ b/tests/model/pr160469_1/AbstractBeanConfigurerAspect.aj @@ -0,0 +1,14 @@ +package pkg; + +public abstract aspect AbstractBeanConfigurerAspect { + + // advice starts on line 6 + after() returning : beanCreation() { + } + + protected abstract pointcut beanCreation(); + + before() : beanCreation() { + + } +} diff --git a/tests/model/pr160469_1/AnnotationBeanConfigurerAspect.aj b/tests/model/pr160469_1/AnnotationBeanConfigurerAspect.aj new file mode 100644 index 000000000..832255cb1 --- /dev/null +++ b/tests/model/pr160469_1/AnnotationBeanConfigurerAspect.aj @@ -0,0 +1,7 @@ +package pkg; + +public aspect AnnotationBeanConfigurerAspect extends AbstractBeanConfigurerAspect { + + // pointcut is on line 6 + protected pointcut beanCreation() : initialization(*.new(..)) && !within(pkg.*); +} diff --git a/tests/model/pr160469_1/README.txt b/tests/model/pr160469_1/README.txt new file mode 100644 index 000000000..e1d445a75 --- /dev/null +++ b/tests/model/pr160469_1/README.txt @@ -0,0 +1,3 @@ +to regenerate the jar file in this directory: + +ajc AbstractBeanConfigurerAspect.aj AnnotationBeanConfigurerAspect.aj -outjar aspects.jar diff --git a/tests/model/pr160469_1/Simple.java b/tests/model/pr160469_1/Simple.java new file mode 100644 index 000000000..26b84d77b --- /dev/null +++ b/tests/model/pr160469_1/Simple.java @@ -0,0 +1,8 @@ +package test; + +public class Simple { + + public Simple() { + } + +} diff --git a/tests/model/pr160469_1/aspects.jar b/tests/model/pr160469_1/aspects.jar Binary files differnew file mode 100644 index 000000000..fd109bc77 --- /dev/null +++ b/tests/model/pr160469_1/aspects.jar diff --git a/tests/model/pr160469_2/AbstractBeanConfigurerAspect.aj b/tests/model/pr160469_2/AbstractBeanConfigurerAspect.aj new file mode 100644 index 000000000..fae768752 --- /dev/null +++ b/tests/model/pr160469_2/AbstractBeanConfigurerAspect.aj @@ -0,0 +1,9 @@ +package pkg; + +public abstract aspect AbstractBeanConfigurerAspect { + + protected abstract pointcut beanCreation(); + + declare warning : beanCreation() : "warning"; + +} diff --git a/tests/model/pr160469_2/AnnotationBeanConfigurerAspect.aj b/tests/model/pr160469_2/AnnotationBeanConfigurerAspect.aj new file mode 100644 index 000000000..72877ef06 --- /dev/null +++ b/tests/model/pr160469_2/AnnotationBeanConfigurerAspect.aj @@ -0,0 +1,6 @@ +package pkg; + +public aspect AnnotationBeanConfigurerAspect extends AbstractBeanConfigurerAspect { + + protected pointcut beanCreation() : initialization(*.new(..)) && !within(pkg.*); +} diff --git a/tests/model/pr160469_2/README.txt b/tests/model/pr160469_2/README.txt new file mode 100644 index 000000000..e1d445a75 --- /dev/null +++ b/tests/model/pr160469_2/README.txt @@ -0,0 +1,3 @@ +to regenerate the jar file in this directory: + +ajc AbstractBeanConfigurerAspect.aj AnnotationBeanConfigurerAspect.aj -outjar aspects.jar diff --git a/tests/model/pr160469_2/Simple.java b/tests/model/pr160469_2/Simple.java new file mode 100644 index 000000000..26b84d77b --- /dev/null +++ b/tests/model/pr160469_2/Simple.java @@ -0,0 +1,8 @@ +package test; + +public class Simple { + + public Simple() { + } + +} diff --git a/tests/model/pr160469_2/aspects.jar b/tests/model/pr160469_2/aspects.jar Binary files differnew file mode 100644 index 000000000..ac74b57f2 --- /dev/null +++ b/tests/model/pr160469_2/aspects.jar diff --git a/tests/src/org/aspectj/systemtest/model/ModelTests.java b/tests/src/org/aspectj/systemtest/model/ModelTests.java index 0ffa27a26..51853f332 100644 --- a/tests/src/org/aspectj/systemtest/model/ModelTests.java +++ b/tests/src/org/aspectj/systemtest/model/ModelTests.java @@ -67,6 +67,8 @@ public class ModelTests extends ModelTestCase { public void testAspectInDefaultPackage_pr145963() {runModelTest("aspect in default package", "pr145963_3");} public void testAspectInJavaFile_pr145963() {runModelTest("aspect in java file", "pr145963_4");} + public void testAbstractAspectsAndAdvice_pr160469() {runModelTest("ensure advice from abstract aspects appear correctly in the model","pr160469_1");} + public void testAbstractAspectsAndDeow_pr160469() {runModelTest("ensure deow from abstract aspects appear correctly in the model","pr160469_2");} ///////////////////////////////////////// public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/model/model.xml b/tests/src/org/aspectj/systemtest/model/model.xml index 6cfd4cca9..38bd461b7 100644 --- a/tests/src/org/aspectj/systemtest/model/model.xml +++ b/tests/src/org/aspectj/systemtest/model/model.xml @@ -54,6 +54,15 @@ <compile files="A.aj, C.aj" options="-emacssym"/> </ajc-test> + <ajc-test dir="model/pr160469_1" title="ensure advice from abstract aspects appear correctly in the model"> + <compile files="Simple.java" options="-emacssym" aspectpath="aspects.jar"/> + </ajc-test> + + <ajc-test dir="model/pr160469_2" title="ensure deow from abstract aspects appear correctly in the model"> + <compile files="Simple.java" options="-emacssym" aspectpath="aspects.jar"> + <message kind="warning" line="5" text="warning"/> + </compile> + </ajc-test> <!-- AspectJ 5 specific tests --> |