ASSERT-KTH / ASSERT-KTH/flacoco
Bug: java.lang.NoSuchMethodError
- Dominant language
- Java
- Stars
- 38
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I'm trying to run Flacoco on this [project](https://github.com/davidson-consulting/diff-jjoules-demo) but I have the following error:
```txt
Exception in thread "main" java.lang.NoSuchMethodError: 'org.junit.platform.engine.ConfigurationParameters org.junit.platform.launcher.TestPlan.getConfigurationParameters()'
at org.junit.platform.launcher.listeners.UniqueIdTrackingListener.testPlanExecutionStarted(UniqueIdTrackingListener.java:143)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$testPlanExecutionStarted$6(TestExecutionListenerRegistry.java:97)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry.notifyTestExecutionListeners(TestExecutionListenerRegistry.java:59)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry.access$100(TestExecutionListenerRegistry.java:28)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.testPlanExecutionStarted(TestExecutionListenerRegistry.java:97)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:183)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
at eu.stamp_project.testrunner.runner.JUnit5Runner.run(JUnit5Runner.java:98)
at eu.stamp_project.testrunner.runner.coverage.JUnit5OnlineJacocoRunner.executeCoveredTestPerTestMethod(JUnit5OnlineJacocoRunner.java:30)
at eu.stamp_project.testrunner.runner.coverage.JacocoOnlineRunner.runCoveredTestResultPerTestMethod(JacocoOnlineRunner.java:41)
at eu.stamp_project.testrunner.runner.coverage.JUnit5OnlineJacocoRunner.main(JUnit5OnlineJacocoRunner.java:48)
```
Here the `toString()` of the used `FlacocoConfig`:
```txt
FlacocoConfig{workspace='/home/benjamin/workspace/diff-jjoules-demo/.', projectPath='/home/benjamin/workspace/diff-jjoules-demo', srcJavaDir=[/home/benjamin/workspace/diff-jjoules-demo/src/main/java], srcTestDir=[/home/benjamin/workspace/diff-jjoules-demo/src/test], binJavaDir=[/home/benjamin/workspace/diff-jjoules-demo/target/classes], binTestDir=[/home/benjamin/workspace/diff-jjoules-demo/target/test-classes], classpath='/home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.8.2/junit-jupiter-api-5.8.2.jar:/home/benjamin/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-commons/1.8.2/junit-platform-commons-1.8.2.jar:/home/benjamin/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.8.2/junit-jupiter-engine-5.8.2.jar:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-engine/1.8.2/junit-platform-engine-1.8.2.jar:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-launcher/1.8.2/junit-platform-launcher-1.8.2.jar:/home/benjamin/.m2/repository/junit/junit/4.13.2/junit-4.13.2.jar:/home/benjamin/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar', customJUnitClasspath='null', customJacocoClasspath='null', mavenHome='/home/benjamin/.m2/repository/', coverTests=false, testRunnerVerbose=true, testRunnerTimeoutInMs=1000000, testRunnerJVMArgs='null', threshold=0.0, includeZeros=false, complianceLevel=8, testDetectionStrategy=CLASSLOADER, ignoredTests=[], jUnit4Tests=[], jUnit5Tests=[], jacocoIncludes=[], jacocoExcludes=[], family=SPECTRUM_BASED, spectrumFormula=OCHIAI, computeSpoonResults=false}
[0] INFO Flacoco - Running Flacoco...
Parsing --sourceBinaries /home/benjamin/workspace/diff-jjoules-demo/target/classes --testBinaries /home/benjamin/workspace/diff-jjoules-demo/target/test-classes --class fr.davidson.diff_jjoules_demo.TestCode --coverage-detail DETAIL_COMPRESSED
```
Seems that there is a conflict between the versions of `org.junit.platform.launcher` where the method `getConfigurationParameters()` of `ConfigurationParameters` has been introduced in `1.8` while Flacoco is running in `1.3`:
```java
@API(status=MAINTAINED,
since="1.8")
public ConfigurationParameters getConfigurationParameters()
```
```txt
Get the ConfigurationParameters for this test plan.
Returns:
the configuration parameters; never null
Since:
1.8
```
[source](https://junit.org/junit5/docs/current/api/org.junit.platform.launcher/org/junit/platform/launcher/TestPlan.html#getConfigurationParameters())
However, I did try to bump the versions in Flacoco (and in STAMP-project/test-runner) but it did not work :disappointed:
Have you any idea?
Thank you very much!
Contributor guide
No contributing guide indexed for this repository
Research direction
Trace the JUnit platform dependencies used by JUnit5Runner and compare the launcher versions in Flacoco and STAMP-project/test-runner. Reproduce the reported FlacocoConfig setup against the linked project, then verify that execution completes without the NoSuchMethodError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100