Skip to content

Commit 6961571

Browse files
yeonnexfmbenhassine
authored andcommitted
Fix variable usage in ScriptItemProcessorTests
This commit also adds test dependencies for groovy, javascript, bean shell and jruby script engines.
1 parent a06f39b commit 6961571

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@
129129
<jtds.version>1.3.1</jtds.version>
130130
<testcontainers.version>1.20.4</testcontainers.version>
131131
<jsonassert.version>1.5.3</jsonassert.version>
132+
<groovy-jsr223.version>4.0.23</groovy-jsr223.version>
133+
<nashorn.version>15.4</nashorn.version>
134+
<beanshell.version>2.0b6</beanshell.version>
135+
<jruby.version>9.4.8.0</jruby.version>
132136

133137
<!-- samples dependencies -->
134138
<spring-rabbit.version>${spring-amqp.version}</spring-rabbit.version>

spring-batch-infrastructure/pom.xml

+24
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,30 @@
529529
<version>${angus-mail.version}</version>
530530
<scope>test</scope>
531531
</dependency>
532+
<dependency>
533+
<groupId>org.apache.groovy</groupId>
534+
<artifactId>groovy-jsr223</artifactId>
535+
<version>${groovy-jsr223.version}</version>
536+
<scope>test</scope>
537+
</dependency>
538+
<dependency>
539+
<groupId>org.openjdk.nashorn</groupId>
540+
<artifactId>nashorn-core</artifactId>
541+
<version>${nashorn.version}</version>
542+
<scope>test</scope>
543+
</dependency>
544+
<dependency>
545+
<groupId>org.apache-extras.beanshell</groupId>
546+
<artifactId>bsh</artifactId>
547+
<version>${beanshell.version}</version>
548+
<scope>test</scope>
549+
</dependency>
550+
<dependency>
551+
<groupId>org.jruby</groupId>
552+
<artifactId>jruby</artifactId>
553+
<version>${jruby.version}</version>
554+
<scope>test</scope>
555+
</dependency>
532556

533557
<!-- provided dependencies -->
534558
<dependency>

spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/ScriptItemProcessorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void testJRubyScriptSourceSimple() throws Exception {
8282
assumeTrue(languageExists("jruby"));
8383

8484
ScriptItemProcessor<String, Object> scriptItemProcessor = new ScriptItemProcessor<>();
85-
scriptItemProcessor.setScriptSource("$item.upcase", "jruby");
85+
scriptItemProcessor.setScriptSource("item.upcase", "jruby");
8686
scriptItemProcessor.afterPropertiesSet();
8787

8888
assertEquals("SS", scriptItemProcessor.process("ss"), "Incorrect transformed value");
@@ -93,7 +93,7 @@ void testJRubyScriptSourceMethod() throws Exception {
9393
assumeTrue(languageExists("jruby"));
9494

9595
ScriptItemProcessor<String, Object> scriptItemProcessor = new ScriptItemProcessor<>();
96-
scriptItemProcessor.setScriptSource("def process(item) $item.upcase end \n process($item)", "jruby");
96+
scriptItemProcessor.setScriptSource("def process(item) item.upcase end \n process(item)", "jruby");
9797
scriptItemProcessor.afterPropertiesSet();
9898

9999
assertEquals("SS", scriptItemProcessor.process("ss"), "Incorrect transformed value");

0 commit comments

Comments
 (0)