]> source.dussan.org Git - aspectj.git/commitdiff
tests for pr78314 and pr80571
authoracolyer <acolyer>
Sat, 20 Aug 2005 12:11:37 +0000 (12:11 +0000)
committeracolyer <acolyer>
Sat, 20 Aug 2005 12:11:37 +0000 (12:11 +0000)
tests/bugs150/pr80571.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/bugs150/pr80571.aj b/tests/bugs150/pr80571.aj
new file mode 100644 (file)
index 0000000..f7e3bc8
--- /dev/null
@@ -0,0 +1,22 @@
+public class pr80571 {
+       
+       public static void main(String[] args) {
+               new pr80571();
+       }
+       
+}
+
+interface I {
+       public final String NAME = "I";
+       public pr80571 testObj = new pr80571();
+       
+}
+
+aspect A {
+       Object around() : call(*.new(..)) {
+               System.out.println("before");
+               Object ret = proceed();
+               System.out.println("after");
+               return ret;
+       }
+}
\ No newline at end of file
index 5827bc4451016696e8614cf3a734681c3b2784df..e4dcf188d15132cfc7666c5a2ef1bda5a5ec39e4 100644 (file)
@@ -250,6 +250,14 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("declare warning : foo(str) : ...;");
   }
   
+  public void testAroundAdviceAndInterfaceInitializer() {
+         runTest("around advice on interface initializer");
+  }
+  
+  public void testGoodErrorMessageOnUnmatchedMemberSyntax() {
+         runTest("good error message for unmatched member syntax");
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index 9551abe56b3b3fabe815809f21c7faca9902d337..362b41c9ade58d404274be6e42bba56d69979133 100644 (file)
     <ajc-test dir="bugs150" title="(@Foo *)+ type pattern parse error">
         <compile files="AnnotationPlusPatternParseError.aj" options="-1.5"/>
     </ajc-test>
-        
+
+    <ajc-test dir="bugs150" pr="80571" title="around advice on interface initializer">
+        <compile files="pr80571.aj"/>
+        <run class="pr80571">
+            <stdout>
+                <line text="before"/>
+                <line text="after"/>
+            </stdout>
+        </run>
+    </ajc-test>
+     <ajc-test dir="bugs150" pr="78314" title="good error message for unmatched member syntax">
+        <compile files="pr78314.aj" options="-1.5">
+           <message kind="error" line="5" text="Syntax error, insert &quot;body&quot;"/>
+            <message kind="error" line="5" text="Syntax error on tokens, valid member declaration expected instead"/>
+         </compile>
+        <compile files="pr78314.aj">
+            <message kind="error" line="5" text="Syntax error, insert &quot;body&quot;"/>
+            <message kind="error" line="5" text="Syntax error on tokens, valid member declaration expected instead"/>
+        </compile>
+    </ajc-test>
+               
     <ajc-test dir="../docs/dist/doc/examples/introduction" title="introduction sample" vm="1.5">
         <compile files="CloneablePoint.java,ComparablePoint.java,HashablePoint.java,Point.java" options="-1.5"/>
     </ajc-test>