You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2018/05/17 11:29:00 UTC

[jira] [Commented] (CAMEL-12491) route-coverage : report summary problem

    [ https://issues.apache.org/jira/browse/CAMEL-12491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16478923#comment-16478923 ] 

Claus Ibsen commented on CAMEL-12491:
-------------------------------------

Okay so the issue is that you have 2 unit tests, and that when you run both of them then the JMX state of the previous test is not cleared, eg if you add the spring annotation @DirtiesContext to ensure spring is cleanly shutdown between each test, you get the expected result.

However we can maybe detect this in the route coverage dumper - so the saved statistics do not include the previous data. It may be a bit tricky.

> route-coverage : report summary problem
> ---------------------------------------
>
>                 Key: CAMEL-12491
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12491
>             Project: Camel
>          Issue Type: Bug
>          Components: tooling
>    Affects Versions: 2.21.0
>            Reporter: Søren Mortensen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.21.2, 2.22.0
>
>
> Consider the example code given in CAMEL-12483
> When running camel:route-coverage the report show to many passes for the routes. It looks like the RouteCoverageEventNotifier files holds the sum of all tests, and not just the values for the single test method. 
>  
> {code:java}
> Class:  dk.smor.MySpringBootRouter
> Route:  myRouteId
>   Line #      Count   Route
>   ------      -----   -----
>       11          8   from
>       13          8     log
>       15          8     choice
>       16          2       setBody
>       18          2       log
>       20          2       setBody
>       22          2       log
>       24          2       setBody
>       26          2       log
>       28          2       setBody
>       30          2       log
> Coverage: 11 out of 11 (100.0%)
> {code}
> each log statement should only have been passed 1 time. And a total for 4 passes for the whole route. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)