aboutsummaryrefslogtreecommitdiffstats
path: root/ajde
diff options
context:
space:
mode:
authoraclement <aclement>2007-01-15 08:45:04 +0000
committeraclement <aclement>2007-01-15 08:45:04 +0000
commit3dc8161d78fdba4236d7ba90dca7fb3b50285f22 (patch)
tree3a393e94c807fa62abcf730e5e70174cb87f1f64 /ajde
parent7c9d27a39c17e765a4f59fffd52ff568b958d907 (diff)
downloadaspectj-3dc8161d78fdba4236d7ba90dca7fb3b50285f22.tar.gz
aspectj-3dc8161d78fdba4236d7ba90dca7fb3b50285f22.zip
148190#32
Diffstat (limited to 'ajde')
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java34
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java13
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java58
3 files changed, 24 insertions, 81 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java b/ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java
deleted file mode 100644
index c0e4b6b96..000000000
--- a/ajde/testsrc/org/aspectj/ajde/ui/AjdeUiTests.java
+++ /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); }
-
-}
diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
index 7a815cf3e..f25262424 100644
--- a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
@@ -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 {
diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java
index 510e47d33..d88bbc332 100644
--- a/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java
@@ -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);
-// }
}