eclemma

Eclemma says 1 of 4 branches not covered, but which branch is it?

ⅰ亾dé卋堺 提交于 2019-12-21 03:29:09
问题 Is there a simple way to tell which branch I am missing? I.e. I have some code like this: if (x || y) { // do stuff } In the coverage highlighting there is a yellow dot in Eclipse that says: 1 of 4 branches missed but I would like to know which branch is missing. 回答1: An open issue on the github repo for Eclemma's parent, jacoco, suggests that such a feature would actually be a bit difficult to include. However, even without an Eclemma feature, if the goal is just to figure out the branches

Coverage exclusion in Eclipse [EclEmma] is not working?

北慕城南 提交于 2019-12-20 05:40:29
问题 According to this post on StackOverflow and EclEmma's documentation, exclusion of classes from the coverage should be very possible. However, while the "includes" field works just as described, the "excludes" field does not. Take the following project hierarchy and coverage runtime settings respectively: But, after running the coverage operation, the exclude setting does not work: As one can see, the excluded package is still being included in the overall coverage testing. In addition, if you

EclEmma Code Coverage Ignore Junit Tests

末鹿安然 提交于 2019-12-13 15:12:59
问题 The only way I have found to not check code coverage on my JUnit tests is to right click on the package, choose Coverage as..., and then choose configuration. Then I can unclick my test package. I have tried every possible combination to exclude test under the general preferences/java/code coverage/exclude and not seen any changes. I always put my tests in a separate test source folder with the same package name as my src code. Do I really have to configure every single project to ignore my

eclemma 1 of 2 branch not covered in Junit

北城余情 提交于 2019-12-13 00:56:17
问题 JUnit file public class SomeClassTest { ... @Test public void testSomeContextFailure() throws Exception { SomeClass sc = new SomeClass(); try { sc.SomeContext(null,null); fail("IllegalArg expected"); } catch (IllegalArgumentException e) {} } @Test public void testSomeContextSuccess() throws Exception { SomeClass sc = new SomeClass(); SomeContext in = new SomeContext(); in.setName("something"); in.setId("5"); in.setPoints(SomePoint.X); try { assertNotNull(sc.SomeContext(in,null)); } catch

false code coverage reported using GwtMockito

孤街浪徒 提交于 2019-12-11 23:19:53
问题 Is there any reason why EclEmma(JaCoCo based) in Eclipse falsely reports the code coverage while using the GwtMockitoTestRunner ? Looking at it's source code, it does install it's own class loader and does byte code manipulation using the Javassist library . Could this affect the code coverage tool anyhow? 回答1: It looks like the issue is that EclEmma/JaCoCo doesn't work well with final methods and with native methods(GWT JSNI code). Fixing these methods everything returned to normal, the

Using Jmockit with Eclemma

谁说我不能喝 提交于 2019-12-11 03:19:30
问题 I am using Jmockit to junit my code and Eclemma plugin in Eclipse for code coverage. For some reason I am not abe to get the coverage. Other project which uses PowerMock, Eclemma shows code coverage fine. But with Jmockit there seems to be some problem. The following is the exception: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

EclEmma fails to count method that throws an exception as covered

你说的曾经没有我的故事 提交于 2019-12-11 00:25:37
问题 I am not getting to the 100% code covered and would like to. Unless I see the 100% green I wonder what I forget to test and go hunting only to find out silly things based on the tool and not my test are keeping me from it. Then later I forget and have to rinse/repeat. While all paths are covered in testThrow because of the exception it is not counted as run. Is there a way to re-write it so it is seen as covered towards that elusive 100% green. public class Dummy { public void testThrow()

How do I ignore scanning certain classes using EclEmma and Eclipse?

↘锁芯ラ 提交于 2019-12-07 04:24:57
问题 I am using EclEmma (inside of Eclipse) to scan my JUnit code coverage. This works correctly - however, I do not want EclEmma to scan my src/view folder since it contains Swing code that I consider not worthy of testing. Is there any way to ignore this folder when EclEmma runs so that it: a) runs faster, and b) does not skew the coverage percentage? EDIT: My project's structure is: src/view src/model src/controller I have tried these (possibly others) with the Path Entries section in the

Error while loading coverage session (code 5001)

亡梦爱人 提交于 2019-12-05 14:09:52
I got the following error when I am trying to check coverage using EclEmma, please help me out: Error while loading coverage session (code 5001). Error while analyzing package fragment root java at F/solo-repository/target/test-classes (code 5007). File not found: D:\RDM Services\solo-repository\target\test-classes\com\charter\solo\account\repository\AccountBillInformationRepositoryTest.class. D:\RDM Services\solo-repository\target\test-classes\com\charter\solo\account\repository\AccountBillInformationRepositoryTest.class (The system cannot find the path specified) Priyesh I had similar

How do I ignore scanning certain classes using EclEmma and Eclipse?

浪尽此生 提交于 2019-12-05 10:24:51
I am using EclEmma (inside of Eclipse) to scan my JUnit code coverage. This works correctly - however, I do not want EclEmma to scan my src/view folder since it contains Swing code that I consider not worthy of testing. Is there any way to ignore this folder when EclEmma runs so that it: a) runs faster, and b) does not skew the coverage percentage? EDIT: My project's structure is: src/view src/model src/controller I have tried these (possibly others) with the Path Entries section in the Preferences page: "src/view" "src/view/*" "view" "view/*" src/view These are using the Excludes section in