emma

Java 7 with emma and junit causing java.lang.VerifyError and Illegal local variable Errors

偶尔善良 提交于 2019-12-20 18:22:55
问题 So I'm getting these errors [junit] Illegal local variable table length 17 in method test.nz.ac.massey.cs.sdc.log4jassignment.s06005586.AppenderLayoutTest.()V [junit] java.lang.VerifyError: Expecting a stackmap frame at branch target 11 in method test.nz.ac.massey.cs.sdc.log4jassignment.s06005586.StressTest.()V at offset 4 [junit] java.lang.ClassFormatError: Illegal local variable table length 17 in method test.nz.ac.massey.cs.sdc.log4jassignment.s06005586.AppenderLayoutTest.()V And I would

Why emma doesn't give full coverage to finally blocks?

喜你入骨 提交于 2019-12-20 17:06:13
问题 I don't get why emma doesn't give full code coverage to "finally" blocks. I've made a short example program to demonstrate this. When I execute the program it shows: try finally So I don't get why finally is marked as red (not executed) and the "finally" "println" is marked yellow (partially executed). Am I missing something? How to make emma understand that the finally block is covered? Thank you! 回答1: There is an entry on this in the EMMA Faq: Implicit branches due to finally blocks.

Which emma-maven-plugin should I be using?

北城以北 提交于 2019-12-18 04:37:20
问题 org.sonatype.maven.plugin :emma-maven-plugin:1.2 org.codehaus.mojo :emma-maven-plugin:1.0-alpha-3 org.apache.maven.plugins :maven-emma-plugin:0.5 回答1: I'm not sure which one is the best. I do know that there is hardly any documentation on the sonatype plugin (other than this blog). Also I think the apache one is rather old, so personally I would try the codehaus plugin. 回答2: Use jacoco - emma in no longer supported. Jacoco supports java 7. <plugin> <groupId>org.jacoco</groupId> <artifactId

Ant emma test with android “Could not find file coverage.em to delete.”

不羁的心 提交于 2019-12-13 21:08:34
问题 I'm trying to get code coverage set up for my android project with Ant and Emma, and I have the project successfully building, the tests successfully running, and the coverage.ec file generating, but the coverage reports aren't being generated. When I ran ant -verbose emma test I got the following clues: [report] nothing to do: no metadata found in any of the data files ... [delete] Could not find file /path/to/my/testProject/bin/coverage.em to delete. I'm using the default build.xml file

IntelliJ 12 code coverage not working in editor for GWT Projects

只愿长相守 提交于 2019-12-13 11:43:41
问题 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? 回答1: By default code coverage results are displayed only in the left gutter and may be hard to notice: You can either change the gutter colors or configure IntelliJ IDEA to change the background of the whole lines (instead of the foreground) depending on their coverage

Unable to get Emma Coverage for Android [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-12 19:12:42
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: generating code coverage report for android test project I am facing a problem in Emma Coverage for an Android Project. I am able to generate the build.xml for the Project and the Test Project. But when I run " ant coverage " I do get the following error: Buildfile: C:\Documents and Settings\user\workspace\HelloAndroidTest\build.xml BUILD FAILED Target "coverage" does not exist in the project

“java” succeeds,“ java emmarun” fails

会有一股神秘感。 提交于 2019-12-11 18:17:28
问题 Disclaimer: I am new to java and emma. Details: I installed emma, and have worked through some of the examples. No problems. I have a java project with a number of files that I wish to get a coverage report. I type "javac -d out *.java". No errors. I type "java -cp out Main". The program runs fine and I get the expected output. I type "java emmarun -cp out Main". I get the following: emmarun: [MAIN_METHOD_NOT_FOUND] application class [Main] does not have a runnable public main() method

Measure unit code coverage % for function/method on Cyclomatic Complexity?

Deadly 提交于 2019-12-11 10:35:50
问题 Is there an approach to collect/report on unit test coverage based on a complexity ratio such as Cyclomatic Complexity on a method/function level? The reason/intent is to provide a measurable metric to show any areas that have a higher chance of defects based on complexity actually have appropriate unit test coverage (i.e. a metric away out of '100%' or '80%' coverage by changing the metric to '100% of Cyclomatic Complexity >= 10 for example). My usecase is currently Java/junit, and a

How to change Ant script with EMMA code-coverage so it can find runtime coverage data?

谁说胖子不能爱 提交于 2019-12-11 06:14:27
问题 I have following script: <?xml version="1.0" encoding="UTF-8"?> <taskdef resource="emma_ant.properties"> <classpath> <pathelement location="lib/emma.jar" /> <pathelement location="lib/emma_ant.jar" /> </classpath> </taskdef> <target name="compile"> <mkdir dir="build"/> <!-- vytvori adresar build --> <mkdir dir="build/classes"/> <mkdir dir="build/test"/> <javac destdir="build/classes" srcdir="src" debug="true" /> <!-- prelozi zdrojove kody --> <javac destdir="build/test" srcdir="test"> <!--

Emma reports 0% coverage

你离开我真会死。 提交于 2019-12-11 02:29:23
问题 I want to get code coverage when running unit tests. I run ant coverage using standard android build.xml for tests. Tests run well. The last strings from ant coverage are Tests run: 59, Failures: 1, Errors: 4 Generated code coverage data to /data/data/my.package/files/coverage.ec But the coverage.ec file is only 37 bytes long and is almost empty. Running emma report on it tells no collected coverage data found in any of the data files [all reports will be empty] and generates beautiful report