SourceConnectorFactory { public static JdbcConnector getJdbcConnector(KylinConfig config) { String jdbcUrl = config.getJdbcSourceConnectionUrl(); String jdbcDriver = config.getJdbcSourceDriver(); String jdbcUser = config.getJdbcSourceUser(); String jdbcPass = config.getJdbcSourcePass(); String adaptorClazz = config.getJdbcSourceAdaptor(); AdaptorConfig jdbcConf = new AdaptorConfig(jdbcUrl, jdbcDriver, jdbcUser, jdbcPass); jdbcConf.poolMaxIdle = config.getPoolMaxIdle(null); jdbcConf.poolMinIdle = config.getPoolMinIdle(null); jdbcConf.poolMaxTotal = config.getPoolMaxTotal(null); jdbcConf.datasourceId = config.getJdbcSourceDialect(); if (adaptorClazz == null) adaptorClazz = decideAdaptorClassName(jdbcConf.datasourceId); try { return new JdbcConnector(AdaptorFactory.createJdbcAdaptor(adaptorClazz, jdbcConf)); } catch (Exception e) { throw new RuntimeException("Failed to get JdbcConnector from env.", e); } }  static JdbcConnector getJdbcConnector(KylinConfig config);  }
@Test public void testGetJdbcConnector() { KylinConfig conf1 = getTestConfig(); JdbcConnector conn1 = SourceConnectorFactory.getJdbcConnector(conf1); Assert.assertNotNull(conn1); }