]> source.dussan.org Git - aspectj.git/commitdiff
102733: broken code support, wooo
authoraclement <aclement>
Fri, 13 Jun 2008 23:22:54 +0000 (23:22 +0000)
committeraclement <aclement>
Fri, 13 Jun 2008 23:22:54 +0000 (23:22 +0000)
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index 2c4acdadcc81d23f85d6322672488945e962883f..bac5760a4f28f01c7b0065dbf167f68a31051250 100644 (file)
@@ -23,6 +23,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.1 
+       public void testRunningBrokenCode_pr102733_2() { runTest("running broken code - 2"); }
+       public void testRunningBrokenCode_pr102733() { runTest("running broken code"); }
        public void testErrorOnNonabstractGenericAtAspectJAspect_pr168982() { runTest("error on non-abstract generic ataspectj aspect");}
        public void testIgnoringTypeLevelSuppression_pr234933() { runTest("ignoring type level suppress");}
        public void testDuplicateMethodSignature_pr223226_2() { runTest("duplicate method signature - 2"); }
index e9f3a52a5e5fc83ccc51ae1e0a9a7b2bc8fba238..f8c178cbc52a0a6cad9f28369843ab86440d88dc 100644 (file)
@@ -3,6 +3,20 @@
 <!-- AspectJ v1.6.1 Tests -->
 <suite>
 
+       <ajc-test dir="bugs161/pr102733" title="running broken code">
+       <compile files="Invoker.java C.java" options="">
+         <message kind="error" line="2" text="Syntax error"/>
+       </compile>
+       <run class="Invoker"/>
+    </ajc-test>
+    
+       <ajc-test dir="bugs161/pr102733" title="running broken code - 2">
+       <compile files="Invoker2.java C2.java" options="">
+         <message kind="error" line="5"/>
+       </compile>
+       <run class="Invoker2"/>
+    </ajc-test>
+    
        <ajc-test dir="bugs161/pr168982" title="error on non-abstract generic ataspectj aspect">
        <compile files="TracingAspect2.java" options="-1.5">
          <message kind="error" line="9"/>
index ea9d7267fd4bed48e2e541cae53cbb52b38fdf38..317dc6c9a919adb7e1107c98d0a84807c39086fd 100644 (file)
@@ -252,6 +252,30 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                checkWasntFullBuild();
        }
        
+       public void testBrokenCodeCompilation() {
+               initialiseProject("pr102733_1");
+               build("pr102733_1");
+               checkWasFullBuild();
+               checkCompileWeaveCount("pr102733_1",1,0);
+               assertTrue("There should be an error:\n"
+                               +getErrorMessages("pr102733_1"),!getErrorMessages("pr102733_1").isEmpty());     
+               build("pr102733_1"); // incremental
+               checkCompileWeaveCount("pr102733_1",0,0);
+               checkWasntFullBuild();          
+               alter("pr102733_1","inc1"); // fix the error
+               build("pr102733_1");
+               checkWasntFullBuild();          
+               checkCompileWeaveCount("pr102733_1",1,1);
+               assertTrue("There should be no errors:\n"
+                               +getErrorMessages("pr102733_1"),getErrorMessages("pr102733_1").isEmpty());      
+               alter("pr102733_1","inc2"); // break it again
+               build("pr102733_1");
+               checkWasntFullBuild();          
+               checkCompileWeaveCount("pr102733_1",1,0);
+               assertTrue("There should be an error:\n"
+                               +getErrorMessages("pr102733_1"),!getErrorMessages("pr102733_1").isEmpty());     
+       }
+       
 //     public void testDeclareAtType_pr149293() {
 //             configureBuildStructureModel(true);
 //             initialiseProject("PR149293_1");