diff --git a/cli/pom.xml b/cli/pom.xml index b2bebee05..c02ba1800 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -77,6 +77,11 @@ ${project.version} test + + com.h2database + h2 + test + diff --git a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala index 47e3c1ba0..2a6e1b9fc 100644 --- a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala +++ b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala @@ -45,6 +45,12 @@ class TestCelebornCliCommands extends CelebornFunSuite with MiniClusterFeature { classOf[UserDefinePasswordAuthenticationProviderImpl].getName) .set(CelebornConf.MASTER_HTTP_AUTH_ADMINISTERS, Seq(CELEBORN_ADMINISTER)) .set(CelebornConf.WORKER_HTTP_AUTH_ADMINISTERS, Seq(CELEBORN_ADMINISTER)) + .set(CelebornConf.DYNAMIC_CONFIG_STORE_BACKEND, "DB") + .set( + CelebornConf.DYNAMIC_CONFIG_STORE_DB_HIKARI_JDBC_URL, + "jdbc:h2:mem:test;MODE=MYSQL;INIT=RUNSCRIPT FROM 'classpath:celeborn-0.6.0-h2.sql';DB_CLOSE_DELAY=-1;") + .set(CelebornConf.DYNAMIC_CONFIG_STORE_DB_HIKARI_DRIVER_CLASS_NAME, "org.h2.Driver") + .set(CelebornConf.DYNAMIC_CONFIG_STORE_DB_HIKARI_MAXIMUM_POOL_SIZE, 1) private val BASIC_AUTH_HEADER = HttpAuthSchemes.BASIC + " " + new String( Base64.getEncoder.encode( @@ -143,13 +149,11 @@ class TestCelebornCliCommands extends CelebornFunSuite with MiniClusterFeature { } test("worker --show-dynamic-conf") { - cancel("This test is temporarily disabled since dynamic conf is not enabled in unit tests.") val args = prepareWorkerArgs() :+ "--show-dynamic-conf" - captureOutputAndValidateResponse(args, "") + captureOutputAndValidateResponse(args, "DynamicConfigResponse") } test("worker --upsert-dynamic-conf") { - cancel("This test is temporarily disabled since dynamic conf is not enabled in unit tests.") val args = prepareWorkerArgs() ++ Array( "--upsert-dynamic-conf", "--config-level", @@ -160,7 +164,6 @@ class TestCelebornCliCommands extends CelebornFunSuite with MiniClusterFeature { } test("worker --delete-dynamic-conf") { - cancel("This test is temporarily disabled since dynamic conf is not enabled in unit tests.") val args = prepareWorkerArgs() ++ Array( "--delete-dynamic-conf", "--config-level", @@ -247,13 +250,11 @@ class TestCelebornCliCommands extends CelebornFunSuite with MiniClusterFeature { } test("master --show-dynamic-conf") { - cancel("This test is temporarily disabled since dynamic conf is not enabled in unit tests.") val args = prepareMasterArgs() :+ "--show-dynamic-conf" - captureOutputAndValidateResponse(args, "") + captureOutputAndValidateResponse(args, "DynamicConfigResponse") } test("master --upsert-dynamic-conf") { - cancel("This test is temporarily disabled since dynamic conf is not enabled in unit tests.") val args = prepareMasterArgs() ++ Array( "--upsert-dynamic-conf", "--config-level", @@ -264,7 +265,6 @@ class TestCelebornCliCommands extends CelebornFunSuite with MiniClusterFeature { } test("master --delete-dynamic-conf") { - cancel("This test is temporarily disabled since dynamic conf is not enabled in unit tests.") val args = prepareMasterArgs() ++ Array( "--delete-dynamic-conf", "--config-level", diff --git a/service/pom.xml b/service/pom.xml index bc1c69547..b656f1154 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -196,6 +196,11 @@ log4j-core + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + org.mockito diff --git a/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java b/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java index 77e99e5f5..ede7fc81e 100644 --- a/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java +++ b/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import org.apache.commons.lang3.StringUtils; public class JsonUtils { @@ -30,6 +31,7 @@ public class JsonUtils { static { MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); MAPPER.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); + MAPPER.registerModule(new JavaTimeModule()); } public static String toJson(Object obj) {