IntelliJ 12代码覆盖率无法在GWT项目的编辑器中使用 [英] IntelliJ 12 code coverage not working in editor for GWT Projects

查看:111
本文介绍了IntelliJ 12代码覆盖率无法在GWT项目的编辑器中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用IntelliJ 12,在运行覆盖测试后,我无法在编辑器中获得彩色(红色,绿色,黄色)。
有没有人注意到这个问题,或者只是我无法使它工作?

解决方案

最后我发现了是什么导致IntelliJ IDEA 12.0.0(以及12.0.1)使代码覆盖率出现故障。



我的项目是一个GWT项目,所以还有一些额外的配置运行gwt客户端测试:在类路径中添加源目录,以便gwt devmode可以无头运行进行测试:

 < build> 
< plugins>
< plugin>
< artifactId> maven-surefire-plugin< / artifactId>
< version> 2.5< / version>
< configuration>
< additionalClasspathElements>
<! - 以下两行,导致intellij覆盖停止工作 - >
< additionalClasspathElement> $ {project.build.sourceDirectory}< / additionalClasspathElement>
< additionalClasspathElement> $ {project.build.testSourceDirectory}< / additionalClasspathElement>
< / additionalClasspathElements>
< / configuration>
< / plugin>
< / plugins>
< / build>

将源文件夹添加到surefire的类路径会导致IntelliJ IDEA 12.x错误配置项目( .iml file)并且覆盖范围停止工作。



请注意,此maven配置对IntelliJ IDEA 11.x没有任何影响,完全正常。



<要重现该错误,只需将< additionalClasspathElement> 添加到您的surefire配置中,然后右键单击您的项目并执行Maven-> Reimport,然后运行覆盖测试;并且你会看到编辑错过了有关线条覆盖的所有信息。



我设法重现了这个问题,我将提交错误报告。



解决方法是注释掉两行< additionalClasspathElement> 并执行Maven-> Reimport ,然后在需要时取消注释。



报告错误 IDEA-97920 ,它将固定在12.0.2


I'm trying IntelliJ 12, and I can't manage to get the line colored (red, green, yellow) in the editors after running the tests with coverage. Did anybody noticed the problem or it's just me not being able to make it work?

解决方案

Finally I found out what was causing IntelliJ IDEA 12.0.0 (and also 12.0.1) to malfunction the code coverage.

My project is a GWT project, so there is some additional configuration to run the gwt client tests: the source directories are added in the classpath so that the gwt devmode can be ran headless to be tested:

 <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <additionalClasspathElements>
                        <!-- the following two lines, causes intellij coverage to stop working -->
                        <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
                        <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>
        </plugins>
    </build>

Adding the source folders to the classpath of surefire causes IntelliJ IDEA 12.x to misconfigure the project (the .iml file) and the coverage stops working.

Notice that this maven configuration doesn't have any impact in IntelliJ IDEA 11.x, that works perfectly.

To reproduce the bug, just add the <additionalClasspathElement> to your surefire configuration, then rightclick on your project and do a "Maven->Reimport", then run the tests with coverage; and you'll see that the editor misses all informations about the lines coverage.

I managed to reproduce the issue, and I am going to submit the bug report.

The workaround would be to comment out the two lines of <additionalClasspathElement> and do a "Maven->Reimport", then uncomment those if you need.

Bug reported IDEA-97920, it'll be fixed in 12.0.2

这篇关于IntelliJ 12代码覆盖率无法在GWT项目的编辑器中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