+++ /dev/null
-/* *******************************************************************
- * 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); }
-
-}
* 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)
* ******************************************************************/
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
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);
}
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(
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)
}
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 {
public void testNotificationAfterBuild() {
renderer.setHasBeenNotified(false);
- doSynchronousBuild(CONFIG_FILE_PATH);
+ doBuild(CONFIG_FILE_PATH);
assertTrue("notified", renderer.getHasBeenNotified());
}
}
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
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);
-// }
}