[TEST] Initialization errors are checked before returning "no tests to run" error

If there initialization errors and no tests to execute at the same time, better to return the initialization errors, whose check should be first then, as it might be that the "no tests to execute" is caused by the initialization errors.
This commit is contained in:
javanna 2014-02-19 19:01:42 +01:00 committed by Luca Cavanna
parent 419db6ee12
commit 1a48c5fc21
1 changed files with 4 additions and 4 deletions

View File

@ -337,14 +337,14 @@ public class RestTestSuiteRunner extends ParentRunner<RestTestCandidate> {
}
}
if (rootDescription.getChildren().size() == 0) {
throw new InitializationError("No tests to run");
}
if (!parseExceptions.isEmpty()) {
throw new InitializationError(parseExceptions);
}
if (rootDescription.getChildren().size() == 0) {
throw new InitializationError("No tests to run");
}
return testCandidates;
}