Add corner case test #11970
Conversation
|
The code in the com.thoughtworks package is for the old Selenium RC conversion code. I don't think we're still distributing it? |
|
if the code is still part of it then having tests can help ensure that any changes made to the code don't unintentionally break existing functionality. I feel its always better to have tests and not need them, than to need them and not have them |
|
@rishav887 sorry, I should have started by thanking you for your contribution. We appreciate it when people see things that can have more tests! I got distracted by wondering aloud in @diemol's direction if we can get away with deleting this code entirely, or if we need to move it to a separate repo, and if we can do this now, or if we want to wait for Selenium 5.0. |
|
Ah! Thats ok - thanks for acknowledging it. |
diemol
left a comment
There was a problem hiding this comment.
Thank you for your PR!
I can merge this to acknowledge the effort 🎉
However, this package will be deleted in the next weeks.
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Added some additional tests in BaseTest, HttpCommandProcessorUnitTest
Motivation and Context
HttpCommandProcessorUnitTest - Corner case test
The test ensures that all resources are correctly closed when an IOException happens during the getOutputStream() method call. This is important to prevent resource leaks that can harm system performance and cause system crashes. The test checks that the input stream, output stream, and socket are closed when an IOException occurs. By executing this test, developers can make sure that their code handles resource cleanup correctly during IOException and prevents issues from occurring in production.
BaseTest - streamlined to capture exception
Types of changes
Checklist