|
@@ -9,6 +9,7 @@ public class ZenCodeTestLogger extends ScriptingEngineStreamLogger {
|
9
|
9
|
|
10
|
10
|
private static final boolean logDebug = false;
|
11
|
11
|
private final List<String> printlnOutputs = new ArrayList<>();
|
|
12
|
+ private final List<String> errors = new ArrayList<>();
|
12
|
13
|
private boolean isEngineComplete = false;
|
13
|
14
|
|
14
|
15
|
@Override
|
|
@@ -23,6 +24,18 @@ public class ZenCodeTestLogger extends ScriptingEngineStreamLogger {
|
23
|
24
|
this.printlnOutputs.addAll(Arrays.asList(line.split(System.lineSeparator())));
|
24
|
25
|
}
|
25
|
26
|
|
|
27
|
+ @Override
|
|
28
|
+ public void error(String message) {
|
|
29
|
+ errors.add(message);
|
|
30
|
+ super.error(message);
|
|
31
|
+ }
|
|
32
|
+
|
|
33
|
+ @Override
|
|
34
|
+ public void throwingErr(String message, Throwable throwable) {
|
|
35
|
+ errors.add(message);
|
|
36
|
+ super.throwingErr(message, throwable);
|
|
37
|
+ }
|
|
38
|
+
|
26
|
39
|
void setEngineComplete() {
|
27
|
40
|
isEngineComplete = true;
|
28
|
41
|
}
|
|
@@ -40,4 +53,8 @@ public class ZenCodeTestLogger extends ScriptingEngineStreamLogger {
|
40
|
53
|
}
|
41
|
54
|
Assertions.assertEquals(size, printlnOutputs.size());
|
42
|
55
|
}
|
|
56
|
+
|
|
57
|
+ public void assertNoErrors() {
|
|
58
|
+ Assertions.assertEquals(0, errors.size());
|
|
59
|
+ }
|
43
|
60
|
}
|