Search in sources :

Example 1 with ConnectorFactory

use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.

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

Example 2 with ConnectorFactory

use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.

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(com.facebook.presto.spi.connector.ConnectorFactory) TestingConnectorContext(com.facebook.presto.testing.TestingConnectorContext) Plugin(com.facebook.presto.spi.Plugin) Test(org.testng.annotations.Test)

Example 3 with ConnectorFactory

use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.

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(com.facebook.presto.spi.connector.ConnectorFactory) TestingConnectorContext(com.facebook.presto.testing.TestingConnectorContext) Plugin(com.facebook.presto.spi.Plugin) Test(org.testng.annotations.Test)

Example 4 with ConnectorFactory

use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.

the class TestRedshiftPlugin method testCreateConnector.

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

Example 5 with ConnectorFactory

use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.

the class TestRedisPlugin method testStartup.

@Test
public void testStartup() {
    RedisPlugin plugin = new RedisPlugin();
    ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
    assertInstanceOf(factory, RedisConnectorFactory.class);
    Connector c = factory.create("test-connector", ImmutableMap.<String, String>builder().put("redis.table-names", "test").put("redis.nodes", "localhost:6379").build(), new TestingConnectorContext());
    assertNotNull(c);
}
Also used : Connector(com.facebook.presto.spi.connector.Connector) ConnectorFactory(com.facebook.presto.spi.connector.ConnectorFactory) TestingConnectorContext(com.facebook.presto.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Aggregations

ConnectorFactory (com.facebook.presto.spi.connector.ConnectorFactory)20 Test (org.testng.annotations.Test)14 TestingConnectorContext (com.facebook.presto.testing.TestingConnectorContext)12 Plugin (com.facebook.presto.spi.Plugin)8 Connector (com.facebook.presto.spi.connector.Connector)6 Session (com.facebook.presto.Session)3 Type (com.facebook.presto.common.type.Type)2 MetadataManager (com.facebook.presto.metadata.MetadataManager)2 ConnectorId (com.facebook.presto.spi.ConnectorId)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 Logger (com.facebook.airlift.log.Logger)1 NodeInfo (com.facebook.airlift.node.NodeInfo)1 TEST_SESSION (com.facebook.presto.SessionTestUtils.TEST_SESSION)1 IGNORE_STATS_CALCULATOR_FAILURES (com.facebook.presto.SystemSessionProperties.IGNORE_STATS_CALCULATOR_FAILURES)1 BlockEncoding (com.facebook.presto.common.block.BlockEncoding)1 BlockEncodingSerde (com.facebook.presto.common.block.BlockEncodingSerde)1 ParametricType (com.facebook.presto.common.type.ParametricType)1 TypeManager (com.facebook.presto.common.type.TypeManager)1 MockConnectorFactory (com.facebook.presto.connector.MockConnectorFactory)1 InformationSchemaConnector (com.facebook.presto.connector.informationSchema.InformationSchemaConnector)1