File tree Expand file tree Collapse file tree
src/java/org/robotframework Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import org .robotframework .RunnerFactory ;
44import org .robotframework .RobotRunner ;
55
6+ /**
7+ *
8+ * Entry point for using Robot Framework from Java programs.
9+ *
10+ */
11+
612public class JarRobot {
713
8- public static void main (String [] args ) {
14+ public static void main (String [] args ) {
915 int rc = run (args );
1016 System .exit (rc );
1117 }
1218
13- public static int run (String [] args ) {
14- RobotRunner runner = new RunnerFactory ().createRunner ();
19+ /**
20+ * Runs Robot Framework tests.
21+ *
22+ * @param args
23+ * The command line options to Robot Framework, for example
24+ * ['--outputdir', '/tmp', 'mytestdir']. At least one datasource
25+ * must be specified.
26+ */
27+ public static int run (String [] args ) {
28+ RobotRunner runner = new RunnerFactory ().createRunner ();
1529 return runner .run (args );
16- }
30+ }
1731}
Original file line number Diff line number Diff line change 11package org .robotframework ;
22
3+ /**
4+ * An interface class that is used for creating a Jython object capable of
5+ * running Robot Framework.
6+ */
37public interface RobotRunner {
48
59 public int run (String [] args );
Original file line number Diff line number Diff line change 33import org .python .core .PyObject ;
44import org .python .util .PythonInterpreter ;
55
6+ /**
7+ *
8+ * Helper class to create an Jython object and coerce it so that it can be used
9+ * from Java.
10+ *
11+ */
612public class RunnerFactory {
713
814 private PyObject runnerClass ;
@@ -17,6 +23,10 @@ private PyObject importRunnerClass() {
1723 return interpreter .get ("JarRunner" );
1824 }
1925
26+ /**
27+ * Creates and returns an instance of the robot.JarRunner (implemented in
28+ * Python), which can be used to execute tests.
29+ */
2030 public RobotRunner createRunner () {
2131 PyObject runnerObject = runnerClass .__call__ ();
2232 return (RobotRunner ) runnerObject .__tojava__ (RobotRunner .class );
You can’t perform that action at this time.
0 commit comments