use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testGlueMetastore.
@Test
public void testGlueMetastore() {
ConnectorFactory factory = getHiveConnectorFactory();
factory.create("test", ImmutableMap.of("hive.metastore", "glue", "hive.metastore.glue.region", "us-east-2"), new TestingConnectorContext()).shutdown();
assertThatThrownBy(() -> factory.create("test", ImmutableMap.of("hive.metastore", "glue", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext())).hasMessageContaining("Error: Configuration property 'hive.metastore.uri' was not used");
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testS3SecurityMappingAndHiveCachingMutuallyExclusive.
@Test
public void testS3SecurityMappingAndHiveCachingMutuallyExclusive() throws IOException {
Path mappingConfig = Files.createTempFile(null, null);
ConnectorFactory connectorFactory = getHiveConnectorFactory();
assertThatThrownBy(() -> connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.s3.security-mapping.config-file", mappingConfig.toString()).put("hive.cache.enabled", "true").put("hive.metastore.uri", "thrift://foo:1234").put("hive.cache.location", tempDirectory.toString()).buildOrThrow(), new TestingConnectorContext())).hasMessageContaining("S3 security mapping is not compatible with Hive caching");
}
use of io.trino.testing.TestingConnectorContext 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.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testRubixCache.
@Test
public void testRubixCache() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.cache.enabled", "true").put("hive.metastore.uri", "thrift://foo:1234").put("hive.cache.location", tempDirectory.toString()).buildOrThrow(), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testSystemAccessControl.
@Test
public void testSystemAccessControl() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
Connector connector = connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.metastore.uri", "thrift://foo:1234").put("hive.security", "system").buildOrThrow(), new TestingConnectorContext());
assertThatThrownBy(connector::getAccessControl).isInstanceOf(UnsupportedOperationException.class);
connector.shutdown();
}
Aggregations