]> source.dussan.org Git - aspectj.git/commitdiff
148190#32
authoraclement <aclement>
Mon, 15 Jan 2007 08:45:04 +0000 (08:45 +0000)
committeraclement <aclement>
Mon, 15 Jan 2007 08:45:04 +0000 (08:45 +0000)
ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java [deleted file]
ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java

diff --git a/ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java b/ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java
deleted file mode 100644 (file)
index c0e4b6b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* *******************************************************************
- * Copyright (c) 1999-2001 Xerox Corporation, 
- *               2002 Palo Alto Research Center, Incorporated (PARC).
- * All rights reserved. 
- * This program and the accompanying materials are made available 
- * under the terms of the Eclipse Public License v1.0 
- * which accompanies this distribution and is available at 
- * http://www.eclipse.org/legal/epl-v10.html 
- *  
- * Contributors: 
- *     Xerox/PARC     initial implementation 
- * ******************************************************************/
-
-
-package org.aspectj.ajde.ui;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class AjdeUiTests extends TestCase {
-
-    public static Test suite() { 
-        TestSuite suite = new TestSuite(AjdeUiTests.class.getName());
-        //$JUnit-BEGIN$
-        suite.addTestSuite(StructureSearchManagerTest.class); 
-        suite.addTestSuite(StructureViewManagerTest.class); 
-        //$JUnit-END$
-        return suite;
-    }
-
-    public AjdeUiTests(String name) { super(name); }
-
-}  
index 7a815cf3e6995b26b815b75213de61b63a3923f5..f25262424f2b22cb043405d7361c52326d2f351e 100644 (file)
@@ -8,6 +8,7 @@
  *  
  * Contributors: 
  *     Xerox/PARC     initial implementation 
+ *     Helen Hawkins  Converted to new interface (bug 148190)
  * ******************************************************************/
 
 
