Search in sources :

Example 1 with ConnectorFactory

use of io.prestosql.spi.connector.ConnectorFactory in project hetu-core by openlookeng.

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", "test"), new TestingConnectorContext());
}
Also used : ConnectorFactory(io.prestosql.spi.connector.ConnectorFactory) TestingConnectorContext(io.prestosql.testing.TestingConnectorContext) Plugin(io.prestosql.spi.Plugin) Test(org.testng.annotations.Test)

Example 2 with ConnectorFactory

use of io.prestosql.spi.connector.ConnectorFactory in project hetu-core by openlookeng.

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());
}
Also used : ConnectorFactory(io.prestosql.spi.connector.ConnectorFactory) TestingConnectorContext(io.prestosql.testing.TestingConnectorContext) Plugin(io.prestosql.spi.Plugin) Test(org.testng.annotations.Test)

Example 3 with ConnectorFactory

use of io.prestosql.spi.connector.ConnectorFactory in project hetu-core by openlookeng.

the class TestThriftPlugin method testPlugin.

@Test
public void testPlugin() {
    ThriftPlugin plugin = loadPlugin(ThriftPlugin.class);
    ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
    assertInstanceOf(factory, ThriftConnectorFactory.class);
    Map<String, String> config = ImmutableMap.of("presto.thrift.client.addresses", "localhost:7779");
    Connector connector = factory.create("test", config, new TestingConnectorContext());
    assertNotNull(connector);
    assertInstanceOf(connector, ThriftConnector.class);
}
Also used : Connector(io.prestosql.spi.connector.Connector) ConnectorFactory(io.prestosql.spi.connector.ConnectorFactory) TestingConnectorContext(io.prestosql.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 4 with ConnectorFactory

use of io.prestosql.spi.connector.ConnectorFactory in project hetu-core by openlookeng.

the class TestSqlServerPlugin method testCreateConnector.

@Test
public void testCreateConnector() {
    Plugin plugin = new SqlServerPlugin();
    ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
    factory.create("test", ImmutableMap.of("connection-url", "test"), new TestingConnectorContext());
}
Also used : ConnectorFactory(io.prestosql.spi.connector.ConnectorFactory) TestingConnectorContext(io.prestosql.testing.TestingConnectorContext) Plugin(io.prestosql.spi.Plugin) Test(org.testng.annotations.Test)

Example 5 with ConnectorFactory

use of io.prestosql.spi.connector.ConnectorFactory in project hetu-core by openlookeng.

the class TestKafkaPlugin method testSpinup.

@Test
public void testSpinup() {
    KafkaPlugin plugin = new KafkaPlugin();
    ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
    assertInstanceOf(factory, KafkaConnectorFactory.class);
    Connector c = factory.create("test-connector", ImmutableMap.<String, String>builder().put("kafka.table-names", "test").put("kafka.nodes", "localhost:9092").build(), new TestingConnectorContext());
    assertNotNull(c);
}
Also used : Connector(io.prestosql.spi.connector.Connector) ConnectorFactory(io.prestosql.spi.connector.ConnectorFactory) TestingConnectorContext(io.prestosql.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Aggregations

ConnectorFactory (io.prestosql.spi.connector.ConnectorFactory)17 TestingConnectorContext (io.prestosql.testing.TestingConnectorContext)11 Test (org.testng.annotations.Test)11 Plugin (io.prestosql.spi.Plugin)9 Connector (io.prestosql.spi.connector.Connector)4 Type (io.prestosql.spi.type.Type)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 TEST_SESSION (io.prestosql.SessionTestUtils.TEST_SESSION)1 MockConnectorFactory (io.prestosql.connector.MockConnectorFactory)1 DispatchManager (io.prestosql.dispatcher.DispatchManager)1 FAILED (io.prestosql.execution.QueryState.FAILED)1 RUNNING (io.prestosql.execution.QueryState.RUNNING)1 TestingSessionContext (io.prestosql.execution.TestingSessionContext)1 Catalog (io.prestosql.metadata.Catalog)1 MetadataManager (io.prestosql.metadata.MetadataManager)1 BasicQueryInfo (io.prestosql.server.BasicQueryInfo)1 QueryId (io.prestosql.spi.QueryId)1 BlockEncoding (io.prestosql.spi.block.BlockEncoding)1 CatalogName (io.prestosql.spi.connector.CatalogName)1