diff options
author | Jiri Vanek <[email protected]> | 2012-08-21 12:04:56 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2012-08-21 12:04:56 +0200 |
commit | 6ead90888d506890da6f1d5f1c859e779965e26a (patch) | |
tree | 2a941a3277fa97b0e5cad73d252c3aa443fcb44c | |
parent | 18bebd772de39672715f4d7bfbead8d002ba26da (diff) |
destroyProcess in ProcessAssassin is now calling sigInt instead of unwrapped sigTerm
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java | 34 |
2 files changed, 34 insertions, 8 deletions
@@ -1,5 +1,13 @@ 2012-08-21 Jiri Vanek <[email protected]> + * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: + (sigInt), (sigKill), (sigTerm) new methods for various killing of + processes by kill. + (kill) new method, launching kill process. + (destroyProcess ) is now calling sigInt instead of unwrapped sigTerm. + +2012-08-21 Jiri Vanek <[email protected]> + * launcher/javaws.in: java is now launched by exec 2012-08-19 Thomas Meyer <[email protected]> diff --git a/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java b/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java index 4bb5187..b435eeb 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java @@ -166,18 +166,36 @@ class ProcessAssasin extends Thread { Field f = p.getClass().getDeclaredField("pid"); f.setAccessible(true); String pid = (f.get(p)).toString(); - List<String> ll=new ArrayList<String>(4); - ll.add("kill"); - ll.add("-s"); - ll.add("SIGTERM"); - ll.add(pid); - ServerAccess.executeProcess(ll);//sync, but acctually release - //before affected application close - Thread.sleep(1000); + sigInt(pid); + //sigTerm(pid); + //sigKill(pid); } catch (Exception ex) { ServerAccess.logException(ex); } finally { p.destroy(); } } + + public static void sigInt(String pid) throws Exception { + kill(pid, "SIGINT"); + } + + public static void sigKill(String pid) throws Exception { + kill(pid, "SIGKILL"); + } + + public static void sigTerm(String pid) throws Exception { + kill(pid, "SIGTERM"); + } + + public static void kill(String pid,String signal) throws InterruptedException, Exception { + List<String> ll = new ArrayList<String>(4); + ll.add("kill"); + ll.add("-s"); + ll.add(signal); + ll.add(pid); + ServerAccess.executeProcess(ll); //sync, but acctually release + //before affected application close + Thread.sleep(1000); + } } |