From 84083371793771210c662bccede71570ed52cce3 Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 11 Mar 2005 09:38:22 +0000 Subject: [PATCH] added test for declare @constructor --- .../annotations/ajdkExamples/DeclareAnnotation.aj | 8 ++++++++ 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 @@ - - - - - + + + + + + + -- 2.39.5