I executed a simple test case (on jobss-ejb environment), which compares/asserts 2 strings.
Unfortunately, the strings are not matching to each other (there’s a bug).
But the problem is, when I execute the test case from eclipse it logs the result as failure which is correct because there’s a mismatch between expected and actual objects;
whereas when I execute the same test case from ant, the result is logged as error.
This is really strange and surprising and to add more to it, this behaviour is noticed on junit 4 version only, when i execute the test case on junit 3.8, both ant and eclipse log the result as failure.
Any suggestion or pointers on what might be going wrong?
Thanks in advance 🙂
Ant-version: 1.6.1
Junit version: 4.10
The differences in test result behavior as mentioned in question is because of ant version issue. For lower versions of ant, you’ll get such type of behavior (may be because the lower ant versions consider ComparisonFailure as error instead of failure).
I found this behavior in ant version 1.7.1 (and lower). But this issue is solved in latest ant jar i.e. 1.8.4.
When I executed the above mentioned test case on latest ant version, the result was logged as failure and not error.
So, if you encounter such a problem just update your ant jar to 1.8.4 or other latest version available.