@@ -26,13 +27,6 @@ import org.aspectj.asm.IProgramElement;
  */
 public class StructureSearchManagerTest extends AjdeTestCase {
        
-    // TODO-path
-       private final String CONFIG_FILE_PATH = "../examples/figures-coverage/all.lst";
-
-       public StructureSearchManagerTest(String name) {
-               super(name);
-       }
-
        public static void main(String[] args) {
                junit.swingui.TestRunner.run(StructureSearchManagerTest.class);
        }
@@ -68,8 +62,9 @@ public class StructureSearchManagerTest extends AjdeTestCase {
        }
   
        protected void setUp() throws Exception {
-               super.setUp("StructureSearchManagerTest");
-               doSynchronousBuild(CONFIG_FILE_PATH);           
+               super.setUp();
+               initialiseProject("StructureSearchManagerTest");
+               doBuild("all.lst");             
        }
 
        protected void tearDown() throws Exception {
index 510e47d33d536671456e17b70c73c808d7826e63..d88bbc33241b60ef972edcc435ec5ee5b64032df 100644 (file)
@@ -7,7 +7,8 @@
  * http://www.eclipse.org/legal/epl-v10.html 
  *  
  * Contributors: 
- *     Xerox/PARC     initial implementation 
+ *     Xerox/PARC     initial implementation
+ *     Helen Hawkins  Converted to new interface (bug 148190) 
  * ******************************************************************/
 
 
@@ -20,7 +21,9 @@ import junit.framework.TestSuite;
 
 import org.aspectj.ajde.Ajde;
 import org.aspectj.ajde.AjdeTestCase;
-import org.aspectj.asm.*;
+import org.aspectj.asm.AsmManager;
+import org.aspectj.asm.IHierarchy;
+import org.aspectj.asm.IProgramElement;
 
 /**
  * @author Mik Kersten
@@ -28,17 +31,13 @@ import org.aspectj.asm.*;
 public class StructureViewManagerTest extends AjdeTestCase {
        
     // TODO-path
-       private final String CONFIG_FILE_PATH = "../examples/figures-coverage/all.lst";
-       private final String CONFIG_FILE_PATH_2 = "../examples/inheritance/inheritance.lst";
+       private final String CONFIG_FILE_PATH = "all.lst";
+       private final String CONFIG_FILE_PATH_2 = "inheritance.lst";
        
        private FileStructureView currentView;
        private NullIdeStructureViewRenderer renderer = new NullIdeStructureViewRenderer();
        private File testFile;
        private StructureViewProperties properties;
-       
-       public StructureViewManagerTest(String name) {
-               super(name);
-       }
 
        public static void main(String[] args) {
                junit.swingui.TestRunner.run(StructureViewManagerTest.class);
@@ -51,17 +50,18 @@ public class StructureViewManagerTest extends AjdeTestCase {
        }
 
        public void testModelExists() {
-               assertTrue(Ajde.getDefault().getStructureModelManager().getHierarchy() != null);
+               assertTrue(AsmManager.getDefault().getHierarchy() != null);
        }
 
        public void testNotificationAfterConfigFileChange() {
-               doSynchronousBuild(CONFIG_FILE_PATH_2);
+               initialiseProject("inheritance");
+               doBuild(CONFIG_FILE_PATH_2);
                renderer.setHasBeenNotified(false);
                assertTrue("not yet notified", !renderer.getHasBeenNotified());
-               Ajde.getDefault().getConfigurationManager().setActiveConfigFile(CONFIG_FILE_PATH_2);                    
+               Ajde.getDefault().getBuildConfigManager().setActiveConfigFile(CONFIG_FILE_PATH_2);                      
                assertTrue("notified", renderer.getHasBeenNotified());
                renderer.setHasBeenNotified(false);
-               Ajde.getDefault().getConfigurationManager().setActiveConfigFile("MumbleDoesNotExist.lst");                      
+               Ajde.getDefault().getBuildConfigManager().setActiveConfigFile("MumbleDoesNotExist.lst");                        
                assertTrue("notified", renderer.getHasBeenNotified());          
                
                assertTrue(
@@ -79,12 +79,12 @@ public class StructureViewManagerTest extends AjdeTestCase {
                String modelPath = genStructureModelExternFilePath(CONFIG_FILE_PATH);
                openFile(modelPath).delete();
                
-               Ajde.getDefault().getStructureModelManager().readStructureModel(CONFIG_FILE_PATH);
+               AsmManager.getDefault().readStructureModel(CONFIG_FILE_PATH);
                
                assertTrue("notified", renderer.getHasBeenNotified());  
                // AMC should this be currentView, or should we recreate the root... do the latter      
                //IProgramElement n = currentView.getRootNode().getIProgramElement();
-               IProgramElement n = Ajde.getDefault().getStructureModelManager().getHierarchy().getRoot();
+               IProgramElement n = AsmManager.getDefault().getHierarchy().getRoot();
                assertTrue(
                        "no structure", 
                        //currentView.getRootNode().getIProgramElement().getChildren().get(0) 
@@ -93,8 +93,8 @@ public class StructureViewManagerTest extends AjdeTestCase {
        }
 
        public void testModelIntegrity() {
-               doSynchronousBuild(CONFIG_FILE_PATH);
-               IProgramElement modelRoot = Ajde.getDefault().getStructureModelManager().getHierarchy().getRoot();
+               doBuild(CONFIG_FILE_PATH);
+               IProgramElement modelRoot = AsmManager.getDefault().getHierarchy().getRoot();
                assertTrue("root exists", modelRoot != null);   
                
                try {
@@ -117,7 +117,7 @@ public class StructureViewManagerTest extends AjdeTestCase {
 
        public void testNotificationAfterBuild() {
                renderer.setHasBeenNotified(false);
-               doSynchronousBuild(CONFIG_FILE_PATH);
+               doBuild(CONFIG_FILE_PATH);
                assertTrue("notified", renderer.getHasBeenNotified());
        }
 
@@ -131,8 +131,9 @@ public class StructureViewManagerTest extends AjdeTestCase {
        }
   
        protected void setUp() throws Exception {
-               super.setUp("StructureViewManagerTest");
-               doSynchronousBuild(CONFIG_FILE_PATH);           
+               super.setUp();
+               initialiseProject("figures-coverage");
+               doBuild(CONFIG_FILE_PATH);              
                
                properties = Ajde.getDefault().getStructureViewManager().getDefaultViewProperties();
         // TODO-path
@@ -144,24 +145,5 @@ public class StructureViewManagerTest extends AjdeTestCase {
        protected void tearDown() throws Exception {
                super.tearDown();
        }
-       
-//     public void testViewListenerRegistrations() {
-//             Ajde.getDefault().getBuildManager().build("C:/Dev/aspectj/tests/ajde/examples/coverage-figures/src/AllFiles.lst");
-//             while(!testerBuildListener.getBuildFinished()) {
-//                     try {
-//                             Thread.sleep(300);
-//                     } catch (InterruptedException ie) { } 
-//             }
-//             List renderers = Ajde.getDefault().getStructureViewManager().getDefaultFileStructureView().getRenderers();
-//             
-//             testerBuildListener.reset();
-//             Ajde.getDefault().getBuildManager().build("C:/Dev/aspectj/tests/ajde/examples/coverage-figures/src/AllFiles.lst");
-//             while(!testerBuildListener.getBuildFinished()) {
-//                     try {
-//                             Thread.sleep(300);
-//                     } catch (InterruptedException ie) { } 
-//             }  
-//             assertTrue("checking renderers", true);
-//     } 
 }