diff --git a/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SpecBaseIntegrationTestCase.java b/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SpecBaseIntegrationTestCase.java index 6aafa4ddb0b..3b8ff080c23 100644 --- a/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SpecBaseIntegrationTestCase.java +++ b/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SpecBaseIntegrationTestCase.java @@ -147,8 +147,7 @@ public abstract class SpecBaseIntegrationTestCase extends JdbcIntegrationTestCas testName = Strings.capitalize(line); testNames.put(testName, Integer.valueOf(lineNumber)); } - } - else { + } else { Object result = parser.parse(line); // only if the parser is ready, add the object - otherwise keep on serving it lines if (result != null) { @@ -156,10 +155,12 @@ public abstract class SpecBaseIntegrationTestCase extends JdbcIntegrationTestCas testName = null; } } - // NOCOMMIT be more careful on the last line } lineNumber++; } + if (testName != null) { + throw new IllegalStateException("Read a test without a body at the end of [" + fileName + "]."); + } } assertNull("Cannot find spec for test " + testName, testName); @@ -174,4 +175,4 @@ public abstract class SpecBaseIntegrationTestCase extends JdbcIntegrationTestCas public static InputStream readFromJarUrl(URL source) throws IOException { return source.openStream(); } -} \ No newline at end of file +}