use of com.facebook.presto.spi.WarningCode in project presto by prestodb.
the class TestDefaultWarningCollector method testWarningSuppress.
@Test
public void testWarningSuppress() {
WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig(), WarningHandlingLevel.SUPPRESS);
warningCollector.add(new PrestoWarning(new WarningCode(1, "1"), "warning 1"));
assertEquals(warningCollector.getWarnings().size(), 0);
}
use of com.facebook.presto.spi.WarningCode in project presto by prestodb.
the class TestDefaultWarningCollector method testMaxWarnings.
@Test
public void testMaxWarnings() {
WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig().setMaxWarnings(2), WarningHandlingLevel.NORMAL);
warningCollector.add(new PrestoWarning(new WarningCode(1, "1"), "warning 1"));
warningCollector.add(new PrestoWarning(new WarningCode(2, "2"), "warning 2"));
warningCollector.add(new PrestoWarning(new WarningCode(3, "3"), "warning 3"));
assertEquals(warningCollector.getWarnings().size(), 2);
}
use of com.facebook.presto.spi.WarningCode in project presto by prestodb.
the class TestDefaultWarningCollector method testNoWarnings.
@Test
public void testNoWarnings() {
WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig().setMaxWarnings(0), WarningHandlingLevel.NORMAL);
warningCollector.add(new PrestoWarning(new WarningCode(1, "1"), "warning 1"));
assertEquals(warningCollector.getWarnings().size(), 0);
}
Aggregations