Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vsCode java.test.config vmArgs not working

My project requires the following vmArgs to run :

"vmArgs": "-javaagent:lib/aspectjweaver-1.9.5.jar -javaagent:lib/spring-instrument-5.2.3.RELEASE.jar --module-path lib/javafx-sdk-13.0.2/lib --add-modules=javafx.controls"

Putting this in the launch.json configuration object makes the project run perfectly. For unit tests, the same vmArgs should be put into the settings.json's java.test.config object, which I did as you see below :

{
    "java.test.config": 
    [
        {
            "name": "testConfig",
            "workingDirectory": "${workspaceFolder}",
            "vmArgs": "-javaagent:lib/aspectjweaver-1.9.5.jar -javaagent:lib/spring-instrument-5.2.3.RELEASE.jar --module-path lib/javafx-sdk-13.0.2/lib --add-modules=javafx.controls"
        }
    ],
    "java.test.defaultConfig": "testConfig"
}

This part is not working. My JUnit tests are not being instrumented correctly. What am I doing wrong? The vmArgs line is an exact copy of what I have in launch.json.

like image 901
Martin Avatar asked Feb 19 '20 16:02

Martin


1 Answers

I think it might be caused by the capitalization. Previously, it's vmargs not vmArgs. But the extension has changed to support both in this PR: https://github.com/microsoft/vscode-java-test/pull/1080

Do you still have this issue now?

like image 193
Sheng Chen Avatar answered Nov 15 '22 19:11

Sheng Chen