https://github.com/j256/eclemma-failure
Small test program that demonstrates a strange issue with Junit, Easymock, Commons Logging, and EclEmma/Jacoco.
https://github.com/j256/eclemma-failure
commons-logging eclipse emma junit
Last synced: about 2 months ago
JSON representation
Small test program that demonstrates a strange issue with Junit, Easymock, Commons Logging, and EclEmma/Jacoco.
- Host: GitHub
- URL: https://github.com/j256/eclemma-failure
- Owner: j256
- Created: 2021-01-03T18:55:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T16:04:45.000Z (over 4 years ago)
- Last Synced: 2025-01-31T01:11:54.292Z (4 months ago)
- Topics: commons-logging, eclipse, emma, junit
- Language: Java
- Homepage: https://stackoverflow.com/questions/65511268/getting-a-no-coverage-data-has-been-collected-message-using-eclemma-and-eclips
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
This project demonstrates a strange issue with Junit, Commons Logging, and EclEmma/Jacoco. EclEmma is a
(usually awesome) coverage tool that runs under eclipse and maven via jacoco plugin.See:
https://stackoverflow.com/questions/65511268/getting-a-no-coverage-data-has-been-collected-using-emma-and-eclipseWhen I run junit tests with EclEmma coverage I get the following error:
No coverage data has been collected during this coverage Session.
Please do not terminate the Java process manually from Eclipse.If you do any of the following the problem goes away:
* Comment out the `LogFactory.getLog(getClass())` call.
* Remove the junit `@Test` timeout field.
* Downgrade Junit from 4.13.1 to 4.12.# Running the Tests Using Maven
Running `mvn clean test` should run junit and then cause jacoco to produce coverage information in
`target/site/jacoco`. If the `createMock(...)` line is commented out then it should show `Foo` has 100% coverage. If
if it is not commented then it should show `Foo` as completely uncovered although the "hello" message is emitted.# Dependencies
* Eclemma 3.1.3 or jacoco-maven-plugin 0.8.6
* apache commons-logging version 1.2
* junit version 4.13.1 (4.12 doesn't exhibit this issue)