]> source.dussan.org Git - aspectj.git/commitdiff
Introduce AjcTestCase.DEFAULT_FULL_LTW_CLASSPATH_ENTRIES
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 23 Mar 2022 05:49:24 +0000 (12:49 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 23 Mar 2022 05:49:24 +0000 (12:49 +0700)
In 'useFullLTW' mode, aspectjweaver.jar is a Java agent. Therefore, what
is contained in there does not need to be on the classpath.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java

index 10b6d09ddb96810755e47e0958ba5a15e3438a60..801318a166605558e69d284a2add4a19bddd9411 100644 (file)
@@ -80,14 +80,21 @@ public abstract class AjcTestCase extends TestCase {
                        .findFirst()
                        .orElseThrow(() -> new RuntimeException("JUnit library not found on classpath"));
 
-       // see Ajc and AntSpec
-       public static final String DEFAULT_CLASSPATH_ENTRIES =
-                       Ajc.outputFolders("bridge","util","loadtime","weaver","asm","testing-client","runtime","org.aspectj.matcher")
+       // In 'useFullLTW' mode, aspectjweaver.jar is a Java agent. Therefore, what is contained in there
+       // does not need to be on the classpath.
+       public static final String DEFAULT_FULL_LTW_CLASSPATH_ENTRIES =
+               Ajc.outputFolders("testing-client")
                                + pathSeparator + CLASSPATH_JUNIT
+                       + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "testing-client.jar"
+                       ;
+
+       // See Ajc and AntSpec
+       public static final String DEFAULT_CLASSPATH_ENTRIES =
+               DEFAULT_FULL_LTW_CLASSPATH_ENTRIES +
+               Ajc.outputFolders("bridge", "util", "loadtime", "weaver", "asm", "runtime", "org.aspectj.matcher")
                                + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar"
                                + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar"
                                + pathSeparator + CLASSPATH_ASM
-                               + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "testing-client.jar"
                                // hmmm, this next one should perhaps point to an aj-build jar...
                                + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "aspectjrt.jar"
                        ;
@@ -631,7 +638,7 @@ public abstract class AjcTestCase extends TestCase {
                        File directory = new File (".");
                        String absPath = directory.getAbsolutePath();
                        String javaagent = absPath + separator + ".." + separator + "lib" + separator + "aspectj" + separator + "lib" + separator + "aspectjweaver.jar";
-                       String defaultCpAbsolute = Arrays.stream(DEFAULT_CLASSPATH_ENTRIES.split(pathSeparator))
+                       String defaultCpAbsolute = Arrays.stream(DEFAULT_FULL_LTW_CLASSPATH_ENTRIES.split(pathSeparator))
                                .map(path -> new File(path).getAbsolutePath())
                                .collect(Collectors.joining(pathSeparator));
                        try {