Our toolkit has over 15,000 JUnit tests, and many tests are known to fail if any other test fails. For example, if the X.foo () method uses the functionality from Y.bar () and YTest.testBar (), then XTest.testFoo () will not work. Obviously, XTest.testFoo () may also fail due to problems specific to X.foo ().
While this is normal, and I still want both tests to run, it would be nice if you could annotate the test's dependency on XTest.testFoo (), pointing to YTest.testBar (). Thus, you can immediately see which functionality used by X.foo () also fails and what does not.
Is there such an annotation in JUnit or elsewhere? Something like:
public XTest { @Test @DependsOn(method=org.example.tests.YTest#testBar) public void testFoo() {
java unit-testing junit
Egon Willighagen Apr 6 2018-10-06T00: 00Z
source share