From e782ccc04214649b21882474a8c71f6393d377cb Mon Sep 17 00:00:00 2001 From: wisberg Date: Sat, 24 May 2003 12:25:34 +0000 Subject: moved a command-line-driven test of classpath variants here --- .../aspectj/tools/ant/taskdefs/AjcTaskTest.java | 42 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'taskdefs') 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 + * System.getProperty("java.class.path") + * @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() + + " "); + } 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(); -- cgit v1.2.3