]> source.dussan.org Git - aspectj.git/commitdiff
Completed: Improve ajc memory usage
authoracolyer <acolyer>
Fri, 24 Feb 2006 15:01:01 +0000 (15:01 +0000)
committeracolyer <acolyer>
Fri, 24 Feb 2006 15:01:01 +0000 (15:01 +0000)
incremental tests need to ensure that AjState runs in incremental mode!

testing-drivers/testsrc/org/aspectj/testing/drivers/AjcHarnessTestsUsingJUnit.java
testing-drivers/testsrc/org/aspectj/testing/drivers/AjctestsAdapter.java
tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index d91419c158109a5ce8d1f63d496ce1d83fb1db66..17b6eeb218e90d951b29d25701dff5a658b275fc 100644 (file)
@@ -12,6 +12,8 @@
 
 package org.aspectj.testing.drivers;
 
+import org.aspectj.ajdt.internal.core.builder.AjState;
+
 import junit.framework.*;
 
 /*
@@ -42,4 +44,20 @@ public class AjcHarnessTestsUsingJUnit extends TestCase {
        public AjcHarnessTestsUsingJUnit(String name) {
                super(name);
        }
+       
+       /* (non-Javadoc)
+        * @see junit.framework.TestCase#setUp()
+        */
+       protected void setUp() throws Exception {
+               super.setUp();
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = true;
+       }
+       
+       /* (non-Javadoc)
+        * @see junit.framework.TestCase#tearDown()
+        */
+       protected void tearDown() throws Exception {
+               super.tearDown();
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = false;
+       }
 }
index af326dbfa961d1d93be2a202ab67cef17e8c0f9e..b5eb7666c1c1fd6aa5e58cf09fc8977936913f97 100644 (file)
@@ -23,6 +23,7 @@ import junit.framework.TestCase;
 import junit.framework.TestResult;
 import junit.framework.TestSuite;
 
+import org.aspectj.ajdt.internal.core.builder.AjState;
 import org.aspectj.bridge.IMessage;
 import org.aspectj.bridge.IMessageHolder;
 import org.aspectj.bridge.MessageHandler;
@@ -388,11 +389,13 @@ public class AjctestsAdapter extends TestSuite {
                 throw new Error("need to re-init");
             }
             try {
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = true;
                 result.startTest(this);
                 suite.runTest(this, result);
             } finally {
                 result.endTest(this);
                 suite = null;
+                AjState.FORCE_INCREMENTAL_DURING_TESTING = false;
             }
         }
 
index 9be1dbd4c1a4f73b498931e1f28434b97a6a2e45..3b7aefce3bdeceb228b56a63cf08e4dd7acbc446 100644 (file)
@@ -29,6 +29,19 @@ public class IncrementalTests extends org.aspectj.testing.XMLBasedAjcTestCase {
   }
 
 
+    /* (non-Javadoc)
+        * @see org.aspectj.testing.XMLBasedAjcTestCase#setUp()
+        */
+       protected void setUp() throws Exception {
+               super.setUp();
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = true;
+       }
+       
+       protected void tearDown() throws Exception {
+               super.tearDown();
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = false;
+       }
+  
   public void test001() throws Exception {
     runTest("expect class added in initial incremental tests");
     nextIncrement(false);
index 202b8beee767e17809b7fcdc55e34b70f09a0321..af2f9b57b2a375af16035f836903294c1c4d8dc8 100644 (file)
@@ -52,6 +52,12 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
        protected void setUp() throws Exception {
                super.setUp();
                AjdeInteractionTestbed.VERBOSE = VERBOSE;
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = true;
+       }
+       
+       protected void tearDown() throws Exception {
+               super.tearDown();
+               AjState.FORCE_INCREMENTAL_DURING_TESTING = false;
        }