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
Try to run a test that reads a properties file from classpath
Fail
Additional Informations
A break point in the test reveals that the classpath starts with bin/main and does not contain the Gradle build dirs. I see the compiled classes at bin/main but no resources like properties files etc from src/main/resources. What is this bin/main? Gradle puts classes in build/classes/main and resources in build/resources/main, so where did the bin directory come from? If I delete it, it is re-created, so I suspect the VSCode Java extensions are doing that.
yes, it's an issue with vscode-java extension, the debugger is reusing the same build output from vscode-java extension. Looks like it doesn't copy the resources to the output directory. redhat-developer/vscode-java#634 is a little old, we need to create a new issue on redhat-developer/vscode-java for that. It would be nice to have a minimum sample project.
In addition to above problem about the classpath, the order of classpath is also very strange. why bin/test is behind of bin/main? we should put bin/test int the front for correctly loading test config files, especially for the case there are different config files for running and testing env.
and I wan't know whether there have a way to change the order of classpath.
岂曰无衣 (@lingjiameng) There are some issues for Gradle classpath resolving. But the problem should be fixed if we support delegate testing to gradle directly. Please vote for microsoft/vscode-java-test#1045 if you would like to have it.
Activity
testforstephen commentedon Mar 7, 2022
Dave Syer (@dsyer) thanks for reaching out.
yes, it's an issue with vscode-java extension, the debugger is reusing the same build output from vscode-java extension. Looks like it doesn't copy the resources to the output directory. redhat-developer/vscode-java#634 is a little old, we need to create a new issue on redhat-developer/vscode-java for that. It would be nice to have a minimum sample project.
lingjiameng commentedon Mar 7, 2022
In addition to above problem about the classpath, the order of classpath is also very strange. why
bin/testis behind ofbin/main? we should putbin/testint the front for correctly loading test config files, especially for the case there are different config files for running and testing env.and I wan't know whether there have a way to change the order of classpath.
jdneo commentedon Nov 16, 2022
岂曰无衣 (@lingjiameng) There are some issues for Gradle classpath resolving. But the problem should be fixed if we support delegate testing to gradle directly. Please vote for microsoft/vscode-java-test#1045 if you would like to have it.
jdneo commentedon Aug 5, 2024
The Gradle Test Delegation (both run and debug) has supported now.
To use this feature, you need to install the latest Test Runner for Java and Gradle for Java extension.
To delegate the tests to Gradle, you can set the default testing profile in Testing explorer:


If you do not want to change the default testing profile, you can trigger an one-time execution via:

