From 32d85c2d21395b5cda18af6bd43f5ae18326e439 Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 19 Feb 2014 19:01:42 +0100 Subject: [PATCH] [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. --- .../test/rest/junit/RestTestSuiteRunner.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java b/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java index cd1456b8d6730..ffd0e157b6a71 100644 --- a/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java +++ b/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java @@ -337,14 +337,14 @@ protected List collectTestCandidates(Description rootDescript } } - 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; }