Skip to content
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

Inherited tests not supported #718

Open
GeraldNDA opened this issue Jun 1, 2019 · 7 comments
Open

Inherited tests not supported #718

GeraldNDA opened this issue Jun 1, 2019 · 7 comments
Labels

Comments

@GeraldNDA
Copy link

Codelens appears for the abstract test class even though it cannot be run directly (IntelliJ redirects you to the classes that inherit from the abstract class instead ...)

Codelens does not appear on the classes that inherit from the abstract test class

Sidebar only runs tests in abstract class resulting in InstantiationException because it's abstract.

@GeraldNDA
Copy link
Author

Sample Project (with failing tests under polytests)
JTestBug.zip

@GeraldNDA
Copy link
Author

GeraldNDA commented Jun 2, 2019 via email

@jdneo jdneo added the bug label Jun 17, 2019
@GeraldNDA
Copy link
Author

After thinking about this, the Java Test Runner seems to have access to the class tree because it is able to build the explorer tree. It'd be useful to instead mark up this tree with whether or not this class has tests through the tree (and whether or not it can be run if it's abstract). Not sure if this is possible to translate codewise. If you want, I can look deeper in the code w/ some help

@jdneo
Copy link
Member

jdneo commented Jul 16, 2019

Thank you for the suggestion @GeraldNDA.

Yes, since the Test Runner is an extension of the Java Language Server, it has the knowledge of the classes actually. It would be great if you are willing to help. Any contributions are welcome!

@benzman81
Copy link

Same issue here. A class "B" that inherits tests from class "A" cannot be executed, neither from explorer java projects view, nor from testing view. How are we supposed to run those tests now? Any hint or workaround? In eclipse this wasnt a problem at all.

@benzman81
Copy link

Btw. our test framework is TestNG.

@jdneo
Copy link
Member

jdneo commented Feb 22, 2022

@benzman81 Thanks for reporting.

There will be some problem for TestNG in such cases. JUnit should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants