diff options
author | wisberg <wisberg> | 2003-05-24 12:25:34 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-05-24 12:25:34 +0000 |
commit | e782ccc04214649b21882474a8c71f6393d377cb (patch) | |
tree | a4fd5901f18156901c5651768e2ce66b07d75ac7 /taskdefs/testsrc | |
parent | 58e2610e99f2986937656480e8343ba4c2698e8e (diff) | |
download | aspectj-e782ccc04214649b21882474a8c71f6393d377cb.tar.gz aspectj-e782ccc04214649b21882474a8c71f6393d377cb.zip |
moved a command-line-driven test of classpath variants here
Diffstat (limited to 'taskdefs/testsrc')
-rw-r--r-- | taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java index 51897d3ca..89acd8d8f 100644 --- a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java +++ b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java @@ -69,7 +69,47 @@ public class AjcTaskTest extends TestCase { } } - private static void deleteTempDir() { + /** + * Check that aspectjtools are found on the classpath, + * reporting any errors to System.err. + * + * Run multiple times with different classpaths. + * This should find variants + * aspectjtools.jar, + * aspectj-tools.jar, + * aspectj-tools-1.1.jar, and + * aspectjtools-1.0.6.jar + * but not + * aspectjrt.jar or + * aspectj/tools.jar. + * XXX use testing aspect to stub out + * <code>System.getProperty("java.class.path")</code> + * @param args a String[], first is expected path, if any + */ + public static void main(String[] args) { + java.io.File toolsjar = AjcTask.findAspectjtoolsJar(); + if ((null == args) || (0 == args.length)) { + if (null != toolsjar) { + System.err.println("FAIL - not expected: " + toolsjar); + } + } else if ("-help".equals(args[0])) { + System.out.println("java " + AjcTaskTest.class.getName() + + " <expectedPathToAspectjtoolsJar>"); + } else if (null == toolsjar) { + System.err.println("FAIL - expected: " + args[0]); + } else { + String path = toolsjar.getAbsolutePath(); + if (!path.equals(args[0])) { + System.err.println("FAIL - expected: " + + args[0] + + " actual: " + + path + ); + } + } + } + + private static void deleteTempDir() { if ((null != tempDir) && tempDir.exists()) { FileUtil.deleteContents(tempDir); tempDir.delete(); |