use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestMongoPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
MongoPlugin plugin = new MongoPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
Connector connector = factory.create("test", ImmutableMap.of("mongodb.connection-url", connectionString), new TestingConnectorContext());
Type type = getOnlyElement(plugin.getTypes());
assertEquals(type, OBJECT_ID);
connector.shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestRaptorPlugin method testPlugin.
@Test
public void testPlugin() throws Exception {
Plugin plugin = new RaptorPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
assertInstanceOf(factory, RaptorConnectorFactory.class);
File tmpDir = Files.createTempDir();
try {
Map<String, String> config = ImmutableMap.<String, String>builder().put("metadata.db.type", "h2").put("metadata.db.filename", tmpDir.getAbsolutePath()).put("storage.data-directory", tmpDir.getAbsolutePath()).buildOrThrow();
factory.create("test", config, new TestingConnectorContext()).shutdown();
} finally {
deleteRecursively(tmpDir.toPath(), ALLOW_INSECURE);
}
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestSingleStorePlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new SingleStorePlugin();
ConnectorFactory factory = stream(plugin.getConnectorFactories()).filter(connectorFactory -> connectorFactory.getName().equals("singlestore")).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 TestIcebergConnectorFactory method createConnector.
private static void createConnector(Map<String, String> config) {
ConnectorFactory factory = new IcebergConnectorFactory();
factory.create("test", config, new TestingConnectorContext());
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestIcebergPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
ConnectorFactory factory = getConnectorFactory();
// simplest possible configuration
factory.create("test", Map.of("hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext()).shutdown();
}
Aggregations