use of io.trino.spi.Plugin in project trino by trinodb.
the class TestDeltaLakePlugin method testAlluxioMetastore.
/**
* Verify the Alluxio metastore is not supported for Delta. Delta connector extends Hive connector and Hive connector supports Alluxio metastore.
* We explicitly disallow Alluxio metastore use with Delta.
*/
@Test
public void testAlluxioMetastore() {
Plugin plugin = new TestingDeltaLakePlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
assertThatThrownBy(() -> factory.create("test", ImmutableMap.of("hive.metastore", "alluxio"), new TestingConnectorContext())).hasMessageMatching("(?s)Unable to create injector, see the following errors:.*" + "Explicit bindings are required and HiveMetastoreFactory .* is not explicitly bound.*");
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestHivePlugin method testCreateConnectorLegacyName.
@Test
public void testCreateConnectorLegacyName() {
Plugin plugin = new HivePlugin();
ConnectorFactory factory = stream(plugin.getConnectorFactories()).filter(x -> x.getName().equals("hive-hadoop2")).collect(toOptional()).orElseThrow();
// simplest possible configuration
factory.create("test", ImmutableMap.of("hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext()).shutdown();
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestSheetsPlugin method testCreateConnector.
@Test
public void testCreateConnector() throws Exception {
Plugin plugin = new SheetsPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
ImmutableMap.Builder<String, String> propertiesMap = ImmutableMap.<String, String>builder().put("credentials-path", getTestCredentialsPath()).put("metadata-sheet-id", TEST_METADATA_SHEET_ID);
Connector connector = factory.create(GOOGLE_SHEETS, propertiesMap.buildOrThrow(), new TestingConnectorContext());
assertNotNull(connector);
connector.shutdown();
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestMySqlPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new MySqlPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:mysql://test"), new TestingConnectorContext()).shutdown();
assertThatThrownBy(() -> factory.create("test", ImmutableMap.of("connection-url", "test"), new TestingConnectorContext())).hasMessageContaining("Invalid JDBC URL for MySQL connector");
assertThatThrownBy(() -> factory.create("test", ImmutableMap.of("connection-url", "jdbc:mysql://test/abc"), new TestingConnectorContext())).hasMessageContaining("Database (catalog) must not be specified in JDBC URL for MySQL connector");
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestOraclePlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new OraclePlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:oracle:thin//test"), new TestingConnectorContext()).shutdown();
}
Aggregations