]> source.dussan.org Git - aspectj.git/commitdiff
pr169428: text and fix for checking decp annotation specified on construct inside...
authoraclement <aclement>
Wed, 7 Nov 2007 09:56:34 +0000 (09:56 +0000)
committeraclement <aclement>
Wed, 7 Nov 2007 09:56:34 +0000 (09:56 +0000)
tests/bugs154/pr169428/CorrectError.java [new file with mode: 0644]
tests/bugs154/pr169428/NoError.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
tests/src/org/aspectj/systemtest/ajc154/ajc154.xml

diff --git a/tests/bugs154/pr169428/CorrectError.java b/tests/bugs154/pr169428/CorrectError.java
new file mode 100644 (file)
index 0000000..5677c42
--- /dev/null
@@ -0,0 +1,8 @@
+import org.aspectj.lang.annotation.*;
+
+class ClassMissingAspectAnnotation {
+
+       @Before("execution(* *(..))")
+       public void m() { }
+
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr169428/NoError.java b/tests/bugs154/pr169428/NoError.java
new file mode 100644 (file)
index 0000000..bf57fc9
--- /dev/null
@@ -0,0 +1,8 @@
+import org.aspectj.lang.annotation.*;
+
+class ClassMissingAspectAnnotation {
+       
+    @DeclareParents("*")
+    public java.io.Serializable s;
+
+}
\ No newline at end of file
index 5c87ea69f63937fea45294e18c42790c9288d1d5..0655e37b23752627cf9d64a0439e2a3534a9ab41 100644 (file)
@@ -44,7 +44,9 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //     //parser.registerPointcutDesignatorHandler(beanHandler);
 //             runTest("new pointcut designators in a reference pointcut");
 //     }
-       
+
+       public void testNoErrorForAtDecpInNormalClass_pr169428() { runTest( "no error for atDecp in normal class");}
+
        public void testJarsZipsNonStandardSuffix_pr186673() { runTest("jars and zips with non-standard suffix");}
        //public void testGenericTypeParameterizedWithArrayType_pr167197() { runTest("generic type parameterized with array type");}
        
index 861e68b78575297b07724973175b971f67201c81..364f5bfef0c47386921702e151582c4864cadcae 100644 (file)
@@ -3,6 +3,16 @@
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
 
+
+   <ajc-test dir="bugs154/pr169428" title="no error for atDecp in normal class">
+     <compile options="-1.5" files="CorrectError.java">
+       <message kind="error" text="Advice must be declared inside an aspect type"/>
+     </compile>
+     <compile options="-1.5" files="NoError.java">
+       <message kind="error" text="DeclareParents can only be used inside an aspect type"/>
+     </compile>
+   </ajc-test>
+   
    <ajc-test dir="bugs154/pr176991" title="wrong number of type parameters">
      <compile options="-1.5" files="AspectJBugTestCase.java"/>
    </ajc-test>