Search in sources :

Example 1 with PostgresCatalog

use of org.apache.flink.connector.jdbc.catalog.PostgresCatalog in project flink by apache.

the class JdbcCatalogFactoryTest method test.

@Test
public void test() {
    final Map<String, String> options = new HashMap<>();
    options.put(CommonCatalogOptions.CATALOG_TYPE.key(), JdbcCatalogFactoryOptions.IDENTIFIER);
    options.put(JdbcCatalogFactoryOptions.DEFAULT_DATABASE.key(), PostgresCatalog.DEFAULT_DATABASE);
    options.put(JdbcCatalogFactoryOptions.USERNAME.key(), TEST_USERNAME);
    options.put(JdbcCatalogFactoryOptions.PASSWORD.key(), TEST_PWD);
    options.put(JdbcCatalogFactoryOptions.BASE_URL.key(), baseUrl);
    final Catalog actualCatalog = FactoryUtil.createCatalog(TEST_CATALOG_NAME, options, null, Thread.currentThread().getContextClassLoader());
    checkEquals(catalog, (JdbcCatalog) actualCatalog);
    assertTrue(((JdbcCatalog) actualCatalog).getInternal() instanceof PostgresCatalog);
}
Also used : JdbcCatalog(org.apache.flink.connector.jdbc.catalog.JdbcCatalog) HashMap(java.util.HashMap) PostgresCatalog(org.apache.flink.connector.jdbc.catalog.PostgresCatalog) JdbcCatalog(org.apache.flink.connector.jdbc.catalog.JdbcCatalog) PostgresCatalog(org.apache.flink.connector.jdbc.catalog.PostgresCatalog) Catalog(org.apache.flink.table.catalog.Catalog) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 JdbcCatalog (org.apache.flink.connector.jdbc.catalog.JdbcCatalog)1 PostgresCatalog (org.apache.flink.connector.jdbc.catalog.PostgresCatalog)1 Catalog (org.apache.flink.table.catalog.Catalog)1 Test (org.junit.Test)1