@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("sql.path", "a.b, c.d") .build(); SqlEnvironmentConfig expected = new SqlEnvironmentConfig() .setPath("a.b, c.d"); assertFullMapping(properties, expected); }
@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("sql.path", "a.b, c.d") .build(); SqlEnvironmentConfig expected = new SqlEnvironmentConfig() .setPath("a.b, c.d"); assertFullMapping(properties, expected); }
@Test(expectedExceptions = ParsingException.class, expectedExceptionsMessageRegExp = "\\Qline 1:9: mismatched input '.'. Expecting: ',', <EOF>\\E") public void testInvalidPath() { SqlEnvironmentConfig config = new SqlEnvironmentConfig().setPath("too.many.qualifiers"); new SqlPath(config.getPath()).getParsedPath(); } }
@Test(expectedExceptions = ParsingException.class, expectedExceptionsMessageRegExp = "\\Qline 1:9: mismatched input '.'. Expecting: ',', <EOF>\\E") public void testInvalidPath() { SqlEnvironmentConfig config = new SqlEnvironmentConfig().setPath("too.many.qualifiers"); new SqlPath(config.getPath()).getParsedPath(); } }
new AllowAllAccessControl(), new SessionPropertyManager(), new SqlEnvironmentConfig()); Session session = sessionSupplier.createSession(new QueryId("test_query_id"), context);
new AllowAllAccessControl(), new SessionPropertyManager(), new SqlEnvironmentConfig()); Session session = sessionSupplier.createSession(new QueryId("test_query_id"), context);
@Test(expectedExceptions = PrestoException.class) public void testInvalidTimeZone() { HttpServletRequest request = new MockHttpServletRequest( ImmutableListMultimap.<String, String>builder() .put(PRESTO_USER, "testUser") .put(PRESTO_TIME_ZONE, "unknown_timezone") .build(), "testRemote"); HttpRequestSessionContext context = new HttpRequestSessionContext(request); QuerySessionSupplier sessionSupplier = new QuerySessionSupplier( createTestTransactionManager(), new AllowAllAccessControl(), new SessionPropertyManager(), new SqlEnvironmentConfig()); sessionSupplier.createSession(new QueryId("test_query_id"), context); }
@Test(expectedExceptions = PrestoException.class) public void testInvalidTimeZone() { HttpServletRequest request = new MockHttpServletRequest( ImmutableListMultimap.<String, String>builder() .put(PRESTO_USER, "testUser") .put(PRESTO_TIME_ZONE, "unknown_timezone") .build(), "testRemote"); HttpRequestSessionContext context = new HttpRequestSessionContext(request); QuerySessionSupplier sessionSupplier = new QuerySessionSupplier( createTestTransactionManager(), new AllowAllAccessControl(), new SessionPropertyManager(), new SqlEnvironmentConfig()); sessionSupplier.createSession(new QueryId("test_query_id"), context); }