Skip to content

Commit

Permalink
Remove @tempdir extension (#277 / #327)
Browse files Browse the repository at this point in the history
A very similar extension (with the same name) exists in Jupiter. It
doesn't support custom file systems, but other than that is more
feature-rich than this variant. This creates an unpleasant situation
where there are two extensions that solve the same problem with the
same approach, but slightly different feature sets.

After evaluating the situation, we decided to remove our extension
before the 1.0 release with the goal to look for a better solution
to the problem in the future.

Closes: #277
Related: #348
PR: #327
  • Loading branch information
Nicolai Parlog committed Sep 29, 2020
1 parent ce5fc53 commit 5c47d6c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 982 deletions.
2 changes: 1 addition & 1 deletion docs/docs-nav.yml
Expand Up @@ -18,7 +18,7 @@
url: /docs/retrying-test/
- title: "Standard Input and Output"
url: /docs/standard-input-output/
- title: "Temporary Files and Directories"
- title: "Temporary Files and Directories (removed in 1.0)"
url: /docs/temp-directory/
- title: "Vintage @Test"
url: /docs/vintage-test/
Expand Down
6 changes: 4 additions & 2 deletions docs/temp-directory.adoc
@@ -1,7 +1,9 @@
:page-title: Temporary Files and Directories
:page-title: Temporary Files and Directories (removed in 1.0)
:page-description: Extends JUnit Jupiter with `@TempDir`, which create and clean up a temporary directory.

NOTE: Since JUnit Jupiter 5.4, there's a https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-TempDirectory[built-in `@TempDir` extension]. If you don't need support for arbitrary file systems, you should consider using that instead of this extension.
NOTE: Since JUnit Jupiter 5.4, there's a https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-TempDirectory[built-in `@TempDir` extension].
It doesn't support custom file systems, but other than that it's much better than this version, so *we removed the extension in JUnit Pioneer 1.0*.
We plan to tackle this problem again in the future - see https://github.com/junit-pioneer/junit-pioneer/issues/348[issue #348].

The `TempDirectory` extension can be used to create and clean up a temporary directory for an individual test or all tests in a test class.
To use it, simply register the extension and add a parameter of type `java.nio.file.Path` to your test or lifecycle method or constructor.
Expand Down
46 changes: 0 additions & 46 deletions src/main/java/org/junitpioneer/jupiter/TempDir.java

This file was deleted.

0 comments on commit 5c47d6c

Please sign in to comment.