Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 545765 - Unit Tests can't be executed
Summary: Unit Tests can't be executed
Status: CLOSED DUPLICATE of bug 545849
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.11   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-25 16:31 EDT by Bernhard Böck CLA
Modified: 2019-04-08 10:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Böck CLA 2019-03-25 16:31:03 EDT
When I want to run Unit Test (JUnit 5), Eclipse shows an pop-up with the title "Could not run test" and with the message "No tests found with test runner JUnit 5".

In the Console tab i find the following exception:
java.lang.NoSuchMethodError: org.junit.platform.launcher.Launcher.execute(Lorg/junit/platform/launcher/TestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

(The gradle project has been imported into a new workspace, there was no migration from a previous version).
Comment 1 Noopur Gupta CLA 2019-03-26 02:32:54 EDT
Looks like a plug-ins configuration issue. Please download a fresh installation of Eclipse 2019-03 and try again.
Comment 2 Bernhard Böck CLA 2019-03-27 17:12:21 EDT
A fresh installation didn't solve the problem. After some tests it seems that it the problem comes from the gradle project itself. Unit Tests are working fine for new created projects but not for our application. I think you can close this issue, we have to find the problem in our project setup.

Thanks for your help,
Bernhard
Comment 3 Noopur Gupta CLA 2019-03-28 02:24:28 EDT
Note that you should be using JUnit 5.4 with the latest Eclipse setup. 
https://www.eclipse.org/eclipse/news/4.11/jdt.php#junit-5.4
Comment 4 Etienne Reichenbach CLA 2019-04-03 08:34:34 EDT
Could it be that it's a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=545849 ?

Does the problem get fixed if you use version 1.4.1 of junit-platform-launcher ?
Comment 5 Bernhard Böck CLA 2019-04-08 09:42:32 EDT
It seems that this issue is a duplicate of 545849. After adding

testRuntime group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.4.1'

to my gradle file, tests are running fine.
Comment 6 Noopur Gupta CLA 2019-04-08 10:10:09 EDT
Marking as a duplicate.

*** This bug has been marked as a duplicate of bug 545849 ***