Replies: 1 comment 8 replies
-
I'm not familiar with more runtime-related mechanisms like package my.tck.package;
public interface MyTck<T extends InterfaceOfRi> {
T createValue();
@Test
void tckTest1() {
...
assertEquals(..., createValue());
...
}
@TestFactory
Stream<DynamicTest> tckTest2() {
...
}
} And then your class MyRiTests implements MyTck<MyRi> {
@Override
public MyRi createValue() {
return new MyRi();
}
} I've not actually put this code through a compiler, so I don't know if it actually works. And if I wasn't clear enough, perhaps the link will get the point across better. I hope this helps! |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have three artifacts:
api
contains some interfaces and aServiceLoader
to load the implementations of the api interfaces.ri
containing a reference implementation of theapi
; includes theservices
files for theServiceLoader
.tck
a test suite (Test Compatibility Kit) that only has dependencies to theapi
.It's easy to run the tests in the
tck
by adding a runtime dependency onri
. But thetck
should be usable by any other implementation as well: I want theri
to load thetck
and run it, not the other way around. Thetck
should be a library of tests that theri
(and any other implementation) includes as a test dependency. The setup required in theri
should be minimal.I didn't find specific instructions in the User Guide, so I tried
TestTemplate
andDynamicTests
, I searched the internet and looked specifically on StackOverflow, but nothing seemed to be just what I want. Other people use TestNG for such things, but I'd prefer to stay with JUnit.Before I try the JUnit Platform Launcher API (which was made for a different use-case), I'd like to ask here. If there is a good way that I just can't see, I'd be willing to add a section to the User Guide.
I'd be thankful for any hint.
Beta Was this translation helpful? Give feedback.
All reactions