From 2c9e4d82858a8e5825aa8451d61dd7ac72db0721 Mon Sep 17 00:00:00 2001 From: yeonnex Date: Fri, 11 Oct 2024 20:17:06 +0900 Subject: [PATCH 1/4] Add groovy script engine dependencies to tests --- spring-batch-infrastructure/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml index ba86d44878..bb898155a4 100644 --- a/spring-batch-infrastructure/pom.xml +++ b/spring-batch-infrastructure/pom.xml @@ -429,6 +429,12 @@ ${angus-mail.version} test + + org.apache.groovy + groovy-jsr223 + 4.0.23 + test + From bdbeafbf0885cd586490535543ceaada17c0f267 Mon Sep 17 00:00:00 2001 From: yeonnex Date: Fri, 11 Oct 2024 20:27:33 +0900 Subject: [PATCH 2/4] Add javascript script engine dependencies to tests --- spring-batch-infrastructure/pom.xml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml index bb898155a4..e5568acdbb 100644 --- a/spring-batch-infrastructure/pom.xml +++ b/spring-batch-infrastructure/pom.xml @@ -429,12 +429,18 @@ ${angus-mail.version} test - - org.apache.groovy - groovy-jsr223 - 4.0.23 - test - + + org.apache.groovy + groovy-jsr223 + 4.0.23 + test + + + org.openjdk.nashorn + nashorn-core + 15.4 + test + From 6d10593c6ed997f55162f60d73eccccb8d99bfa3 Mon Sep 17 00:00:00 2001 From: yeonnex Date: Fri, 11 Oct 2024 20:32:55 +0900 Subject: [PATCH 3/4] Add bash script engine dependencies to tests --- spring-batch-infrastructure/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml index e5568acdbb..ed1297b247 100644 --- a/spring-batch-infrastructure/pom.xml +++ b/spring-batch-infrastructure/pom.xml @@ -441,6 +441,12 @@ 15.4 test + + org.apache-extras.beanshell + bsh + 2.0b6 + test + From 42423260367b802354ef4857b514c58ece19a7a5 Mon Sep 17 00:00:00 2001 From: yeonnex Date: Fri, 11 Oct 2024 20:46:50 +0900 Subject: [PATCH 4/4] Add jruby script engine dependencies to tests - Refactor to use local variables instead of global variables in testJRubyScriptSourceSimple,testJRubyScriptSourceMethod --- spring-batch-infrastructure/pom.xml | 6 ++++++ .../batch/item/support/ScriptItemProcessorTests.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml index ed1297b247..964afc3445 100644 --- a/spring-batch-infrastructure/pom.xml +++ b/spring-batch-infrastructure/pom.xml @@ -447,6 +447,12 @@ 2.0b6 test + + org.jruby + jruby + 9.4.8.0 + test + diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/ScriptItemProcessorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/ScriptItemProcessorTests.java index bdbb6205c4..5370d7b74f 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/ScriptItemProcessorTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/ScriptItemProcessorTests.java @@ -82,7 +82,7 @@ void testJRubyScriptSourceSimple() throws Exception { assumeTrue(languageExists("jruby")); ScriptItemProcessor scriptItemProcessor = new ScriptItemProcessor<>(); - scriptItemProcessor.setScriptSource("$item.upcase", "jruby"); + scriptItemProcessor.setScriptSource("item.upcase", "jruby"); scriptItemProcessor.afterPropertiesSet(); assertEquals("SS", scriptItemProcessor.process("ss"), "Incorrect transformed value"); @@ -93,7 +93,7 @@ void testJRubyScriptSourceMethod() throws Exception { assumeTrue(languageExists("jruby")); ScriptItemProcessor scriptItemProcessor = new ScriptItemProcessor<>(); - scriptItemProcessor.setScriptSource("def process(item) $item.upcase end \n process($item)", "jruby"); + scriptItemProcessor.setScriptSource("def process(item) item.upcase end \n process(item)", "jruby"); scriptItemProcessor.afterPropertiesSet(); assertEquals("SS", scriptItemProcessor.process("ss"), "Incorrect transformed value");