incremental tests need to ensure that AjState runs in incremental mode!tags/POST_MEMORY_CHANGES
@@ -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; | |||
} | |||
} |
@@ -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; | |||
} | |||
} | |||
@@ -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); |
@@ -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; | |||
} | |||