Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
456 views
in Technique[技术] by (71.8m points)

java - Coverage view shows 0.0% in Intellij when using Jacoco

As discussed in Open JaCoCo report in Intellij IDEA, when I gather code coverage statistics using Jacoco (rather than native IntelliJ tracing) 0.0% (i.e. "no" coverage) is always shown in the coverage window.

This is after I have done the whole "Analyze -> Show coverage data..." and selected my generated "jacoco.exec" file.

The same "jacoco.exec" file works fine with other tools such as the Jacoco native report generation task, and with Sonar, and these produce the expected coverage report content.

Also native IntelliJ instrumentation works fine.

Can anybody advise me if there is some essential step I must perform to get IntelliJ to accept my Jacoco coverage?

question from:https://stackoverflow.com/questions/33897366/coverage-view-shows-0-0-in-intellij-when-using-jacoco

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When you add the class to PowerMockito annotation @PrepareForTest for the test classes, the corresponding class will not be showing the code coverage.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...