summaryrefslogtreecommitdiffstats
path: root/ajde
diff options
context:
space:
mode:
authorwisberg <wisberg>2005-06-08 23:38:04 +0000
committerwisberg <wisberg>2005-06-08 23:38:04 +0000
commit07b62e63fa19324107da924c64bcecc2603dd1cf (patch)
tree39681d4dd9bc7f1d59e36310dde6f9936cf50032 /ajde
parent1ddbc85b271627993a4d64e1f777a09f31e31aab (diff)
downloadaspectj-07b62e63fa19324107da924c64bcecc2603dd1cf.tar.gz
aspectj-07b62e63fa19324107da924c64bcecc2603dd1cf.zip
path-handling audit - mainly TODO, but some fixes/finders
Diffstat (limited to 'ajde')
-rw-r--r--ajde/testsrc/org/aspectj/ajde/AjdeTestCase.java5
-rw-r--r--ajde/testsrc/org/aspectj/ajde/AjdeTests.java20
-rw-r--r--ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java6
-rw-r--r--ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ExtensionTests.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/GenericsTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ModelPerformanceTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/NullIdeProperties.java14
-rw-r--r--ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java2
-rw-r--r--ajde/testsrc/org/aspectj/ajde/StructureModelRegressionTest.java2
-rw-r--r--ajde/testsrc/org/aspectj/ajde/StructureModelTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/internal/AspectJBuildManagerTest.java2
-rw-r--r--ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ui/StructureModelUtilTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java1
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java2
18 files changed, 47 insertions, 16 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/AjdeTestCase.java b/ajde/testsrc/org/aspectj/ajde/AjdeTestCase.java
index b3b1a7248..feaac5e72 100644
--- a/ajde/testsrc/org/aspectj/ajde/AjdeTestCase.java
+++ b/ajde/testsrc/org/aspectj/ajde/AjdeTestCase.java
@@ -21,8 +21,7 @@ import junit.framework.TestCase;
public class AjdeTestCase extends TestCase {
- private static final String TEST_DATA_PATH = AjdeTests.TESTDATA_PATH;
- //private static final String TEST_DATA_PATH = "C:/Dev/aspectj/modules/ajde/testdata";
+ private static final String TEST_DATA_PATH = AjdeTests.testDataPath(null);
protected NullIdeManager ideManager = NullIdeManager.getIdeManager();
protected TestBuildListener testerBuildListener = new TestBuildListener();
@@ -57,7 +56,7 @@ public class AjdeTestCase extends TestCase {
}
protected void setUp(String testDataPath) throws Exception {
- currTestDataPath = TEST_DATA_PATH + File.separatorChar + testDataPath;
+ currTestDataPath = AjdeTests.testDataPath(testDataPath);
// AMC - added this next line as a temporary workaround for
// listener leakage in AsmManager induced by the Ajde test suite.
AsmManager.getDefault().removeAllListeners();
diff --git a/ajde/testsrc/org/aspectj/ajde/AjdeTests.java b/ajde/testsrc/org/aspectj/ajde/AjdeTests.java
index d57c179fa..dfe880ddb 100644
--- a/ajde/testsrc/org/aspectj/ajde/AjdeTests.java
+++ b/ajde/testsrc/org/aspectj/ajde/AjdeTests.java
@@ -14,11 +14,29 @@
package org.aspectj.ajde;
+import java.io.File;
+
+import org.aspectj.util.FileUtil;
+
import junit.framework.*;
public class AjdeTests extends TestCase {
- public static String TESTDATA_PATH = "../ajde/testdata";
+ // TODO-path
+ private static final File TESTDATA_PATH;
+ static {
+ String[] paths = { "../ajde/testdata" };
+ TESTDATA_PATH = FileUtil.getBestFile(paths);
+ }
+ public static String testDataPath(String file) {
+ if (null == file) {
+ return TESTDATA_PATH.getPath();
+ }
+ File f = new File(TESTDATA_PATH, file);
+ f = FileUtil.getBestFile(f);
+ return (null == f ? "" : f.getPath());
+ }
+
public static Test suite() {
TestSuite suite = new TestSuite(AjdeTests.class.getName());
//$JUnit-BEGIN$
diff --git a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java
index bcf70db2e..621b0c549 100644
--- a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java
@@ -21,6 +21,7 @@ import org.aspectj.asm.*;
public class AsmDeclarationsTest extends AjdeTestCase {
private IHierarchy model = null;
+ // TODO-path
private static final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst";
// private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH;
diff --git a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
index f693571a5..a5f0d5f60 100644
--- a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
@@ -24,6 +24,7 @@ import org.aspectj.asm.IRelationship;
public class AsmRelationshipsTest extends AjdeTestCase {
private AsmManager manager = null;
+ // TODO-path
private static final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst";
public AsmRelationshipsTest(String name) {
diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
index 17391a628..0b8c176f1 100644
--- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
+++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
@@ -42,7 +42,7 @@ public class BuildConfigurationTests extends AjdeTestCase {
private NullIdeProperties projectProperties = null;
private MessageHandler messageHandler;
private static final String configFile =
- AjdeTests.TESTDATA_PATH + "/examples/figures-coverage/all.lst";
+ AjdeTests.testDataPath("examples/figures-coverage/all.lst");
public BuildConfigurationTests( String name ) {
@@ -407,7 +407,7 @@ public class BuildConfigurationTests extends AjdeTestCase {
List configRoots = buildConfig.getSourceRoots();
assertTrue( "no source dirs", configRoots.isEmpty() );
- File f = new File( AjdeTests.TESTDATA_PATH + "/examples/figures/figures-coverage" );
+ File f = new File( AjdeTests.testDataPath("examples/figures/figures-coverage" ));
roots.add( f );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
@@ -416,7 +416,7 @@ public class BuildConfigurationTests extends AjdeTestCase {
assertTrue( "source dir", configRoots2.contains(f) );
- File f2 = new File( AjdeTests.TESTDATA_PATH + "/examples/figures/figures-demo" );
+ File f2 = new File( AjdeTests.testDataPath("examples/figures/figures-demo"));
roots.add( f2 );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
diff --git a/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java b/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java
index 6181efa18..26cbfec65 100644
--- a/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java
@@ -26,6 +26,7 @@ import org.aspectj.bridge.IMessage;
*/
public class CompilerMessagesTest extends AjdeTestCase {
+ // TODO-path
private final String CONFIG_FILE_PATH = "../examples/declare-warning/all.lst";
public CompilerMessagesTest(String name) {
diff --git a/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java b/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java
index a80f4a95e..be80a5716 100644
--- a/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java
+++ b/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java
@@ -35,6 +35,7 @@ public class ExtensionTests extends AjcTestCase {
protected void setUp() throws Exception {
super.setUp();
+ // TODO-path
baseDir = new File("../ajde/testdata",PROJECT_DIR);
}
diff --git a/ajde/testsrc/org/aspectj/ajde/GenericsTest.java b/ajde/testsrc/org/aspectj/ajde/GenericsTest.java
index a8e12c0e7..8eab9614d 100644
--- a/ajde/testsrc/org/aspectj/ajde/GenericsTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/GenericsTest.java
@@ -18,6 +18,7 @@ import org.aspectj.asm.AsmManager;
public class GenericsTest extends AjdeTestCase {
private AsmManager manager = null;
+ // TODO-path
private static final String CONFIG_FILE_PATH = "../bug-83565/build.lst";
public void testBuild() {
diff --git a/ajde/testsrc/org/aspectj/ajde/ModelPerformanceTest.java b/ajde/testsrc/org/aspectj/ajde/ModelPerformanceTest.java
index 349e6c560..1a8b82d7a 100644
--- a/ajde/testsrc/org/aspectj/ajde/ModelPerformanceTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/ModelPerformanceTest.java
@@ -17,6 +17,7 @@ package org.aspectj.ajde;
*/
public class ModelPerformanceTest extends AjdeTestCase {
+ // TODO-path
private final String CONFIG_FILE_PATH = "../examples/spacewar/spacewar/debug.lst";
public ModelPerformanceTest(String name) {
diff --git a/ajde/testsrc/org/aspectj/ajde/NullIdeProperties.java b/ajde/testsrc/org/aspectj/ajde/NullIdeProperties.java
index 4b609adca..406e7e5bf 100644
--- a/ajde/testsrc/org/aspectj/ajde/NullIdeProperties.java
+++ b/ajde/testsrc/org/aspectj/ajde/NullIdeProperties.java
@@ -17,6 +17,7 @@ package org.aspectj.ajde;
import java.io.*;
import java.util.*;
+import org.aspectj.tools.ajc.AjcTests;
import org.aspectj.util.FileUtil;
/**
@@ -66,14 +67,11 @@ public class NullIdeProperties implements ProjectPropertiesAdapter {
}
public String getClasspath() {
- //XXX
- // AMC - added in path separator since absence was causing
- // build failures with invalid classpath
- // AMC - subsequently added value of "aspectjrt.path property so that
- // when testing with a non-development jar the version tests find the right one.
- return testProjectPath + File.pathSeparator +
- System.getProperty("sun.boot.class.path") + File.pathSeparator + "../runtime/bin" + File.pathSeparator + "../aspectj5rt/bin" +
- File.pathSeparator + System.getProperty("aspectjrt.path");
+ return testProjectPath
+ + File.pathSeparator
+ + System.getProperty("sun.boot.class.path")
+ + File.pathSeparator
+ + AjcTests.aspectjrtClasspath();
}
public String getOutputPath() {
diff --git a/ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java b/ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java
index 6e321c969..f634ec169 100644
--- a/ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java
@@ -28,6 +28,7 @@ import org.aspectj.asm.IProgramElement;
*/
public class SavedModelConsistencyTest extends AjdeTestCase {
+ // TODO-path
private final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst";
public SavedModelConsistencyTest(String name) {
@@ -46,6 +47,7 @@ public class SavedModelConsistencyTest extends AjdeTestCase {
assertTrue("model exists", model != null);
assertTrue("root exists", model.getRoot() != null);
+ // TODO-path
File testFile = openFile("../examples/coverage/ModelCoverage.java");
assertTrue(testFile.exists());
diff --git a/ajde/testsrc/org/aspectj/ajde/StructureModelRegressionTest.java b/ajde/testsrc/org/aspectj/ajde/StructureModelRegressionTest.java
index 377b9ad54..6434655f3 100644
--- a/ajde/testsrc/org/aspectj/ajde/StructureModelRegressionTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/StructureModelRegressionTest.java
@@ -37,7 +37,7 @@ public class StructureModelRegressionTest extends AjdeTestCase {
}
public void test() {
- String testLstFile = AjdeTests.TESTDATA_PATH + "/StructureModelRegressionTest/example.lst";
+ String testLstFile = AjdeTests.testDataPath("StructureModelRegressionTest/example.lst");
File f = new File(testLstFile);
assertTrue(testLstFile, f.canRead());
// TODO: enable when model is verified.
diff --git a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java
index 74ccceefb..15ecc0ac1 100644
--- a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java
@@ -25,6 +25,7 @@ import org.aspectj.asm.*;
*/
public class StructureModelTest extends AjdeTestCase {
+ // TODO-path
private final String CONFIG_FILE_PATH = "../examples/figures-coverage/all.lst";
public StructureModelTest(String name) {
diff --git a/ajde/testsrc/org/aspectj/ajde/internal/AspectJBuildManagerTest.java b/ajde/testsrc/org/aspectj/ajde/internal/AspectJBuildManagerTest.java
index 108c17866..57a6df142 100644
--- a/ajde/testsrc/org/aspectj/ajde/internal/AspectJBuildManagerTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/internal/AspectJBuildManagerTest.java
@@ -42,6 +42,7 @@ public class AspectJBuildManagerTest extends AjdeTestCase {
// XXX should fail? empty configs fail b/c no sources specified
doSynchronousBuild("empty.lst");
assertTrue("compile of empty build config", testerBuildListener.getBuildSucceeded());
+ // TODO-path
doSynchronousBuild("../examples/figures-coverage/all.lst");
assertTrue("compile success", testerBuildListener.getBuildSucceeded());
File file = new File(Ajde.getDefault().getProjectProperties().getOutputPath() + "/figures/Main.class");
@@ -51,6 +52,7 @@ public class AspectJBuildManagerTest extends AjdeTestCase {
assertTrue("expected class " + file, false);
}
+ // TODO-path
file = openFile("../examples/figures-coverage/all.ajsym");
if (file.exists()) {
file.delete();
diff --git a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java
index 8e67517d8..493bc80e6 100644
--- a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java
@@ -135,6 +135,7 @@ public class LstBuildConfigManagerTest extends AjdeTestCase {
BAD_PATHS_FILE_CONTENTS = WILDCARDS_FILE_CONTENTS;
+ // TODO-path
INCLUDES_FILE_CONTENTS =
"../coordination/Condition.java;" +
"../coordination/CoordinationAction.java;" +
diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureModelUtilTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureModelUtilTest.java
index 9098c7a5f..9ed35801e 100644
--- a/ajde/testsrc/org/aspectj/ajde/ui/StructureModelUtilTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureModelUtilTest.java
@@ -25,6 +25,7 @@ import org.aspectj.asm.IProgramElement;
*/
public class StructureModelUtilTest extends AjdeTestCase {
+ // TODO-path
private final String CONFIG_FILE_PATH = "../examples/figures-coverage/all.lst";
public StructureModelUtilTest(String name) {
diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
index 417a14b7f..2c9676c0b 100644
--- a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java
@@ -26,6 +26,7 @@ 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) {
diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java
index 7977cc663..9f6b7daa5 100644
--- a/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureViewManagerTest.java
@@ -27,6 +27,7 @@ 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";
@@ -134,6 +135,7 @@ public class StructureViewManagerTest extends AjdeTestCase {
doSynchronousBuild(CONFIG_FILE_PATH);
properties = Ajde.getDefault().getStructureViewManager().getDefaultViewProperties();
+ // TODO-path
testFile = openFile("../examples/figures-coverage/figures/Figure.java");
currentView = Ajde.getDefault().getStructureViewManager().createViewForSourceFile(testFile.getAbsolutePath(), properties);
currentView.setRenderer(renderer);