Ticket #247 (closed defect: invalid)
Variables are not expanded in addInFile method
| Reported by: | dumoulin | Owned by: | romain.reuillon |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Version: | 0.3 |
| Severity: | major | Keywords: | |
| Cc: | romain.reuillon@… |
Description
Test script:
import org.openmole.plugin.task.groovy.GroovyTask
import org.openmole.core.implementation.data.Parameter
import org.openmole.core.implementation.data.Variable
t = new GroovyTask("test")
t.addParameter(new Parameter(new Variable("filename","run.sh")))
t.addInFile('${filename}')
t.setCode('println new File(filename).text')
builder.buildMoleExecution(t).start()
Excepted result should be that the content of the file "run.sh" is printed out, but I've got this error:
Caused by: java.io.FileNotFoundException: ${filename} (No such file or directory)
at java.io.FileInputStream.open(Native Method) ~[na:1.6.0_16]
at java.io.FileInputStream.<init>(FileInputStream.java:106) ~[na:1.6.0_16]
at org.openmole.commons.tools.io.FileUtil.copyFile(FileUtil.java:146) ~[na:na]
at org.openmole.commons.tools.io.FileUtil.copy(FileUtil.java:139) ~[na:na]
at org.openmole.plugin.task.external.ExternalSystemTask$$anonfun$prepareInputFiles$1.apply(ExternalSystemTask.scala:41) ~[na:na]
at org.openmole.plugin.task.external.ExternalSystemTask$$anonfun$prepareInputFiles$1.apply(ExternalSystemTask.scala:38) ~[na:na]
at scala.collection.Iterator$class.foreach(Iterator.scala:631) ~[na:na]
at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:474) ~[na:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:79) ~[na:na]
at scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:521) ~[na:na]
at org.openmole.plugin.task.external.ExternalSystemTask.prepareInputFiles(ExternalSystemTask.scala:38) ~[na:na]
at org.openmole.plugin.task.code.CodeTask.process(CodeTask.java:55) ~[na:na]
Change History
Note: See
TracTickets for help on using
tickets.





