Fix for ignored runtime exception in runner.run() method #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short description of what this resolves:
I would like to propose a fix for a problem that when there is a runtime exception or error while running runner.run() method in TestNGRunner, the problem is ignored.
If someone omits required runtime class in a deployment archive there will be ClassDefNotFoundError when executing run() method in TestNGRunner. Arquillian servlet will return HTTP code 500 which is ignored in servlet protocol runner and consequently returned as a test which passed. But in reality the test did not even run and should be marked as failed.
Changes proposed in this pull request:
I propose a fix which catches runtime exceptions and errors while executing runner.run() method and envelope it in TestResult.failed() so it is reported as failed test.