Search in sources :

Example 1 with TestingEventListenerPlugin

use of io.prestosql.execution.TestEventListenerPlugin.TestingEventListenerPlugin in project hetu-core by openlookeng.

the class TestCompletedEventWarnings method setUp.

@BeforeMethod
public void setUp() throws Exception {
    SessionBuilder sessionBuilder = testSessionBuilder();
    generatedEvents = new EventsBuilder();
    queryRunner = DistributedQueryRunner.builder(sessionBuilder.build()).setExtraProperties(ImmutableMap.of("testing-warning-collector.preloaded-warnings", String.valueOf(TEST_WARNINGS))).setNodeCount(1).build();
    queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
    generatedEvents.initialize(EXPECTED_EVENTS);
}
Also used : EventsBuilder(io.prestosql.execution.TestEventListener.EventsBuilder) TestingEventListenerPlugin(io.prestosql.execution.TestEventListenerPlugin.TestingEventListenerPlugin) SessionBuilder(io.prestosql.Session.SessionBuilder) TestingSession.testSessionBuilder(io.prestosql.testing.TestingSession.testSessionBuilder) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with TestingEventListenerPlugin

use of io.prestosql.execution.TestEventListenerPlugin.TestingEventListenerPlugin in project hetu-core by openlookeng.

the class TestEventListener method setUp.

@BeforeClass
private void setUp() throws Exception {
    session = testSessionBuilder().setSystemProperty("task_concurrency", "1").setCatalog("tpch").setSchema("tiny").setClientInfo("{\"clientVersion\":\"testVersion\"}").build();
    queryRunner = new DistributedQueryRunner(session, 1);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
    queryRunner.installPlugin(new ResourceGroupManagerPlugin());
    queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of("tpch.splits-per-node", Integer.toString(SPLITS_PER_NODE)));
    queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
}
Also used : TestingEventListenerPlugin(io.prestosql.execution.TestEventListenerPlugin.TestingEventListenerPlugin) DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) ResourceGroupManagerPlugin(io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TestingEventListenerPlugin (io.prestosql.execution.TestEventListenerPlugin.TestingEventListenerPlugin)2 SessionBuilder (io.prestosql.Session.SessionBuilder)1 EventsBuilder (io.prestosql.execution.TestEventListener.EventsBuilder)1 ResourceGroupManagerPlugin (io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin)1 TpchPlugin (io.prestosql.plugin.tpch.TpchPlugin)1 TestingSession.testSessionBuilder (io.prestosql.testing.TestingSession.testSessionBuilder)1 DistributedQueryRunner (io.prestosql.tests.DistributedQueryRunner)1 BeforeClass (org.testng.annotations.BeforeClass)1 BeforeMethod (org.testng.annotations.BeforeMethod)1