use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestPhoenixPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new PhoenixPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("phoenix.connection-url", "jdbc:phoenix:test"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestSingleStorePlugin method testCreateConnectorLegacyName.
@Test
public void testCreateConnectorLegacyName() {
Plugin plugin = new SingleStorePlugin();
ConnectorFactory factory = stream(plugin.getConnectorFactories()).filter(connectorFactory -> connectorFactory.getName().equals("memsql")).collect(toOptional()).orElseThrow();
factory.create("test", ImmutableMap.of("connection-url", "jdbc:singlestore://test"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestPostgreSqlPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new PostgreSqlPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:postgresql:test"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestThriftPlugin method testPlugin.
@Test
public void testPlugin() {
Plugin plugin = new ThriftPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
assertInstanceOf(factory, ThriftConnectorFactory.class);
Map<String, String> config = ImmutableMap.of("trino.thrift.client.addresses", "localhost:7779");
Connector connector = factory.create("test", config, new TestingConnectorContext());
assertNotNull(connector);
assertInstanceOf(connector, ThriftConnector.class);
connector.shutdown();
}
Aggregations