Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use CloseableResource #3840

Merged

Conversation

SveinKare
Copy link
Contributor

@SveinKare SveinKare commented Jun 1, 2024

Issue: #1555

Overview

Added an explanation in the user guide for how CloseableResource can be used, with an example using an HttpServer resource.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@@ -714,6 +713,26 @@ extension context lifecycle ends it closes its associated store. All stored valu
that are instances of `CloseableResource` are notified by an invocation of their `close()`
method in the inverse order they were added in.

An example use-case of `ClosableResource` is shown below, using an `HttpServer` resource.

This comment was marked as resolved.

@SveinKare SveinKare changed the title Document how to use ClosableResource Document how to use CloseableResource Jun 1, 2024
@sbrannen sbrannen changed the title Document how to use CloseableResource Document how to use CloseableResource Jun 3, 2024
@marcphilipp marcphilipp modified the milestone: 5.11 M3 Jun 6, 2024
@marcphilipp marcphilipp linked an issue Jun 6, 2024 that may be closed by this pull request
1 task
Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! 👍

Instead of implementing BeforeAllCallback, I think we should implement ParameterResolver for HttpServer and start the server lazily when it's first being resolved.

@SveinKare Please let me know if you have time to make this change or if you'd like me to take over.

@SveinKare
Copy link
Contributor Author

@marcphilipp You can go ahead and change it

@marcphilipp marcphilipp self-assigned this Jul 9, 2024
@marcphilipp marcphilipp merged commit b09aa8b into junit-team:main Jul 9, 2024
16 checks passed
@marcphilipp
Copy link
Member

@SveinKare Thanks for taking care of this! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document how to use CloseableResource
4 participants