emma

How do I get Emma or Cobertura, with Maven, to report coverage on source code in other modules?

廉价感情. 提交于 2019-12-03 05:13:38
问题 I have a multi-module Maven setup with Java code. My unit tests, in one of the modules, exercise code in multiple modules. Naturally, the modules have inter-dependencies, and code in all relevant modules is compiled as needed in advance of test execution. So: How can I get a report on the coverage of the entire codebase? Note: I am not asking how to combine the results of coverage for tests in multiple modules. I am asking how to get coverage for tests in a single module using instrumented

Emma coverage on Enum types

浪子不回头ぞ 提交于 2019-12-03 04:43:12
问题 I'm running EclEmma, the Emma plugin for Eclipse, and the coverage report shows only partial coverage for an Enum I've defined, even though it shows the only value in the Enum as being covered. I'm assuming that there is a coverage gap for the implied methods that back the Enum, but I'm not quite sure. For example, with this Enum, EclEmma highlights everything in green, except for the package declaration: package com.blah; public enum UserRole { HAS_ACCESS } If I pull up the coverage details

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

泄露秘密 提交于 2019-12-03 04:39:25
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! There is an entry on this in the EMMA Faq: Implicit branches due to finally blocks. touching on the subject of partially covered finally blocks. Perhaps that helps. 来源: https://stackoverflow.com

How do I get Emma or Cobertura, with Maven, to report coverage on source code in other modules?

老子叫甜甜 提交于 2019-12-02 18:28:56
I have a multi-module Maven setup with Java code. My unit tests, in one of the modules, exercise code in multiple modules. Naturally, the modules have inter-dependencies, and code in all relevant modules is compiled as needed in advance of test execution. So: How can I get a report on the coverage of the entire codebase? Note: I am not asking how to combine the results of coverage for tests in multiple modules. I am asking how to get coverage for tests in a single module using instrumented code from multiple modules. Anyone interested in the former might refer to these other questions , and

Emma coverage on Enum types

a 夏天 提交于 2019-12-02 17:52:32
I'm running EclEmma, the Emma plugin for Eclipse, and the coverage report shows only partial coverage for an Enum I've defined, even though it shows the only value in the Enum as being covered. I'm assuming that there is a coverage gap for the implied methods that back the Enum, but I'm not quite sure. For example, with this Enum, EclEmma highlights everything in green, except for the package declaration: package com.blah; public enum UserRole { HAS_ACCESS } If I pull up the coverage details for the class, I see this: My question is, what is the best way to get 100% coverage on my Enum classes

Clearing coverage highlighting in Eclipse

别说谁变了你拦得住时间么 提交于 2019-12-02 13:49:55
After running coverage reports in Eclipse (using cobertura or an EMMA plugin), my source code files get highlighted in green, red and yellow depending on which lines of code were covered by tests. How can I clear this highlighting after I'm done? Click the "Remove all Sessions" button in the toolbar of the "Coverage" view. On 4.2 eclipse it seems to be impossible to remove the eCobertura highlights. Sadly eCobertura plugins seems to be not maintained anymore. However if you start writing into the class, its gone. So type a space, and then undo , and its gone. I found a workaround over on

Using emmarun (main method not found)

陌路散爱 提交于 2019-12-02 12:06:49
问题 I have an ultra simple file in an empty directory: public class Test { public static void main(String[] args) { System.out.println("Test"); } } And the following works as expected javac Test.java java Test > Test I am on Mac OS X, using emma-2.0.5312 and java 1.7.0_40 emma.jar has been installed to /Library/Java/Extensions, so this works java emmarun (it displays the help for using emmarun) Next I run java emmarun -cp . Test And I get the error: emmarun: [MAIN_METHOD_NOT_FOUND] application

EMMA with Junit, should I be testing with the instrumented classes or java classes?

自闭症网瘾萝莉.ら 提交于 2019-12-02 09:29:23
I've been going through this tutorial for my ANT Script for emma/junit, it states In the <classpath> element of <junit> , change the locations of your real classes, so that you are pointing at the ${instr.dir} attribute instead of your normal target/classes folder. Here is my emma section from of my build.xml for Apache Ant ( pastebin link to full build.xml) <!-- =================================================================== --> <!-- Run the tests with EMMA * depends from compile --> <!-- =================================================================== --> <target name="emmatest"

Using emmarun (main method not found)

前提是你 提交于 2019-12-02 03:27:58
I have an ultra simple file in an empty directory: public class Test { public static void main(String[] args) { System.out.println("Test"); } } And the following works as expected javac Test.java java Test > Test I am on Mac OS X, using emma-2.0.5312 and java 1.7.0_40 emma.jar has been installed to /Library/Java/Extensions, so this works java emmarun (it displays the help for using emmarun) Next I run java emmarun -cp . Test And I get the error: emmarun: [MAIN_METHOD_NOT_FOUND] application class [Test] does not have a runnable public main() method Exception in thread "main" com.vladium.emma

Can fully covered code have an EclEmma coverage rating of less than 100%?

最后都变了- 提交于 2019-12-01 17:55:01
I just wrote some simple sample code to make sure that I had EclEmma installed correctly. I'm not getting 100% coverage, and I don't understand why. The highlighting implies that it has to do with the class name. Here's my code, with corresponding JUnit tests, the way EclEmma highlighted it: The coverage results show that three instructions in Arithmetic aren't getting hit, even though both actual methods seem to be completely covered: I've read the EclEmma documentation about basic block coverage , but I'm still confused. I'm not sure which basic blocks are being missed. At first, I thought