See discussion at https://github.com/junit-team/junit5-samples/issues/4.
TemporaryFolder extension for JUnit Jupiter analogous to the rule support in JUnit 4.~The internal extension can be found at https://github.com/junit-team/junit5/blob/master/platform-tests/src/test/java/org/junit/jupiter/extensions/TempDirectory.java
It would really been nice to have this feature available in the next release as it is still a deal-breaker in the complete migration to junit Jupiter.
This will be done in the half-official extensions project: junit-pioneer/junit-pioneer#39.
Still waiting on the first junit-pioneer release... :(
Only some more minutes...
There it is! Thank you! :pray:
Having TempDirectory be part of JUnit Pioneer has a few downsides:
@Test annotation1 and 2 are only annoying when figuring out what JUnit 5's equivalent of TemporaryFolder might be. 3 is a constant annoyance when writing tests. That annoyance can be mitigated somewhat by everyone configuring their IDEs to avoid suggesting org.junitpioneer.vintage.Test.
Could the decision to move a core, and very useful, piece of JUnit 4 into a half-official extensions project please be reconsidered?
While such features are in experimental mode, having a dedicated dependency which only contains the extension would be helpful. This can then just be included additionally to the official Junit5 dependency.
Could the decision to move a core, and very useful, piece of JUnit 4 into a half-official extensions project please be reconsidered?
Hi @wilkinsona,
I'll bring it up with the team for renewed discussion.
Reopened and tentatively slated for 5.4 M1 for _team discussion_.
I agree with @wilkinsona, particularly regarding point 3. The extra @Test annotation is very confusing, and does not seem to provide any benefit. JUnit Jupiter provides better methods for dealing with expected exceptions and timeout of tests. I don't really see why org.junitpioneer.vintage.Test even exists.
Regarding the @Test in that library, I'd recommend opening a separate issue to https://github.com/junit-pioneer/junit-pioneer/issues.
Team Decision: Add TempDirectory to junit-jupiter-api in package org.junit.jupiter.api.support.io and deprecate it in Pioneer.
That's excellent news. Thank you for reconsidering.
Most helpful comment
Team Decision: Add
TempDirectorytojunit-jupiter-apiin packageorg.junit.jupiter.api.support.ioand deprecate it in Pioneer.