File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed
Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ Manifest-Version : 1.0
2+ Built-By : janne
3+ Main-Class : org.robotframework.RobotJarRunner
4+
Original file line number Diff line number Diff line change 1+ package org .robotframework ;
2+
3+ import org .robotframework .RunnerFactory ;
4+ import org .robotframework .RobotRunner ;
5+
6+ public class JarRobot {
7+
8+ public static void main (String [] args ) {
9+ int rc = run (args );
10+ System .exit (rc );
11+ }
12+
13+ public static int run (String [] args ) {
14+ RobotRunner runner = new RunnerFactory ().createRunner ();
15+ return runner .run (args );
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ package org .robotframework ;
2+
3+ public interface RobotRunner {
4+
5+ public int run (String [] args );
6+
7+ }
Original file line number Diff line number Diff line change 1+ package org .robotframework ;
2+
3+ import org .python .core .PyObject ;
4+ import org .python .util .PythonInterpreter ;
5+
6+ public class RunnerFactory {
7+
8+ private PyObject runnerClass ;
9+
10+ public RunnerFactory () {
11+ runnerClass = importRunnerClass ();
12+ }
13+
14+ private PyObject importRunnerClass () {
15+ PythonInterpreter interpreter = new PythonInterpreter ();
16+ interpreter .exec ("import robot; from robot.jarrunner import JarRunner" );
17+ return interpreter .get ("JarRunner" );
18+ }
19+
20+ public RobotRunner createRunner () {
21+ PyObject runnerObject = runnerClass .__call__ ();
22+ return (RobotRunner )runnerObject .__tojava__ (RobotRunner .class );
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments