小编Sca*_*rog的帖子

尽管满足了工作要求,Cobertura报告的覆盖率为0%

是的,这是0%覆盖范围内的另一个.我检查并确认了以下内容:

1)...程序确实正在生成相应的cobertura.ser文件,并且该文件和Instrumented目录的内容已经消失,根据http://cobertura.sourceforge.net/faq.html.

2)......"仪表化"是Cobertura测试中确定的第一个类路径.

3)......我的测试套件中确实正在测试线路,并且...

4)......确实正在创建和编写"已检测"目录 - 我看到了这一点.

有点奇怪的是,我注意到Ant生成的报告只是一系列消息:

Testcase: pluralizeIt[0] took 0.004 sec
    Caused an ERROR
Instruction type does not match stack map in method StringUtil.main([Ljava/lang/String;)V at offset 50
java.lang.VerifyError: Instruction type does not match stack map in method StringUtil.main([Ljava/lang/String;)V at offset 50
    at PluralTest.pluralizeIt(PluralTest.java:55)
Run Code Online (Sandbox Code Playgroud)

但是如果我注释掉所有Cobertura引用和目标,那么测试运行正常,Ant报告在成功和失败方面给了我100%的预期.

我的build.xml文件在下面...任何想法??? 谢谢....

<?xml version="1.0" encoding="UTF-8"?>
<project name="TestPlurazliation" default="coverage" basedir=".">
    <property name="src" location="src" />
    <property name="build" location="bin" />
    <property name="cobertura" location="/Users/Dauber/Desktop/cobertura-1.9.4.1" />
    <property name="instrumented" location="instrumented" />
    <property name="coverage.xml" location="coverage-xml" />
    <property name="coverage.html" location="coverage-html" …
Run Code Online (Sandbox Code Playgroud)

ant code-coverage cobertura junit4

3
推荐指数
1
解决办法
3553
查看次数

标签 统计

ant ×1

cobertura ×1

code-coverage ×1

junit4 ×1