Fix for hidden exception during test setup. #12
Closed
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.
Hello,
I think this bugfix is very similar to #9 .
If some exception occurs during the test-setup (for example, my datasets contain invalid data), the original exception is still hidden by an NPE. The NPE occurs during the rollback of the transaction. (I'm not totally sure, that there is any transaction.)
See one example here: https://github.com/vilmosnagy/arquillian-transaction-bug
There are 3 test-cases:
test_should_pass_without_dataset
: in this test-case no dataset used, test passes.test_should_pass_with_dataset
: test uses a correct dataset, passestest_should_fail_with_incorrect_dataset
: test uses an incorrect dataset (one row contains an invalid column name), and NPE occurs, instead of ...Here is the NPE's stack trace (the last lines only):
And here's the original exception, thrown by H2:
I'd be happy to see the second exception, if something fails during the initialization of a test-case.