Browse Source

Completed: Improve ajc memory usage

incremental tests need to ensure that AjState runs in incremental mode!
tags/POST_MEMORY_CHANGES
acolyer 18 years ago
parent
commit
94635f33e7

+ 18
- 0
testing-drivers/testsrc/org/aspectj/testing/drivers/AjcHarnessTestsUsingJUnit.java View 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;
}
}

+ 3
- 0
testing-drivers/testsrc/org/aspectj/testing/drivers/AjctestsAdapter.java View 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;
}
}


+ 13
- 0
tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java View 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);

+ 6
- 0
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java View 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;
}

Loading…
Cancel
Save