aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-23 08:45:46 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-23 08:45:46 +0700
commit356ab9a26ec3dd307e5beac3988d8bc6a4f00e16 (patch)
treee24efd3d4e05dabe32885ad420badabf1a1607b2 /org.aspectj.ajdt.core
parent5288ef1c1c8be2df85e59740f41622f4cfb9d899 (diff)
downloadaspectj-356ab9a26ec3dd307e5beac3988d8bc6a4f00e16.tar.gz
aspectj-356ab9a26ec3dd307e5beac3988d8bc6a4f00e16.zip
AJDT Core: use JUnit 4 from class path instead of 3.8 from lib/junit
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/Ajc.java3
-rw-r--r--org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java8
2 files changed, 9 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java
index e34ce3a38..a256f6d90 100644
--- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java
+++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java
@@ -38,6 +38,7 @@ import org.aspectj.util.FileUtil;
import static java.io.File.pathSeparator;
import static java.io.File.separator;
+import static org.aspectj.tools.ajc.AjcTestCase.CLASSPATH_JUNIT;
/**
* The Ajc class is intended for use as part of a unit-test suite, it drives the AspectJ compiler and lets you check the compilation
@@ -70,7 +71,7 @@ public class Ajc {
outputFolder("testing-client")
+ outputFolder("runtime")
+ outputFolder("bcel-builder")
- + File.pathSeparator + ".." + separator + "lib" + separator + "junit" + separator + "junit.jar"
+ + pathSeparator + CLASSPATH_JUNIT
+ outputFolder("bridge")
+ outputFolder("loadtime")
+ outputFolder("weaver")
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 f0e7673a0..10b6d09dd 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
@@ -73,11 +73,17 @@ public abstract class AjcTestCase extends TestCase {
.filter(path -> path.replace('\\', '/').contains("org/ow2/asm/"))
.findFirst()
.orElseThrow(() -> new RuntimeException("ASM library not found on classpath"));
+ public static final String CLASSPATH_JUNIT =
+ Arrays.stream(System.getProperty("java.class.path")
+ .split(pathSeparator))
+ .filter(path -> path.replace('\\', '/').contains("/junit/junit/"))
+ .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")
- + pathSeparator + ".." + separator + "lib" + separator + "junit" + separator + "junit.jar"
+ + pathSeparator + CLASSPATH_JUNIT
+ pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar"
+ pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar"
+ pathSeparator + CLASSPATH_ASM