Search in sources :

Example 6 with TempFile

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");
    }
}
Also used : TempFile(com.facebook.airlift.testing.TempFile) Test(org.testng.annotations.Test)

Aggregations

TempFile (com.facebook.airlift.testing.TempFile)6 Test (org.testng.annotations.Test)5 ConnectorPageSource (com.facebook.presto.spi.ConnectorPageSource)2 SplitContext (com.facebook.presto.spi.SplitContext)2 IOException (java.io.IOException)2 SessionPropertyConfigurationManager (com.facebook.presto.spi.session.SessionPropertyConfigurationManager)1 SystemSessionPropertyConfiguration (com.facebook.presto.spi.session.SessionPropertyConfigurationManager.SystemSessionPropertyConfiguration)1 Path (java.nio.file.Path)1