Skip to content

Commit 81cc8d7

Browse files
committed
fix tests
1 parent 553a17b commit 81cc8d7

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

build.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@
187187
<classpath path="${build.dir}" />
188188
<classpath path="${unit.test.jar}" />
189189
</javac>
190+
<copy todir="${build.dir}">
191+
<fileset dir="${test.resources.dir}"/>
192+
</copy>
190193
</target>
191194

192195
<target name="dist-test" depends="dist" description="compile the tests ">

src/main/java/org/funz/script/ParseExpression.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public class ParseExpression {
1717
private final static String PIPE = ">>";
1818
public final static String FILES = "files";
1919

20+
static {
21+
initEngine();
22+
}
23+
2024
/**
2125
* Initializes the engine by populating the list of static methods from the org.funz.util.Parser class. (see funz-core)
2226
*/
@@ -484,9 +488,9 @@ public synchronized static Object eval(String expression, Map<String, Object> pa
484488

485489
if (files != null) {
486490
for (File file : files) {
487-
if (file.isFile()) {
491+
if (file != null && file.isFile()) {
488492
rFiles.add(file);
489-
} else {
493+
} else if (file != null) {
490494
try {
491495
Disk.listRecursiveFiles(file, rFiles);
492496
} catch (Exception e) {
@@ -504,7 +508,7 @@ public synchronized static Object eval(String expression, Map<String, Object> pa
504508
out = exportObject(CallAlgebra(o, ie));
505509
Log.logMessage("ParseExpression", SeverityLevel.INFO, false, " >> " + out);
506510
} catch (Exception e) {
507-
Log.logException(false, new Exception(e.getClass()+": Failed to evaluate expression " + expression + " on files " + rFiles + "\n" + e.getMessage()));
511+
Log.logException(false, new Exception(e.getClass()+": Failed to evaluate expression " + expression + " on files " + rFiles + "\n" + e.getMessage(), e));
508512
}
509513
return out;
510514
}

0 commit comments

Comments
 (0)