01: package test;
02:
03: import dalma.test.WorkflowTestProgram;
04:
05: import java.io.File;
06: import java.net.URLDecoder;
07:
08: /**
09: * Tests BSF support.
10: *
11: * @author Kohsuke Kawaguchi
12: */
13: public class BsfTest extends WorkflowTestProgram {
14: public BsfTest(String name) {
15: super (name);
16: }
17:
18: protected void setupEndPoints() throws Exception {
19: String url = getClass().getResource("test.bsh")
20: .toExternalForm();
21: String fileName = url.substring("file:".length());
22: while (fileName.startsWith("/"))
23: fileName = fileName.substring(1);
24: if (File.pathSeparatorChar == ':')
25: fileName = '/' + fileName; // on Unix
26: String file = URLDecoder.decode(fileName, "UTF-8");
27: engine.configureWithBSF(new File(file));
28: }
29:
30: public void test() throws Throwable {
31: assertTrue(engine.getEndPoint("ep-name") != null);
32: }
33: }
|