Skip to content

Using @TempDir and giving -Djava.io.tmpdir=xxx #2987

Answered by khmarbaise
khmarbaise asked this question in Q&A
Discussion options

You must be logged in to vote

After more checking I found out that via the standalone launcher, there is no problem at all. (no difference between jdk versions).

java -Djava.io.tmpdir=/tmp/custom -jar ~/.m2/repository/org/junit/platform/junit-platform-console-standalone/1.9.0/junit-platform-console-standalone-1.9.0.jar -cp classes:target/test-classes --scan-classpath

The output:

@TempDir : /tmp/custom/junit17756560401872268189
java.io.tmpdir : /tmp/custom

Thanks for using JUnit! Support its development at https://junit.org/sponsoring

╷
├─ JUnit Jupiter ✔
│  └─ TempDirTest ✔
│     └─ testTempDir(Path) ✔
├─ JUnit Vintage ✔
└─ JUnit Platform Suite ✔

Test run finished after 51 ms
[         4 containers found      ]
[ …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by khmarbaise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant