use of com.facebook.presto.spi.PrestoWarning in project presto by prestodb.
the class TestDefaultWarningCollector method testWarningAsErrorNoExceptionWhenAddingParserWarning.
@Test
public void testWarningAsErrorNoExceptionWhenAddingParserWarning() {
WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig(), WarningHandlingLevel.AS_ERROR);
warningCollector.add(new PrestoWarning(StandardWarningCode.PARSER_WARNING, "1"));
assertEquals(warningCollector.getWarnings().size(), 1);
}
use of com.facebook.presto.spi.PrestoWarning in project presto by prestodb.
the class TestCompletedEventWarnings method testCompletedEventWarnings.
@Test
public void testCompletedEventWarnings() throws InterruptedException {
TestingWarningCollectorConfig warningCollectorConfig = new TestingWarningCollectorConfig().setPreloadedWarnings(TEST_WARNINGS);
TestingWarningCollector testingWarningCollector = new TestingWarningCollector(new WarningCollectorConfig(), warningCollectorConfig);
assertWarnings("select 1", ImmutableMap.of(), testingWarningCollector.getWarnings().stream().map(PrestoWarning::getWarningCode).collect(toImmutableList()));
}
Aggregations