Skip to content

Commit

Permalink
Skip ruby-related tests when running with jdk 17 (jberet#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengfang committed Jul 7, 2022
1 parent 9b7f6ea commit 22c3cda
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
}

Expand Down Expand Up @@ -119,6 +122,7 @@ public void chunkPython() throws Exception {

@Test
public void chunkRuby() throws Exception {
Assume.assumeTrue(getJavaVersionMajor() <= 11);
test0("chunkRuby");
}

Expand All @@ -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]);
}
}

0 comments on commit 22c3cda

Please sign in to comment.