From f4ef26fdf97cb703b182c9743c0a7306d489e4b5 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 13 Dec 2011 16:35:47 +0100 Subject: [PATCH] provide a message with explanation why the suite was not run (IDEA-78806) --- .../junit_rt/src/com/intellij/junit3/TestRunnerUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/junit_rt/src/com/intellij/junit3/TestRunnerUtil.java b/plugins/junit_rt/src/com/intellij/junit3/TestRunnerUtil.java index a6713e299ebd..db09301dbab4 100644 --- a/plugins/junit_rt/src/com/intellij/junit3/TestRunnerUtil.java +++ b/plugins/junit_rt/src/com/intellij/junit3/TestRunnerUtil.java @@ -117,7 +117,12 @@ public class TestRunnerUtil { } try { //noinspection SSBasedInspection - test = (Test)suiteMethod.invoke(null, new Class[0]); // static method + test = (Test)suiteMethod.invoke(null, new Class[0]); // static method + if (test == null) { + return new FailedTestCase(testClass, BaseTestRunner.SUITE_METHODNAME, + MessageFormat.format(ourBundle.getString("junit.failed.to.invoke.suite"), new Object[]{"method " + suiteClassName + ".suite() evaluates to null"}), + null); + } test = new SuiteMethodWrapper(test, suiteClassName); } catch (final InvocationTargetException e) {