Why is a method call shown as not being covered when the code inside the method is covered by emma?

I am writing unit test to verify that a private method closes the stream.

unit test calls method B and the variable is null

unit test doesn't mock a class when testing

The private method is in the public method that I am calling.

Using emma in eclipse (via the eclemma plugin) the method call appears as not covered, although the code inside the method

eg

public methodA(){

    if (something==null) {
        methodB(); //Not displayed as covered
    }
}

private methodB(){
    lineCoveredByTest; //displayed as covered
}

Why doesn't the method call stand out as covered?

+3
source share
2 answers

, eclipse EMMA , , . EMMA ( ANT). , , EMMA, (, , eclipse).

+2

, "unit test methodB()", , methodA().

, , methodB() , unit test methodC() ?

0

Source: https://habr.com/ru/post/1696802/


All Articles