use of com.facebook.airlift.testing.TempFile in project presto by prestodb.
the class PrestoCliTests method shouldExitOnErrorFromFile.
@Test(groups = CLI, timeOut = TIMEOUT)
public void shouldExitOnErrorFromFile() throws IOException, InterruptedException {
try (TempFile file = new TempFile()) {
Files.write("select * from hive.default.nations;\nselect * from hive.default.nation;\n", file.file(), UTF_8);
launchPrestoCliWithServerArgument("--file", file.file().getAbsolutePath());
assertThat(trimLines(presto.readRemainingOutputLines())).isEmpty();
assertThatThrownBy(() -> presto.waitForWithTimeoutAndKill()).hasMessage("Child process exited with non-zero code: 1");
}
}
Aggregations