]> source.dussan.org Git - aspectj.git/commitdiff
added test for declare @constructor
authoracolyer <acolyer>
Fri, 11 Mar 2005 09:38:22 +0000 (09:38 +0000)
committeracolyer <acolyer>
Fri, 11 Mar 2005 09:38:22 +0000 (09:38 +0000)
tests/java5/annotations/ajdkExamples/DeclareAnnotation.aj
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

index 9ad605226b19f2674610d44ec73424a0e5927bff..b018604c57bf923ccbaad0ed8764721d1177a447 100644 (file)
@@ -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() {}
        
index fc2e06be8cb4f705e7f883e7b79e728ba85e0154..77db1aebac0e92cc37e4472be9282b867dbb3532 100644 (file)
    <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>