我尝试查看报道。添加 coverage:true 并收到错误 没有 coverage:true ,但我需要知道代码覆盖率的百分比。 似乎解析器试图将每个文件解析为java,而不是as3,请帮忙!
[exec] [INFO] Running tests /home/oleg/IdeaProjects/RTB/Resources/target/test-classes/TestRunner.swf
[exec] [WARNING] [LAUNCHER] Using regular flashplayer tests
[exec] net.sourceforge.cobertura.javancss.parser.ParseException: Encountered " "{" "{ "" at line 8, column 54.
[exec] Was expecting:
[exec] ";" ...
[exec]
[exec] at net.sourceforge.cobertura.javancss.parser.JavaParser.generateParseException(JavaParser.java:10296)
[exec] at net.sourceforge.cobertura.javancss.parser.JavaParser.jj_consume_token(JavaParser.java:10172)
[exec] at net.sourceforge.cobertura.javancss.parser.JavaParser.PackageDeclaration(JavaParser.java:558)
[exec] at net.sourceforge.cobertura.javancss.parser.JavaParser.CompilationUnit(JavaParser.java:312)
[exec] at net.sourceforge.cobertura.javancss.parser.JavaParser.parse(JavaParser.java:137)
[exec] at net.sourceforge.cobertura.javancss.Javancss._measureSource(Javancss.java:256)
[exec] at net.sourceforge.cobertura.javancss.Javancss._measureRoot(Javancss.java:339)
[exec] at net.sourceforge.cobertura.javancss.Javancss.<init>(Javancss.java:419)
[exec] at net.sourceforge.cobertura.reporting.ComplexityCalculator.getAccumlatedCCNForSource(ComplexityCalculator.java:102)
[exec] at net.sourceforge.cobertura.reporting.ComplexityCalculator.getAccumlatedCCNForSingleFile(ComplexityCalculator.java:139)
[exec] at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForSourceFileNameInternal(ComplexityCalculator.java:224)
[exec] at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNFoWARN getAccumlatedCCNForSource, JavaNCSS got an error while parsing the java file /home/oleg/IdeaProjects/RTB/Resources/src/prrPackageInternal(ComplexityCalculator.java:194)
[exec] at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForProject(Coojects/pt/clients/fp/resources/models/icon/IconModel.as
[exec] ParseException in STDIN
[exec] Last useful checkpoint: ""
[exec] Encountered " "{" "{ mplexityCalculator.java:164)
[exec] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateTableRowForTotal(HTMLReport.java:70"" at line 8, column 54.
[exec] Was expecting:
[exec] ";" ...
[exec]
[exec]
[exec] WARN getAccumlatedCCNForSource, JavaNCSS got an error while parsing 4)
[exec] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateOverview(HTMLReport.java:336)
[exec] at net.sourceforge.cobertura.rthe java file /home/oleg/IdeaProjects/RTB/Resources/src/projects/pt/clients/fp/resources/models/resourceloader/ResourceLoaderModeporting.html.HTMLReport.generateOverviews(HTMLReport.java:271)
[exec] at net.sourceforge.cobertura.reporting.html.HTMLReport.<init>(Hel.as
[exec] ParseException in STDIN
[exec] Last useful checkpoint: ""
[exec] Encountered " "{" "{ "" at line 8, column 64.
[exec] Was expecting:
[exec] ";" ..TMLReport.java:96)
[exec] at org.sonatype.flexmojos.coverage.cobertura.CoberturaCoverageReport.generateReport(CoberturaCoverageReport..
我的构建配置:
<build>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>4.0-RC1</version>
<extensions>true</extensions>
<configuration>
<iKnowWhatImDoingPleaseBreakMyBuildIwontBlameFlexmojosForStopWorking>true</iKnowWhatImDoingPleaseBreakMyBuildIwontBlameFlexmojosForStopWorking>
<storepass/>
<includeTestFiles>
<includeTestFile>*Test.as</includeTestFile>
</includeTestFiles>
<skipTests>false</skipTests>
<coverage>true</coverage>
<coverageReportFormat>
<param>html</param>
</coverageReportFormat>
</configuration>
</plugin>
</plugins>
</build>
答案 0 :(得分:0)