-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can run test from a .class file #1196
Comments
The Is there any special reason that needs to run the tests from a dependency jar? |
It is the project that I am on, the instructor packaged his tests in a distributable jar that is a dependency of the project but sources are available for download which I have downloaded, before the download the fernflower decompiler tries to decompile .class, but after download the source code appears as if it was a .java file but vscode keeps the .class extension. IntelliJ does it differently, After downloading sources it copies the source code to a .java file in a temporary location so that debug tools and etc operate the same as if the .java is part of the project. |
Thanks for the information. So if I understand correctly (please correct me if I'm wrong), IntelliJ will download the source for the test cases you mentioned before. And therefore, you are kind of dealing with the source code, and run the test from the source code, is that correct? |
precisely. see screen shot below this is after sources downloaded. The green play buttons starts the test for each individual test case, but the .java test source code comes from compiled jar. I know this is an edge case, tests are typically not distributed in .jar's instead tests are in the test folder part of the project you are working on, I was questioning if I was missing something more than anything. |
Ok, so far the implementation is only register the code lens on I think the behavior of showing the content of the BrokerTest class in VS Code and IntelliJ are very similar. Only the file extension names are different from So the question is whether we need to also apply it to |
Got it, is this a setting that I can change in the interim, to include *.class files also? |
Unfortunately, we haven't expose this setting for now. But this could be a potential way to support this request. |
Hi,
I have a tests.jar package that has the tests included, I did not write the tests, instead the've been downloaded by maven, the pom.xml has them as dependency. I've downloaded the sources as well, however Code Lens does not provide the Run Test| Debug Test above each test case, or the test class.
Here's the video, I have a TestSuite.java that is in the tests folder and it shows the Run Test | Debug Test, but when I navigate to the Broker.class test that is part of the tests.jar, the Code Lens does not show the individual Run Test | Debug Test above each test, like shown here.
https://code.visualstudio.com/docs/java/java-testing#_rundebug-test-cases
video if it in action:
Screen.Recording.2021-05-08.at.8.02.40.PM.mov
Running vsCode 1.56 w/ all extensions latest version.
The text was updated successfully, but these errors were encountered: