You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Babak Vahdat (JIRA)" <ji...@apache.org> on 2013/01/20 16:36:13 UTC
[jira] [Comment Edited] (CAMEL-5983) Avoid the negative-tests to
behave as false-positive
[ https://issues.apache.org/jira/browse/CAMEL-5983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558278#comment-13558278 ]
Babak Vahdat edited comment on CAMEL-5983 at 1/20/13 3:35 PM:
--------------------------------------------------------------
Updated the attached *partial* patch as well which now includes more negative tests being *effectively* false-positive.
was (Author: bvahdat):
Updated the attached *partial* patch as well which now includes more tests being *infected*.
> Avoid the negative-tests to behave as false-positive
> ----------------------------------------------------
>
> Key: CAMEL-5983
> URL: https://issues.apache.org/jira/browse/CAMEL-5983
> Project: Camel
> Issue Type: Task
> Components: tests
> Affects Versions: 2.10.3
> Reporter: Babak Vahdat
> Attachments: CAMEL-5983-partial.patch
>
>
> We've got bunch of (negative) tests on the current codebase expecting a thrown {{XYZException}} however they don't realize if the expected exception is *not* thrown, the typical pattern for this is:
> {code}
> try {
> doSomething_With_Expectation_Of_A_Thrown_XYZException();
> } catch (XYZException e) {
> // expected
> }
> {code}
> Which correctly should be:
> {code}
> try {
> doSomething_With_Expectation_Of_A_Thrown_XYZException();
> fail("Should have thrown an exception");
> } catch (XYZException e) {
> // expected
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira