Java applications integations
Integrate Lordui with Java to perform GUI tests or create live tutorials.
Now Lordui may be easily integrated with any Java application. Let's take a simple Java application. All you need is to create the project, attach Lordui into classpath and comunicate Lordui class from your code. Here is the simple example:
...
import ktm.lordui.Lordui;
public class LorduiLibraryUsage {
private Lordui lui;
@Before
public void initLordui() {
lui = Lordui.createInstance();
try {
lui.loadProject(new File("myLorduiProcedureFile.lui"));
} catch (IOException e) {
e.printStackTrace();
return;
}
}
@Test
public void useLordui() {
//Here we show execute our application. Like:
try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
JFrame fr = new JFrame("Test window");
fr.setSize(800, 600);
fr.setVisible(true);
}
});
} catch (InvocationTargetException e) {
e.printStackTrace();
return;
} catch (InterruptedException e) {
e.printStackTrace();
return;
}
lui.runProcedureAndWait("LorduiProcedureName");
}
@After
public void closeLordui() {
lui.close();
}
}
This code presents java testing example. However Lordui can be also integrated with any non-testing application (like eg. data migration or tutorial).