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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/c9881d62-192f-4527-963d-892a20cb5afb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to