Make it possible to generate getTestsRoot() method with the test directory

Method can be used in setUp()
This commit is contained in:
Nikolay Krasko
2015-11-03 22:08:21 +03:00
committed by Nikolay Krasko
parent 178aba54dd
commit 7be9699263
11 changed files with 136 additions and 111 deletions
@@ -794,6 +794,15 @@ public class KotlinTestUtils {
return testFile;
}
public static String getTestsRoot(@NotNull TestCase testCase) {
try {
return (String) testCase.getClass().getMethod("getTestsRoot").invoke(testCase);
}
catch (Exception e) {
throw new RuntimeException("Can't call getTestsRoot() on test class", e);
}
}
public static void assertAllTestsPresentByMetadata(
@NotNull Class<?> testCaseClass,
@NotNull File testDataDir,