Closed mblanloeil closed 4 years ago
Not able to reproduce this issue using 7.1.0
. I used the attached sample project and it works fine.
github-2221.zip
The stack trace seems to suggest that the file name somehow came in as null, but looking at the code path, I cant seem to find a way that it could be possible.
So I would need a reproducible sample that can be used to recreate this issue.
Please comment once you have one, and we can re-open this issue.
Hello,
I finally reproduce this issue when I have a class test who mocked File class. You can use my sample (github-2221.zip) and launch mvn command : mvn -Dtest=KungFuPandaTest test github-2221.zip
@mblanloeil - I took a closer look at your issue. The root cause of the problem is because you are mocking File
object and the mocked object is what is getting exposed to TestNG as well (TestNG internally also uses the File object for report generation).
I am not well versed with Mocking File Objects, but my googling suggests that its a bad idea to mock a file object.
So at this juncture there's really not much that can be done from TestNG perspective since the underlying exception is arising from the JDK apis due to the interference of mocks.
So we might have to close this issue with no resolution from TestNG side.
@juherr - Do you have any suggestions on this ?
Default reporters can be disabled and you can use custom one which doesn't use File
. It could work.
As pointed by @krmahadevan's link, I'm not sure using File is a good idea and maybe shows a design issue somewhere. You should check if it is possible to modify the internal usage of File by something more configurable (like In/OutputStream).
@juherr - Should we close this issue, since there's not much that can be done from TestNG side.
TestNG 7.1.0
Expected behavior
I want run all test in parrallel (classes)
Actual behavior
All tests are succedeed, but maven goal crash on reporting :
Is the issue reproductible on runner?
Test case sample
Just run
mvn test
I use maven-surefire-plugin for run test :