Releases: tginsberg/junit5-system-exit
Release v2.0.2
Release 2.0.1
This is a bugfix release and is a drop-in replacement for version 2.0.0.
ChangeLog
- Fix #20 - Multiple calls to
System.exit()
do not always register the first exit code as the cause.
Release 2.0.0 - New Java Agent-based Approach
Version 2.0.0 removes the terminally deprecated SecurityManager
approach and now uses a Java Agent to rewrite bytecode as the JVM loads classes. Whenever a call to System.exit()
is detected, the JUnit 5 System Exit Agent replaces that call with a function that records an attempt to exit, preventing the JVM from exiting. As a consequence of rewriting bytecode, this library now has one dependency - ASM.
Please see the Project README for comprehensive install instructions.
ChangeLog
- Remove terminally deprecated
SecurityManager
approach for preventingSystem.exit()
calls - Add Java Agent-based approach. Calls to
System.exit()
are rewritten as classes are loaded - Add AssertJ-style fluid assertions for cases when test authors do not want to use annotations, or want to write assertions after a
System.exit()
is detected - Upgrade Gradle to 8.10
- Upgrade JUnit to 5.11.0
- Switch to Kotlin DSL from Groovy DSL in Gradle build
- Switch to GitHub Actions for build runner
Release 1.1.2
This release fixes a bug (#12) that makes this library work better with JUnit Parameterized Tests. Thanks to @felix-seifert for the report.
Maven:
<dependency>
<groupId>com.ginsberg</groupId>
<artifactId>junit5-system-exit</artifactId>
<version>1.1.2</version>
<scope>test</scope>
</dependency
Gradle:
testImplementation("com.ginsberg:junit5-system-exit:1.1.2")
Release 1.1.1
This is a bugfix release to correct issues around @FailOnSystemExit
.
Thanks to @eric-unc for finding my bugs! 🙏
Maven:
<dependency>
<groupId>com.ginsberg</groupId>
<artifactId>junit5-system-exit</artifactId>
<version>1.1.1</version>
<scope>test</scope>
</dependency
Gradle:
testImplementation("com.ginsberg:junit5-system-exit:1.1.1")
Release 1.1.0
Note: There is a bug in this release, please use version 1.1.1 instead!
Release 1.1.0 of junit5-system-exit
contains two changes to make testing code that may call System.exit()
easier.
🏆 Changes
This release contains the following merged pull requests:
#5 - Make SystemExitPreventedException
public and add a statusCode
getter
This should help with testing CLIs.
#6 - Add new @FailOnSystemExit
annotation
When a test calls System.exit()
the JVM running the test will terminate (in most setups). Annotating a test with @FailOnSystemExit
will catch this condition and fail the test, rather than exiting the JVM the test is executing on.
🙏 Thanks!
Thank you to @alexanderabramov and @eric-unc for the suggestions!