aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-23 08:37:16 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-23 08:37:16 +0700
commita385d8b6613b4dbdce81880a84cd709fb09026d6 (patch)
tree1bf6fa9a7677edef6338b080cf64f7e1cc2c5b0e /org.aspectj.ajdt.core
parent1ff8e0915c4a47e63415069d1cee33e6493a638f (diff)
downloadaspectj-a385d8b6613b4dbdce81880a84cd709fb09026d6.tar.gz
aspectj-a385d8b6613b4dbdce81880a84cd709fb09026d6.zip
Fix broken 'useFullLTW' test mode
It was referring to a no longer existent weaver under aj-build/dist/tools/lib/aspectjweaver.jar, which now has been replaced by the new file lib/aspectj/lib/aspectjweaver.jar. Several tests were broken, not finding the agent. But because those tests make no assertions, nobody ever noticed. Only when I had to change some LTW tests from in-process to full LTW mode (see next commit) due to them now obviously calling some code paths which need '--add-opens', I even noticed the problem. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java
index b6ae38ba1..f0e7673a0 100644
--- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java
+++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java
@@ -29,6 +29,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
+import java.util.stream.Collectors;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.ISourceLocation;
@@ -623,9 +624,12 @@ public abstract class AjcTestCase extends TestCase {
File directory = new File (".");
String absPath = directory.getAbsolutePath();
- String javaagent= absPath+separator+".."+separator+"aj-build"+separator+"dist"+separator+"tools"+separator+"lib"+separator+"aspectjweaver.jar";
+ String javaagent = absPath + separator + ".." + separator + "lib" + separator + "aspectj" + separator + "lib" + separator + "aspectjweaver.jar";
+ String defaultCpAbsolute = Arrays.stream(DEFAULT_CLASSPATH_ENTRIES.split(pathSeparator))
+ .map(path -> new File(path).getAbsolutePath())
+ .collect(Collectors.joining(pathSeparator));
try {
- String command ="java " +vmargs+ " -classpath " + cp +" -javaagent:"+javaagent + " " + className ;
+ String command = "java " + vmargs + " -classpath " + cp + pathSeparator + defaultCpAbsolute + " -javaagent:" + javaagent + " " + className;
// Command is executed using ProcessBuilder to allow setting CWD for ajc sandbox compliance
ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command));