Revision: 3937
Author: janne.t.harkonen
Date: Thu Aug 26 05:53:54 2010
Log: First version of Jave Integration chapter
http://code.google.com/p/robotframework/source/detail?r=3937

Added:
 /trunk/doc/userguide/src/ExtendingRobotFramework/JavaIntegration.txt
Modified:
 /trunk/doc/userguide/src/RobotFrameworkUserGuide.txt

=======================================
--- /dev/null
+++ /trunk/doc/userguide/src/ExtendingRobotFramework/JavaIntegration.txt Thu Aug 26 05:53:54 2010
@@ -0,0 +1,38 @@
+Using Robot Framework from Java
+-------------------------------
+
+Starting from Robot Framework 2.5.2 Robot Framework is also distributed as a +standalone jar file that contains both Jython and Robot Framework. This allows
+`command line execution`__ with only Java installed, but the jar file also
+provides an API for Java usage. The current API documentation is available online__
+
+__ `Starting test execution`_
+__ http://code.google.com/p/robotframework/wiki/JavaIntegration
+
+Running tests via the API
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The simple code below demonstrates how Robot Framework test execution can be
+started from a Java program:
+
+.. sourcecode:: java
+
+    import org.robotframework.RobotFramework;
+
+    public class Test {
+
+        public void runTests() {
+ int rc = RobotFramework.run(new String[] { "--outputdir", "/tmp", "mytests" });
+            if (rc == 0)
+                System.out.println("All tests passed");
+            else if (rc <= 250)
+                System.out.println(rc + " tests failed.");
+            else
+                System.out.println("Error occurred");
+        }
+
+    }
+
+:code:`JarRobot.run` is the same as when Robot Framework `is executed from the command line`__.
+
+
=======================================
--- /trunk/doc/userguide/src/RobotFrameworkUserGuide.txt Mon Jul 12 04:37:19 2010 +++ /trunk/doc/userguide/src/RobotFrameworkUserGuide.txt Thu Aug 26 05:53:54 2010
@@ -73,6 +73,7 @@
 .. include:: ExtendingRobotFramework/RemoteLibrary.txt
 .. include:: ExtendingRobotFramework/ListenerInterface.txt
 .. include:: ExtendingRobotFramework/InternalAPI.txt
+.. include:: ExtendingRobotFramework/JavaIntegration.txt

 Appendices
 ==========

Reply via email to