From 22c3cdae03b9bebb3b8dce1804b5713277313bfb Mon Sep 17 00:00:00 2001 From: Cheng Fang Date: Tue, 5 Jul 2022 17:46:42 -0400 Subject: [PATCH] Skip ruby-related tests when running with jdk 17 (#249) --- .../org/jberet/testapps/scripting/ScriptingIT.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test-apps/scripting/src/test/java/org/jberet/testapps/scripting/ScriptingIT.java b/test-apps/scripting/src/test/java/org/jberet/testapps/scripting/ScriptingIT.java index ccb0277fa..05cfae5a3 100644 --- a/test-apps/scripting/src/test/java/org/jberet/testapps/scripting/ScriptingIT.java +++ b/test-apps/scripting/src/test/java/org/jberet/testapps/scripting/ScriptingIT.java @@ -19,6 +19,7 @@ import org.jberet.testapps.common.AbstractIT; import org.junit.Assert; +import org.junit.Assume; import org.junit.BeforeClass; import org.junit.Test; @@ -62,11 +63,13 @@ public void batchletGroovySrc() throws Exception { @Test public void batchletRubySrc() throws Exception { + Assume.assumeTrue(getJavaVersionMajor() <= 11); test0("batchletRubySrc"); } @Test public void batchletRubyInline() throws Exception { + Assume.assumeTrue(getJavaVersionMajor() <= 11); test0("batchletRubyInline"); } @@ -119,6 +122,7 @@ public void chunkPython() throws Exception { @Test public void chunkRuby() throws Exception { + Assume.assumeTrue(getJavaVersionMajor() <= 11); test0("chunkRuby"); } @@ -135,4 +139,10 @@ void test0(final String testName) throws Exception { Assert.assertTrue(jobExecution.getExitStatus().equals(testName) || jobExecution.getExitStatus().equals(BatchStatus.COMPLETED.toString())); Assert.assertTrue(stepExecution0.getExitStatus().equals(testName) || stepExecution0.getExitStatus().equals(BatchStatus.COMPLETED.toString())); } + + int getJavaVersionMajor() { + final String versionVal = System.getProperty("java.version"); + final String[] split = versionVal.split("\\."); + return Integer.parseInt(split[0]); + } }