Open ZhengJun003 opened 5 years ago
Java file's name and class name must be the same, otherwise, maven will skip these cases
So it turns out that this is an Eclipse side bug. It will happen when running a class name which is different from the compilation unit name.
I'll reopen it until we fix it in the upstream.
See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=529722#c1
Hi, I'm having a similar issue. When I try to run tests in my project, I receive the same 'Error: Failed to parse the JUnit launch arguments'. It's for a University project, so I can't use Maven or Gradle, so my project set-up is the 'invisible' type.
What's strange is that I had a similar project of the same layout that I managed to run tests on (Oct 14th), which now no longer works, and gives the same error.
Github link -> here
I have a feeling I'm missing something really stupid, I hope you can help!
Update (3/11/19): Rolling back to Java Test Runner 0.20.0 fixed the issue! It must be something with the new version.
@geist-2501, please download the "junit-platform-console-standalone-1.5.2" jar in your project's lib folder.
@ZhengJun003 Thanks for getting back!
I've downloaded the same junit-platform-console-standalone-1.5.2.jar
, which has got it closer to working, but now I see a different error message upon runnnig a test:
What changed from 0.20.0 to 0.21.0 that means it now requires the standalone
?
@geist-2501 This seems to a VS Code bug. According to: https://github.com/microsoft/vscode-go/issues/2831#issuecomment-544271725
Would you mind to try it in the latest VS Code Insider?
The changes we made from 0.20.0
to 0.21.0
is to use the Eclipse's JUnit runner instead of our own runners. So the jars in the classpath has been changed.
@jdneo Yep, just tried it with the latest insiders version and it worked! Thanks!
It took me a while to find this issue, as I had this problem without using a "secondary class". Downgraded to 20.0 and it works perfectly again.
When will this be fixed in the non-insiders version of VSCode?
@OneBigOwnage VS Code team released 1.40.0
recently. Is this problem still occur in 1.40.0
on your side?
Hi, I'm having a similar issue. When I try to run tests in my project, I receive the same 'Error: Failed to parse the JUnit launch arguments'. It's for a University project, so I can't use Maven or Gradle, so my project set-up is the 'invisible' type.
What's strange is that I had a similar project of the same layout that I managed to run tests on (Oct 14th), which now no longer works, and gives the same error.
Github link -> here
Environment;
* Debugger for Java 0.23.0 * Java Test Runner 0.21.0 * Language Support 0.52.0
How to repro;
1. Open project in VSCode. 2. Open test runner and attempt to run.
I have a feeling I'm missing something really stupid, I hope you can help!
Update (3/11/19): Rolling back to Java Test Runner 0.20.0 fixed the issue! It must be something with the new version.
I had the same exact issue as you. I am working on a university project, too, and had the following error when running JUnit tests: "Error: Failed to parse the JUnit launch arguments." (VS Code v1.40.0, JUnit Test Runner v0.21.0)
So, I tried your suggestion of rolling back the extension, and JUnit tests run perfectly on VS Code v1.40.0 with JUnit Test Runner v0.20.0. Thank you!
@rajkundu Is it working on VS Code 1.40.0 with Test Runner 0.21.0?
@jdneo @rajkundu Using VS Code 1.40.0 and Test Runner 0.21.0 works for me now, as long as I have the Junit Standalone Console .jar in a lib
folder
Ok so here is the solution for those people who cannot run JUnit 5 from the Invisible project(dependency managed in lib
folder):
lib
folderNote: You may still cannot run JUnit 5 test if your class name is not the same as the Java file. This is a bug from the upstream Eclipse side.
@jdneo Thanks that works!
Had the same problem, read this rolled back to v0.20.0 and it worked. I have last version of vscode and class names equal file names. Didn't try having the console jar in a lib folder. I'm using Maven. Don't want to save jars in source control.
@moinessim Have you tried this solution?
Hi @jdneo, I tried the following, but had the same error message. Adding the Junit Standalone Console jar:
Environment:
OS: Windows JDK: 8/12 Java Extensions:
Steps to reproduce:
MyFastTestIT
andTestTemplateI
in the test explorerResult:
Added by @jdneo ❗️Solution for those people who cannot run JUnit 5 from the Invisible project(dependency managed in lib folder)