Skip to content

Instantly share code, notes, and snippets.

@kirillzh
Created September 10, 2014 19:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirillzh/7b587f3b0795987c60bf to your computer and use it in GitHub Desktop.
Save kirillzh/7b587f3b0795987c60bf to your computer and use it in GitHub Desktop.
RF Java
# This file is located in "robot" folder
*** Settings ***
Documentation CommonResource file with KWs
Library OperatingSystem
*** Variables ***
${SRC_PATH} ../../src/
*** Keywords ***
Compile Class
[Arguments] ${class_name} ${path}=${SRC_PATH}
Run javac ${path}${class_name}.java
Run Java Class
[Arguments] ${class_name} ${path}=${SRC_PATH}
Compile Class ${path} ${class_name}
${output}= Run java -cp ${path} ${class_name}
Log ${output} WARN
/**
* This file is located in "src" folder
*/
public class Test {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
# This file is located in "robot/Tests" folder
*** Settings ***
Documentation Running Java class with RF
Resource ../CommonResource.robot
*** Testcases ***
TestOne
Run Java Class Test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment