Skip to content

Commit

Permalink
#23: Delegate Security Manager for Exit Guard
Browse files Browse the repository at this point in the history
  • Loading branch information
redcatbear committed Apr 22, 2021
1 parent 0ecfbb6 commit a6f0547
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -46,7 +46,9 @@ class TestSystemExit
}
```

Note that in order to be able to trap system exit, the `ExitGuard` temporarily replaces the existing security manager (if any).
The `ExitGuard` temporarily replaces the existing security manager.

From version 1.2.0 on if a security guard existed before, it serves as a delegate for all security checks with the exception of the `checkExit`.

## Asserting Data Sent to `System.out`

Expand Down Expand Up @@ -91,6 +93,10 @@ Capturing data sent to `System.err` works in the exact same way as in the [`Syst

Please check our [contribution guide](.github/CONTRIBUTING.md) to learn how you can help with the project, report errors or request features.

## Changelog

[Changelog](doc/changes/changelog.mk)

## Development

### Build Time Dependencies
Expand Down
4 changes: 4 additions & 0 deletions doc/changes/changelog.md
@@ -0,0 +1,4 @@
# Changes

* [1.2.0](changes_1.2.0.md)
* [1.1.0](changes_1.1.0.md)
11 changes: 11 additions & 0 deletions doc/changes/changes_1.1.0.md
@@ -0,0 +1,11 @@
# JUnit5 System Extensions 1.1.0, released 2019-12-28

Code name: Mute output

## Summary

To mute the output (i.e. don't forward output to System.out / System.err) call stream.captureMuted() instead of stream.capture(). This can be useful to speed up unit tests.

## Features

* #16: Mute output of captured streams
17 changes: 17 additions & 0 deletions doc/changes/changes_1.2.0.md
@@ -0,0 +1,17 @@
# JUnit5 System Extensions 1.2.0, released 2019-04-22

Code name: Mute output

## Summary

When trapping `System.exit` calls, the `ExitGuardSecurityManager` now doesn't simply replace an existing security manager anymore. Instead it uses the existing one as a delegate for all checks except the exit check.

This way applications that require a security manager don't change their behavior.

## Features

* #23: Delegate security manager calls to the original security manager

## Refactoring

* #21: Migrate to Maven Central
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.itsallcode</groupId>
<artifactId>junit5-system-extensions</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<name>JUnit5 System Extensions</name>
<description>These extensions help testing behavior that is related to `System.x` calls like `exit(int).</description>
<url>https://github.com/itsallcode/junit5-system-extensions</url>
Expand Down

0 comments on commit a6f0547

Please sign in to comment.