-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add methods to access raw stdout/stderr logs #66
Conversation
Thanks for your contribution. I would like to add it to System Rules. Do you have time to write the tests for the new feature? |
I should be able to write some tests later this week. |
I added a basic test that verifies properly handing non-utf-8 data. I would say that proper behaviour with respect to muting, etc. is well covered by the existing tests, do you think something more is needed? |
Thanks for adding the test. I do my best to get a release out during next week. |
This is needed if your application does write binary data or text with a specific charset. Fixes stefanbirkner#66.
cf727f0
to
b807683
Compare
SystemErrRule and SystemOutRule have a new method "getLogAsBytes" which returns the raw bytes that have been written to System.err/System.out. This is helpful if your application writes binary data or text with a charset that is not the default charset. Fixes stefanbirkner#66.
b807683
to
24a1541
Compare
SystemErrRule and SystemOutRule have a new method "getLogAsBytes" which returns the raw bytes that have been written to System.err/System.out. This is helpful if your application writes binary data or text with a charset that is not the default charset. Fixes stefanbirkner#66.
24a1541
to
8673706
Compare
SystemErrRule and SystemOutRule have a new method "getLogAsBytes" which returns the raw bytes that have been written to System.err/System.out. This method can be used for testing applications that write raw binary data. Fixes stefanbirkner#66.
SystemErrRule and SystemOutRule have a new method "getLogAsBytes" which returns the raw bytes that have been written to System.err/System.out. This method can be used for testing applications that write raw binary data. Fixes stefanbirkner#66. Co-authored-by: Stefan Birkner <mail@stefan-birkner.de>
8673706
to
949e687
Compare
System Rules 1.19.0 adds a new method |
I would like to test some code that writes raw binary data to stdout. To do so I believe I need access to the underlying byte array, since a sequence of bytes may not be a valid string. Therefore I suggest to add a method
getLogBytes
toSystemOutRule
andSystemErrRule
. Let me know if you think this makes sense and if so I will add documentation and tests to this PR.