From d52091cd4c49ec9aed765a86f3921c1a8422274d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:16:52 -0800 Subject: [PATCH] Add java 8 support in compile and test (#304) (#305) * add java 8 support in compile and test Signed-off-by: Zhongnan Su (cherry picked from commit e753b07eda0b24e2c53716591004d5b06ac854ad) Co-authored-by: Zhongnan Su --- .../workflows/reports-scheduler-test-and-build-workflow.yml | 1 + .../opensearch/reportsscheduler/settings/PluginSettings.kt | 6 +++--- .../kotlin/org/opensearch/integTest/PluginRestTestCase.kt | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml index f6f7bd04..20181d6d 100644 --- a/.github/workflows/reports-scheduler-test-and-build-workflow.yml +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -10,6 +10,7 @@ jobs: strategy: matrix: java: + - 8 - 11 - 14 runs-on: ubuntu-latest diff --git a/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt b/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt index 05e97f22..801da700 100644 --- a/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt +++ b/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt @@ -15,7 +15,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.reportsscheduler.ReportsSchedulerPlugin.Companion.LOG_PREFIX import org.opensearch.reportsscheduler.ReportsSchedulerPlugin.Companion.PLUGIN_NAME import java.io.IOException -import java.nio.file.Path +import java.nio.file.Paths /** * settings specific to reports scheduler Plugin. @@ -93,9 +93,9 @@ internal object PluginSettings { init { var settings: Settings? = null - val configDirName = BootstrapInfo.getSystemProperties()?.get("es.path.conf")?.toString() + val configDirName = BootstrapInfo.getSystemProperties()?.get("opensearch.path.conf")?.toString() if (configDirName != null) { - val defaultSettingYmlFile = Path.of(configDirName, PLUGIN_NAME, "reports-scheduler.yml") + val defaultSettingYmlFile = Paths.get(configDirName, PLUGIN_NAME, "reports-scheduler.yml") try { settings = Settings.builder().loadFromPath(defaultSettingYmlFile).build() } catch (exception: IOException) { diff --git a/reports-scheduler/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt b/reports-scheduler/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt index a8f00060..d5303d39 100644 --- a/reports-scheduler/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt +++ b/reports-scheduler/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt @@ -39,7 +39,7 @@ import java.io.IOException import java.io.InputStreamReader import java.nio.charset.StandardCharsets import java.nio.file.Files -import java.nio.file.Path +import java.nio.file.Paths import java.security.cert.X509Certificate import javax.management.MBeanServerInvocationHandler import javax.management.ObjectName @@ -265,7 +265,7 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() { false ) proxy.getExecutionData(false)?.let { - val path = Path.of("$jacocoBuildPath/integTest.exec") + val path = Paths.get("$jacocoBuildPath/integTest.exec") Files.write(path, it) } }