Fix variable usage in ScriptItemProcessorTests
This commit also adds test dependencies for groovy, javascript, bean shell and jruby script engines.
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
a06f39b76d
commit
6961571406
4
pom.xml
4
pom.xml
@@ -129,6 +129,10 @@
|
||||
<jtds.version>1.3.1</jtds.version>
|
||||
<testcontainers.version>1.20.4</testcontainers.version>
|
||||
<jsonassert.version>1.5.3</jsonassert.version>
|
||||
<groovy-jsr223.version>4.0.23</groovy-jsr223.version>
|
||||
<nashorn.version>15.4</nashorn.version>
|
||||
<beanshell.version>2.0b6</beanshell.version>
|
||||
<jruby.version>9.4.8.0</jruby.version>
|
||||
|
||||
<!-- samples dependencies -->
|
||||
<spring-rabbit.version>${spring-amqp.version}</spring-rabbit.version>
|
||||
|
||||
@@ -529,6 +529,30 @@
|
||||
<version>${angus-mail.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.groovy</groupId>
|
||||
<artifactId>groovy-jsr223</artifactId>
|
||||
<version>${groovy-jsr223.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.nashorn</groupId>
|
||||
<artifactId>nashorn-core</artifactId>
|
||||
<version>${nashorn.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache-extras.beanshell</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
<version>${beanshell.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jruby</groupId>
|
||||
<artifactId>jruby</artifactId>
|
||||
<version>${jruby.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
|
||||
@@ -82,7 +82,7 @@ class ScriptItemProcessorTests {
|
||||
assumeTrue(languageExists("jruby"));
|
||||
|
||||
ScriptItemProcessor<String, Object> 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 @@ class ScriptItemProcessorTests {
|
||||
assumeTrue(languageExists("jruby"));
|
||||
|
||||
ScriptItemProcessor<String, Object> 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");
|
||||
|
||||
Reference in New Issue
Block a user