我们正在尝试在maven项目中使用cobertura。如果我跑
mvn clean test
每个人都在没有问题的情况下进行测试
如果我尝试:
mvn cobertura:cobertura
我的测试工作都没有..我在pom.xml中添加了以下内容
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.2</version>
</plugin>
下面是我得到的一些输出:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.uftwf.enrollment.test.TestRemoveTestData
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.848 sec <<< FAILURE!
Running org.uftwf.enrollment.test.TestDAO
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 1.453 sec <<< FAILURE!
Running org.uftwf.enrollment.test.TestMember
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.278 sec <<< FAILURE!
Running org.uftwf.enrollment.test.TestServices
Tests run: 8, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 2.134 sec <<< FAILURE!
Results :
Tests in error:
RemoveEnrollmentRecord(org.uftwf.enrollment.test.TestRemoveTestData): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
EnrollmentDate(org.uftwf.enrollment.test.TestDAO): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
isMemberAlReady(org.uftwf.enrollment.test.TestDAO): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
findSchoolsTest(org.uftwf.enrollment.test.TestDAO): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
HoldPeriod(org.uftwf.enrollment.test.TestDAO): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
testFromFormat(org.uftwf.enrollment.test.TestMember): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
saveToPending(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
testIsInPending(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
testisSSNOnFile(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
testisDeceasedFalse(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
testisAlReadyMember(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
testCheckMemberStatus(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
EnrollmentDate(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
HoldPeriod(org.uftwf.enrollment.test.TestServices): Expecting a stackmap frame at branch target 271 in method org.uftwf.enrollment.controller.FlowControllerActions.checkStatus(Lorg/uftwf/enrollment/domain/Member;)Ljava/lang/String; at offset 91
Tests run: 14, Failures: 0, Errors: 14, Skipped: 0
[ERROR] There are test failures.
Please refer to /home/jsmith/tmp/enroll/Enroll/target/surefire-reports for the individual test results.
[INFO]
[INFO] <<< cobertura-maven-plugin:2.5.2:cobertura (default-cli) @ Enrollment <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.2:cobertura (default-cli) @ Enrollment ---
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 25 classes.
[cobertura] WARN [main] net.sourceforge.cobertura.reporting.ComplexityCalculator - JavaNCSS got an error while parsing the java file /home/jsmith/tmp/enroll/Enroll/src/main/java/org/uftwf/enrollment/constants/EnrollmentConstants.java
ParseException in STDIN
Last useful checkpoint: "org.uftwf.enrollment.constants.EnrollmentConstants"
Encountered " ">" "> "" at line 46, column 47.
Was expecting one of:
"boolean" ...
"byte" ...
"char" ...
"double" ...
"float" ...
"int" ...
"long" ...
"short" ...
<IDENTIFIER> ...
"?" ...
"boolean" ...
"char" ...
"byte" ...
"short" ...
"int" ...
"long" ...
"float" ...
"double" ...
<IDENTIFIER> ...
"?" ...
"?" ...
"?" ...
"?" ...