You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 13, 2026. It is now read-only.
Jacoco code coverage tool should be supported since the version 1.1.5 (implemented by @rsauciuc ). However when we run jacoco on the sample project in this project, we are getting zero coverage. We are using following configuration in the parent pom:
I experience the same thing when I use the @RunWith(GwtMockitoTestRunner.class), JaCoCo will not consider that test execution and report as 0% coverage. The GwtMockitoTestRunner uses javassist.Loader class for bytecode manipulation and as far as I know JaCoCo does not work if the class under test has been modified during runtime. My feeling is that GwtMockitoTestRunner has never worked with JaCoCo (regardless what the change log says).
I'm not particularly familiar with JaCoCo - @rsauciuc, can you comment if it is/was working for you?
The only change in GwtMockito to support JaCoCo is to ensure that we use the standard classloader for everything under the org.jacoco package. Classes under test will go through the GwtMockito classloader to do things like stub native methods and unfinalize some methods, so if that process interferes with JaCoCo there might not be a fix. But we should leave the bytecode of normal methods untouched.
At the time I made the fix it was working for us, we were using JaCoCo in offline mode, doing bytecode instrumentation at build time.
In a different project, we had a similar problem with the agent competing with other instrumentation to make changes to the class files, and we switched the flag (classdumpdir, I think) to write out the class files after they were transformed, so JaCoCo's report task could match the binary coverage data with the actual classes.
I have set jacoco to do the offline instrumentation and it is working even for classes annotated @RunWith(GwtMockitoTestRunner.class). So far this is the only way to make it work I know about.
Thanks @jsoltes , with offline instrumentation it works as excepted and shows the coverage.
Maybe it will help for others, this is how I enabled it with maven:
Should this still work with GWT 2.8.2 and GwtMockito + plain old JUnit Tests? Somehow do not get it to work at all. Does not even create the jacoco.exec file ("Skipping JaCoCo execution due to missing execution data file."). Anybody managed to find a solution?
Activity
nukesz commentedon Apr 6, 2017
I experience the same thing when I use the @RunWith(GwtMockitoTestRunner.class), JaCoCo will not consider that test execution and report as 0% coverage. The GwtMockitoTestRunner uses javassist.Loader class for bytecode manipulation and as far as I know JaCoCo does not work if the class under test has been modified during runtime. My feeling is that GwtMockitoTestRunner has never worked with JaCoCo (regardless what the change log says).
ekuefler commentedon Apr 9, 2017
I'm not particularly familiar with JaCoCo - @rsauciuc, can you comment if it is/was working for you?
The only change in GwtMockito to support JaCoCo is to ensure that we use the standard classloader for everything under the
org.jacocopackage. Classes under test will go through the GwtMockito classloader to do things like stub native methods and unfinalize some methods, so if that process interferes with JaCoCo there might not be a fix. But we should leave the bytecode of normal methods untouched.rsauciuc commentedon Apr 10, 2017
At the time I made the fix it was working for us, we were using JaCoCo in offline mode, doing bytecode instrumentation at build time.
In a different project, we had a similar problem with the agent competing with other instrumentation to make changes to the class files, and we switched the flag (classdumpdir, I think) to write out the class files after they were transformed, so JaCoCo's report task could match the binary coverage data with the actual classes.
jsoltes commentedon Apr 11, 2017
I have set jacoco to do the offline instrumentation and it is working even for classes annotated @RunWith(GwtMockitoTestRunner.class). So far this is the only way to make it work I know about.
nukesz commentedon Apr 13, 2017
Thanks @jsoltes , with offline instrumentation it works as excepted and shows the coverage.
Maybe it will help for others, this is how I enabled it with maven:
To execute without coverage
With coverage (and instrument):
JonCook commentedon Jun 22, 2017
Any idea how to do this for ant? Thanks
zeitwesen commentedon Sep 14, 2019
Should this still work with GWT 2.8.2 and GwtMockito + plain old JUnit Tests? Somehow do not get it to work at all. Does not even create the jacoco.exec file ("Skipping JaCoCo execution due to missing execution data file."). Anybody managed to find a solution?