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
Injection problems, 1.13 and newer messes with TestNG's reporting #130
Comments
I found the user group. I will send the sample there. |
Item 1 would be an enhancement, not a bug. But before considering it, I would need to understand what the real-world uses are. Item 2 seems the same as issue #121, which was already fixed for the next release. |
For item 2: Yes, that does appear to be a duplicate. I look forward to seeing 1.15 come out so I can verify it is fixed. For item1: My specific use case came from mocking the BufferedWriter class with a mocked field. I found that when I had that mocked field present, TestNG would not report the test results for any of the tests in that Test class, and so my build was getting a false success. In an attempt to circumvent that problem I tried making it a mocked parameter to the only function that actually needed it mocked. My hope was that the decreased scope would keep it from mocking whatever instance that TestNG needed to perform its work. Unfortunately, that function was also hooked up to a Data Provider, and I could not find a way to restrict the Mocked range on the BufferedWriter class any other way. I ended up having to let the tested function write out its contents to a real file and then verify the contents of that file. |
I will look into the conflict with TestNG when using "@mocked BufferedWriter" mock field; ideally, it should work. And if it can't be made to work reliably, then JMockit shoud forbid the full mocking of BufferedWriter; it's probably not a good idea anyway to mock such classes, as such code is an implementation detail that you don't want tests to depend on. Support for mock parameters in test methods with data providers could be added to JMockit, I imagine. I won't be doing it any time soon, though, as there is plenty of more important things to work on for now. I can accept a PR, though. |
I have two bugs to report on here. I have a sample project that demonstrates both. Please let me know where to send it.
FYI, I turned in this bug to the TestNG folks as well, but it does not appear that they will be able to help. You can view that ticket here: cbeust/testng#600 (comment)
The text was updated successfully, but these errors were encountered: