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
Clarify how to use processExistingClasses in debugging.adoc #3130
Conversation
@kicmeri Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
1 similar comment
@kicmeri Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@kicmeri Thank you for signing the Contributor License Agreement! |
@kicmeri can you clarify what didn't work for you and what kind of error you got?
the fact that you had to use a |
@simonbasle I was trying to follow the documentation of reactor.
This produced the exception, but without traceback as I'd have expected - just stacktrace. The introspection still seemed to have been applied (when run in debug mode).
I also tried with
but with same result. Then I came about ReactorDebugAgentTest that uses the
Still, it can be that I'm just doing something wrong.
I'm not sure what else could have set it up, I'm not using the maven plugin. Regarding JVM I use
|
thanks for the clarifications, that's good feedback. note that this section of the documentation isn't intended as a recipe for unit tests specifically, but more as an indicator that the tool offers a path to JVM's |
@simonbasle The setup with Nonetheless, all I intended is to improve the doc. I see it is questionable whether it is really an improvement. Thus, when you say
feel free to close this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think even though this wasn't intended as an example, it did confuse you.
We can probably add the TestExecutionListener
example. The sentence before the snippet would need a bit of splitting and rewording. What do you think about:
You may also re-process existing classes with `processExistingClasses()` if you cannot run the init eagerly.
For example, in a JUnit5 `TestExecutionListener`:
then the modified sample (not static block but listener)
@simonbasle Well, thinking about it: My purpose was not exactly to use the PROD debugging feature in test. I just tried it in the test. When I do it from regular application in my setup
I still get the no traceback. with the above code it again works only with static initializer, no JUnit framework involved at all. Thus the wording pointing to unit testing is rather misleading and I'd prefer some hint on what to try, when the misbehaviour happens, regardless of the cause. |
yeah I think that works 👍 |
Proposing the change as I was unable to make it work in test method or with `@BeforeAll`. Hoping it may save time for others.
Improve the hint for alternative setups
I'll rebase this PR on top of |
@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to |
Proposing the change as I was unable to make it work in test method or with
@BeforeAll
. Hoping it may save time for others.