Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Chenglong Hu
    @sonnyhcl
    image.png
    Johnny Martínez
    @johnnymn
    Hi all! quick question: is there a way to disable the automatic opening of the debug console when running the Java: Run All Tests command?
    Sheng Chen
    @jdneo
    Hi @johnnymn So far there is no way to achieve that. Previously we received a lot of user feedbacks telling that they cannot find the output. So we change to automatically toggle the console when launching the tests
    shaif-dorIT
    @shaif-dorIT
    can someone give me directions?
    i downloaded jars and put them under lib folder inside the project folder
    java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:333)
    Class.java:333
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadTestLoaderClass(RemoteTestRunner.java:381)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:371)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:366)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:310)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:225)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
    Caused by: java.lang.ClassNotFoundException: org.junit.runner.manipulation.Filter
    this is the output sorry for send it in in middle of explaining i'm new here
    Updy-karim
    @karimzey9
    image.png
    Hi vs-code masters,
    I have a quick question regarding JUnit 4 using in Vs code.
    This is the first time using JUnit is vs code. I have following problems when i tried to run a test class.
    am not sure what that measns and how to fix it
    any help, I will highly appreciate
    Sheng Chen
    @jdneo
    @karimzey9 any special characters in your project path?
    Hey all, when I try to use JUnit4 in Vscode I get in certain projects the error "Failed to get workspace folder for the test items". In other projects it just works like expected, and I have no clue why. Searching in GitHub issues didn't really provide an answer for me, so I try it this way
    Jakob Getz
    @jakobgetz
    Actually it just sometimes works and sometimes it doesn't in all of the projects. I am not sure if I open the projects in vscode the wrong way
    Sheng Chen
    @jdneo
    Is it possible to share a sample project?
    Jakob Getz
    @jakobgetz
    sure, I do just open the project via terminal with the code command
    the tests are under src/TestCases.java
    Jakob Getz
    @jakobgetz
    Ah I think I found out what the problem is... I do have the project saved in my iCloud Drive Folder and when I open it from there in vscode the tests are not working. When I save the project in for example the Desktop folder it just works fine. Do you have an Idea why this is happening? I do have the iCloud Drive folder downloaded to my local disk. Also when I open the project from the iCloud Drive folder via eclipse, the tests are also working fine.
    Sheng Chen
    @jdneo
    @jakobgetz not sure if that could be the problem. I tried to save the project to OneDrive folder and run it from there, it works fine. (maybe it's different from iCloud Drive?) As a workaround, you need to run it locally, sorry for that, I'll keep an eye on it.
    Jakob Getz
    @jakobgetz
    Indeed i think icloud drive works a little different than onedrive alt least when its run natively on a mac. Its sadly not just a folder you define which gets watched like in for example oneDrive. Idk Icloud sometimes seems like a blackbox to me.
    Kropie
    @Kropie
    Hey, not sure the best way to start contributing to this project but I’ve taken a crack at fixing issue #1260. I’ve created a pull request for resolving it if anyone wants to take a look.
    Sheng Chen
    @jdneo
    @Kropie Thank you for contribution. I left some comments in microsoft/vscode-java-test#1286, would you like to update it? We recently plan to do a release and I hope this can be included.
    Kropie
    @Kropie
    I will try to update my PR tomorrow morning with your comments, thanks again!
    Kropie
    @Kropie
    @jdneo I think I finally resolved the core issue that was outlined in #1260, but I think that my work on the microsoft/vscode-java-test#1286 pull request revealed another issue (support for TestNG groups).
    AlexMakesSoftware
    @AlexMakesSoftware
    Hello. I'm trying to run the tests of a Java Maven project but can't see how to set that up. I can run my tests using the plugin interface but it's not using maven's configuration - for instance, it's running my system test when I don't want it to. Is there any way to tell it to use Maven?
    tl;dr: Need it to run 'mvn test' rather than whatever it does by default.
    Sheng Chen
    @jdneo

    Hello. I'm trying to run the tests of a Java Maven project but can't see how to set that up. I can run my tests using the plugin interface but it's not using maven's configuration - for instance, it's running my system test when I don't want it to. Is there any way to tell it to use Maven?

    @AlexMakesSoftware I'm not sure if I understand your problem correctly. maybe you can check: https://github.com/microsoft/vscode-java-test/wiki/Run-with-Configuration#tldr, if that's not your case, could you provide more details about your issue? e.g. the repro steps.

    3 replies
    wangkai
    @stevenwang_gitlab

    Hello. I'm trying to debug test a junit test method. VS code prompt :"org.eclipse.jdi.internal.connect.ConnectorImpl$StringArgumentImpl.<init>(Lorg/eclipse/jdi/internal/connect/ConnectorImpl;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V" . Open launch.json.

    But if i click the run test button, it does work fine.

    Sheng Chen
    @jdneo
    @stevenwang_gitlab Please make sure all your Java extensions are latest, see: microsoft/vscode-java-debug#995
    Eirik
    @emyklebost

    Hello. I've created a custom JUnit5 TestEngine that reads test-scenarios from .json files. I would like to run these tests in vscode using the junit-platform-console-standalone.jar without a build tool. I am able to do this manually using PowerShell, e.g.: java -jar junit-standalone.jar -cp engine.jar -f test/my.test.json

    I've added the Extension Pack for Java and the following in settings.json:

    {
        "java.project.referencedLibraries": [
            "engine.jar",
            "junit-standalone.jar"
        ],
    }

    No tests are discovered in the Testing side-bar and nothing happens when clicking Run Tests. Any suggestions?

    11 replies
    Sheng Chen
    @jdneo
    @emyklebost Could you share more screenshot of your VS Code workspace?
    gsiawGH
    @gsiawGH
    Hello, im using vscode-java-test, and it loads most of my units tests fine, but i have two paths for all my tests, <project>/src/test and <project>/src/integration
    and vscode-java-test only seem to load the unit tests in <project>/src/test . is there some setting that i can tweek to load the other path?
    Sheng Chen
    @jdneo
    @gsiawGH This is a known issue. We are tracking it with microsoft/vscode-java-test#464
    Patrick Stürmlinger
    @pstuermlinger
    image.png
    Hi guys, I have a very odd behavior of vscode-java-test: One Test class fails according to the explorer, while I'm able to execute some of its tests alone. One nested class ("findOneById") starts executing, then stops without any message. There's also this red "initialization error". But there's also no further information on this.
    I can test everything successfully by running mvn test.
    When I remove the findOneById nested class, the parent test class still gets the initialization error. Any idea how I can get more details about what's going on?
    Sheng Chen
    @jdneo
    @pstuermlinger Could you please file an issue for this and attach a sample project(if it's possible)?
    Patrick Stürmlinger
    @pstuermlinger
    Fixed it by removing @RunWith(MockitoJUnitRunner.class) annotation.
    Ross Wang
    @AsturaPhoenix
    Hi. I just updated my vscode Java extensions after a while and although I can run tests individually, test discovery does not seem to work in the test explorer. My tests are under src/test/java. There are errors in the extension host logs, but no outward indicators of problems. Any suggestions for next steps?
    9 replies
    tomyt
    @tomyt
    This message was deleted
    5 replies
    tomyt
    @tomyt
    Sorry, I deleted the thread by mistake and don't know how to recovery it. So I created a new one.
    8 replies
    JDR
    @ctjdr
    Hi, first thanks for improving Java support in VS Code constantly. One thing I am missing in the Java Test Explorer is a prominent indicator for the result of the last test run just like a green or red bar somewhere in the IDE as I get it in Eclipse, eg. Especially when I re-run a test I often don't have the test class open, but the test subject class. The only visual indication I get without opening the test class are those small check marks in the test explorer. A failing test may be hidden there, requiring further action to find out if any test failed. Or could this be a matter of the theme one is using and I am missing a prominent color indicator somewhere?
    Sheng Chen
    @jdneo
    image.png
    @ctjdr Will this option help your case?
    JDR
    @ctjdr
    @jdneo This is a good idea and I will definitely make this my default, thanks! I still would appreciate a more eye-catching indicator that awards test-driven development with something like a green bar on success, also. I just like to see switching from red to green literally. Anyway, I appreciate all the work you put into the product and understand that other things might be more important or better fit into the product vision. Btw, would it be possible to hook into the Java test runner with a new extension that acts upon test results?
    Sheng Chen
    @jdneo
    You can also file an issue about the UX requirement. The actual UX is controlled by VS Code actually. But if more and more users ask for the similar things, we can try to ask VS Code team to consider it.
    I'm afraid there is no way to hook into the Java Test Runner now. That at least need test runner to expose a set of APIs for other extensions to consume those test items.
    1 reply
    Donglun He
    @DonglunHe
    Hi All, I bumped into this bug when I try run a test, it hangs at "Run Tests: Resolving launch configuration..." "Source: Debugger for Java" indefinitely and cannot complete the test run whatsoever. What could've been the problem here?