blob: 7c2434ea13e7c1139222deaf5cfad8071bb85f19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package org.apache.tuscany.container.script.mock;
import org.apache.bsf.BSFException;
import org.apache.bsf.util.BSFEngineImpl;
public class MockBSFEngine extends BSFEngineImpl {
public Object call(Object object, String name, Object[] args) throws BSFException {
if ("bang".equals(name)) {
throw new RuntimeException(name);
}
String resp = name + ":";
if (args != null) {
for (Object o : args) {
resp += " " + String.valueOf(o);
}
}
return resp;
}
public Object eval(String source, int lineNo, int columnNo, Object expr) throws BSFException {
// not used for the mock tests
return null;
}
}
|