Closed dashorst closed 9 years ago
Thanks a lot and apologies for keeping this PR hanging that long. I will bring it to master tonight.
How about bringing your test example to the test suite of the project as well?
The issue is that the test case will always fail the build, even if the fix is in. I'm quite sure you don't want to have that in your automated build setup.
But we can try to test expected exception, can't we? :)
no, because in this particular test case the error happens outside the running of a test method. i.e. a setup failure injecting a CDI bean which is hidden by the NPE. This all is outside of the test method. If the test method were actually called, it has to fail since the setup completed without error.
You can always call JunitCore directly in a Junit @Test and assert on the Result..
Is the fix ever going to be merged?
Yes
Finally merged with master :) Thank you for the fix and patience!
When the setup of a testcase fails due to some exception when setting up CDI context, the TransactionHandler throws a NullPointerException while trying to determine the transaction result (rollback or commit). This masks the original exception making it hard to figure out what goes wrong when building a context for test cases.
You can see the particular testcase here: https://github.com/dashorst/arquillian-transaction-npe-test
The commit in this PR fixes the NPE and doesn't hide the original exception