use of io.trino.connector.MockConnectorPlugin in project trino by trinodb.
the class TestProcedureCall method setUp.
@BeforeClass
public void setUp() {
DistributedQueryRunner queryRunner = getDistributedQueryRunner();
tester = queryRunner.getCoordinator().getProcedureTester();
session = testSessionBuilder().setCatalog(TESTING_CATALOG).setSchema(PROCEDURE_SCHEMA).build();
queryRunner.installPlugin(new MockConnectorPlugin(MockConnectorFactory.builder().withProcedures(new TestingProcedures(tester).getProcedures(PROCEDURE_SCHEMA)).build()));
queryRunner.createCatalog(TESTING_CATALOG, "mock");
}
use of io.trino.connector.MockConnectorPlugin in project trino by trinodb.
the class TestDistributedEngineOnlyQueries method createQueryRunner.
@Override
protected QueryRunner createQueryRunner() throws Exception {
DistributedQueryRunner queryRunner = createMemoryQueryRunner(ImmutableMap.of(), TpchTable.getTables());
queryRunner.getCoordinator().getSessionPropertyManager().addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
try {
queryRunner.installPlugin(new MockConnectorPlugin(MockConnectorFactory.builder().withSessionProperties(TEST_CATALOG_PROPERTIES).build()));
queryRunner.createCatalog(TESTING_CATALOG, "mock");
} catch (RuntimeException e) {
throw closeAllSuppress(e, queryRunner);
}
return queryRunner;
}
use of io.trino.connector.MockConnectorPlugin in project trino by trinodb.
the class TestDistributedFaultTolerantEngineOnlyQueries method createQueryRunner.
@Override
protected QueryRunner createQueryRunner() throws Exception {
ImmutableMap<String, String> exchangeManagerProperties = ImmutableMap.<String, String>builder().put("exchange.base-directory", System.getProperty("java.io.tmpdir") + "/trino-local-file-system-exchange-manager").buildOrThrow();
DistributedQueryRunner queryRunner = MemoryQueryRunner.builder().setExtraProperties(FaultTolerantExecutionConnectorTestHelper.getExtraProperties()).setAdditionalSetup(runner -> {
runner.installPlugin(new FileSystemExchangePlugin());
runner.loadExchangeManager("filesystem", exchangeManagerProperties);
}).setInitialTables(TpchTable.getTables()).build();
queryRunner.getCoordinator().getSessionPropertyManager().addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
try {
queryRunner.installPlugin(new MockConnectorPlugin(MockConnectorFactory.builder().withSessionProperties(TEST_CATALOG_PROPERTIES).build()));
queryRunner.createCatalog(TESTING_CATALOG, "mock");
} catch (RuntimeException e) {
throw closeAllSuppress(e, queryRunner);
}
return queryRunner;
}
Aggregations