How do I start a JNLP application programmatically?
I have a working JNLP application开发者_运维知识库, but would like to add some end-to-end smoke test.
Is it possible given an URL to download, start and programatically manipulate a JNLP application?
You can use the javaws tool (part of the JDK) to start a WebStart app. To programmatically manipulate it, you can use any of a number of testing tools and frameworks that simulate user input.
To start an JNLP application programatically(Linux) you could do something like this:
public static void main(String[] args) throws IOException, InterruptedException {
String[] cmd = {"/usr/java/jdk1.6.0_17_limpo/jre/javaws/javaws", "/opt/exata/projetosNB/InterfaceVisualizador/dist/launch.jnlp"};
Process p = Runtime.getRuntime().exec(cmd);
}
精彩评论