Replies: 2 comments
-
What do you mean by "would be run"? Would be run by what? For what purpose? To support what exact use case? What do you mean by "static test class"?
Well, you cannot specify a class for a dynamic test. Perhaps what you're looking for is the |
Beta Was this translation helpful? Give feedback.
-
First, thanks for helping!
I mean it's built at compile time and doesn't need runtime informations to be executed. It is, as you said, a standard test class. The term "static" here is by contrast to dynamic tests, which are built at runtime.
My use case is a tck that provides tests as abstract test classes. Implementors then extend these classes to run tests. Currently, however, since many of these extensions are not overriding the abstract class tests, they're empty classes. This system also requires implementors to check at each release whether new tck tests need to be extended, which is tedious. The idea was to provide a test factory that detects which abstract test classes have not been extended by implementors (this part works), and dynamically extend these abstract classes and feed them to the test runner. This way, the implementors wouldn't have to create many empty classes extending my abstract test classes to use the tck. From what I understand, the Launcher API lets me create a new launcher and give it a new test plan. I can see how I could make my own launcher overloading test discovery, but that feels like a big project to me, so I am investigating whether providing tests to the existing launcher could be done using a |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am looking to create new tests at runtime based on existing statically defined test classes that are not run by junit.
From what I understand, I could create DynamicTests the following way:
However, what I'm looking for is to dynamically determine which of my run-of-the-mill static tests classes would be run :
I'm not sure whether the DynamicTest api is the right tool for this, and, if it is not, what my alternatives are.
I tried to look up alternative ways, but common search tools seem to mostly offer answers about how to create simple DynamicTests like the first example I provided.
Beta Was this translation helpful? Give feedback.
All reactions