Hi Phil,

when the method was actually executed it should be marked as covered, Hard to 
tell from the snippets what’s going wrong here.

Please provide a executable minimal reproducer (preferably a GitHub repo) where 
we can analyze the issue.

Regards,
-marc


> On 8. Apr 2019, at 00:23, Philipp Kraus <[email protected]> 
> wrote:
> 
> Hello,
> 
> I'm using Jacoco and testing AntLR visitor rules. I have got a parser which 
> does not implement all methods, but these methods return "null", so I would 
> like to check it for the line coverage if they really return null.
> So I have written a test with a data provider, which put the parameter class 
> into and the method name:
> 
> @Test
> @UseDataProvider( "nullrules" )
> public void nullreturnrules( @Nonnull final Pair<Class<?>, String> p_rule ) 
> throws NoSuchMethodException, InvocationTargetException, 
> IllegalAccessException
> {
>     final ManualVisitor<Object> l_visitor = new CASTVisitorManual();
> 
>     Assert.assertNull(
>         l_visitor.getClass().getMethod(
>             p_rule.getRight(),
>             p_rule.getLeft()
>         ).invoke(
>                 l_visitor,
>                 Mockito.mock(
>                     p_rule.getLeft()
>                 )
>         )
>     );
> }
> 
> So the pair is for example: ManualParser.TernaryoperationContext.class and 
> "visitTernaryoperation"
> 
> How can I tell JaCoCo agent that it should count the coverage?
> 
> Thanks
> 
> Phil
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/c9881d62-192f-4527-963d-892a20cb5afb%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/c9881d62-192f-4527-963d-892a20cb5afb%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/0E4497A9-A079-405F-A834-6F422CC9D60A%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to