Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
caican committed Oct 10, 2024
1 parent 169802b commit 707352f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions catalogs/catalog-lakehouse-paimon/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ dependencies {
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.mysql.driver)
testImplementation(libs.postgresql.driver)
testImplementation(libs.h2db)
testImplementation(libs.bundles.log4j)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.paimon.s3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.paimon.catalog.Catalog;
import org.apache.paimon.catalog.FileSystemCatalog;
import org.apache.paimon.factories.FactoryException;
import org.apache.paimon.jdbc.JdbcCatalog;
import org.junit.jupiter.api.Test;

/** Tests for {@link org.apache.gravitino.catalog.lakehouse.paimon.utils.CatalogUtils}. */
Expand All @@ -41,6 +42,8 @@ public class TestCatalogUtils {
void testLoadCatalogBackend() throws Exception {
// Test load FileSystemCatalog for filesystem metastore.
assertCatalog(PaimonCatalogBackend.FILESYSTEM.name(), FileSystemCatalog.class);
// Test load JdbcCatalog for jdbc metastore.
assertCatalog(PaimonCatalogBackend.JDBC.name(), JdbcCatalog.class);
// Test load catalog exception for other metastore.
assertThrowsExactly(FactoryException.class, () -> assertCatalog("other", catalog -> {}));
}
Expand All @@ -63,7 +66,11 @@ private void assertCatalog(String metastore, Consumer<Catalog> consumer) throws
System.getProperty("java.io.tmpdir"),
"paimon_catalog_warehouse"),
PaimonConfig.CATALOG_URI.getKey(),
"uri")))
"jdbc:h2:mem:testdb",
PaimonConfig.CATALOG_JDBC_USER.getKey(),
"user",
PaimonConfig.CATALOG_JDBC_PASSWORD.getKey(),
"password")))
.getCatalog()) {
consumer.accept(catalog);
}
Expand Down

0 comments on commit 707352f

Please sign in to comment.