diff options
author | acolyer <acolyer> | 2005-03-11 09:38:22 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-03-11 09:38:22 +0000 |
commit | 84083371793771210c662bccede71570ed52cce3 (patch) | |
tree | b2b4838bb5743480aef5d67b7ed921f4423f92c9 | |
parent | 220fa73463523b45f8572f4324ac7808f440a6a7 (diff) | |
download | aspectj-84083371793771210c662bccede71570ed52cce3.tar.gz aspectj-84083371793771210c662bccede71570ed52cce3.zip |
added test for declare @constructor
-rw-r--r-- | tests/java5/annotations/ajdkExamples/DeclareAnnotation.aj | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/tests/java5/annotations/ajdkExamples/DeclareAnnotation.aj b/tests/java5/annotations/ajdkExamples/DeclareAnnotation.aj index 9ad605226..b018604c5 100644 --- a/tests/java5/annotations/ajdkExamples/DeclareAnnotation.aj +++ b/tests/java5/annotations/ajdkExamples/DeclareAnnotation.aj @@ -8,6 +8,8 @@ public aspect DeclareAnnotation { declare @field : * DAO+.* : @Persisted; + declare @constructor : BankAccount+.new(..) : @Secured(role="supervisor"); + declare warning : staticinitialization(@BusinessDomain *) : "@BusinessDomain"; @@ -15,6 +17,8 @@ public aspect DeclareAnnotation { declare warning : set(@Persisted * *) : "@Persisted"; + declare warning : initialization(@Secured *.new(..)) : "@Secured"; + public static void main(String[] args) throws Exception { Class bAcc = BankAccount.class; java.lang.reflect.Method credit = bAcc.getDeclaredMethod("credit"); @@ -44,6 +48,10 @@ class BankAccount { class ExecutiveBankAccount extends BankAccount { + public ExecutiveBankAccount() { + super(); + } + public void interest() {} protected void commission() {} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index fc2e06be8..77db1aeba 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -1192,11 +1192,13 @@ <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec annotation"> <compile files="DeclareAnnotation.aj,org/xyz/model/Model.java" options="-1.5"> <message kind="warning" line="3" text="@BusinessDomain"/> - <message kind="warning" line="39" text="@Secured"/> - <message kind="warning" line="40" text="@Secured"/> - <message kind="warning" line="47" text="@Secured"/> - <message kind="warning" line="54" text="@Persisted"/> - <message kind="warning" line="60" text="@Persisted"/> + <message kind="warning" line="43" text="@Secured"/> + <message kind="warning" line="44" text="@Secured"/> + <message kind="warning" line="55" text="@Secured"/> + <message kind="warning" line="62" text="@Persisted"/> + <message kind="warning" line="68" text="@Persisted"/> + <message kind="warning" line="41" text="@Secured"/> + <message kind="warning" line="51" text="@Secured"/> </compile> <run class="DeclareAnnotation"/> </ajc-test> |