intellij idea community edition - code coverage?

前端 未结 3 2025
一向
一向 2021-02-19 16:54

Looking at comparison matrix it looks like IDEA CE does not support code coverage at all. Bu there are lots of code coverage tools available, so perhaps it\'s possible to incorp

相关标签:
3条回答
  • 2021-02-19 17:10

    So, what doesn't work in CE is integrated code coverage. Any external tool would work. Emma for example integrates into maven and setting up maven goals inside IDEA is easy.

    Just alter your pom.xml to include the emma maven plugin and it should work inside IDEA and on normal command line.

    http://emma.sourceforge.net/maven-emma-plugin/

    0 讨论(0)
  • 2021-02-19 17:12

    Another way is to use sonar for the reports and add that to your maven pom.xml.

    I find the reports way more convenient to read than the emma reports.

    If you want to give it a try:

    1) Download SonarQube

    2) add the sonar plugin to you pom.xml (maven 3 example)

    <build>
      <pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sonar-maven-plugin</artifactId>
            <version>2.0</version>
          </plugin>
        <plugins>
      </pluginManagement>
    </build>
    

    3) start the sonar server

    4) run mvn -DskipTests sonar:sonar

    For more info, see the maven section of the sonar docs

    0 讨论(0)
  • 2021-02-19 17:28

    Information for people visiting this question in 2014+.

    Starting with Idea 14 (currently available only in Early Access Program released in November 2014) that feature is also available in a Community Edition.

    We think you’ll also appreciate the fact that Code Coverage tool, Structural Search and Replace, and Type Migration refactoring have become available in IntelliJ IDEA Community Edition.

    0 讨论(0)
提交回复
热议问题