]> source.dussan.org Git - aspectj.git/commitdiff
Fix for a test that was relying on previous state lying around on disk from a previou...
authoraclement <aclement>
Wed, 6 Apr 2005 10:21:30 +0000 (10:21 +0000)
committeraclement <aclement>
Wed, 6 Apr 2005 10:21:30 +0000 (10:21 +0000)
ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java

index 68938152318f50618e5940503933013859ef2c5f..6e321c96921294c519ad1c2218dcd70d9c6503f5 100644 (file)
@@ -18,6 +18,7 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.aspectj.asm.AsmManager;
 import org.aspectj.asm.HierarchyWalker;
 import org.aspectj.asm.IHierarchy;
 import org.aspectj.asm.IProgramElement;
@@ -49,12 +50,10 @@ public class SavedModelConsistencyTest extends AjdeTestCase {
                assertTrue(testFile.exists());
                
                IProgramElement nodePreBuild = model.findElementForSourceLine(testFile.getAbsolutePath(), 5);   
-               //System.err.println(nodePreBuild.getKind());
-
+               
                doSynchronousBuild(CONFIG_FILE_PATH);   
-
+               
                IProgramElement nodePostBuild = model.findElementForSourceLine(testFile.getAbsolutePath(), 5);  
-               //System.err.println(nodePostBuild.getKind());
                
                assertTrue("Nodes should be identical: Prebuild kind = "+nodePreBuild.getKind()+
                                   "   Postbuild kind = "+nodePostBuild.getKind(),nodePreBuild.getKind().equals(nodePostBuild.getKind()));
@@ -95,6 +94,14 @@ public class SavedModelConsistencyTest extends AjdeTestCase {
          
        protected void setUp() throws Exception {
                super.setUp("examples");
+               // In order to get a model on the disk to read in, do a build with the right flag set !
+               try {
+                       AsmManager.dumpModelPostBuild=true;
+                       doSynchronousBuild(CONFIG_FILE_PATH);
+               } finally {
+                       AsmManager.dumpModelPostBuild=false;
+               }
+
        }
 
        protected void tearDown() throws Exception {