[rfc][icedtea-web] virtual server thread marked as daemon by default
Deepak Bhole
dbhole at redhat.com
Mon Apr 2 13:25:13 PDT 2012
* Jiri Vanek <jvanek at redhat.com> [2012-03-22 08:16]:
> although junit was handling "redundant" threads pretty well, I think it is correct thing to do
>
> Any reason why not?
>
> 2012-03-22 Jiri Vanek <jvanek at redhat.com>
>
> test's virtual server thread marked as daemon by default
"test's" -> "Tests"
After that, OK for 1.2 (if applicable) and HEAD.
Cheers,
Deepak
> * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java:
> All (ServerLauncher) instances returned by methods were marked as daemon
> by default. Possibility to change and api were kept.
> diff -r 89609d0a4e1c tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java
> --- a/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java Mon Mar 19 14:37:03 2012 -0400
> +++ b/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java Thu Mar 22 12:20:47 2012 +0100
> @@ -186,9 +186,12 @@
> * usefull for testing application loading from different url then base
> */
> public static ServerLauncher getIndependentInstance() {
> + return getIndependentInstance(true);
> + }
> + public static ServerLauncher getIndependentInstance(boolean daemon) {
> String dir = (System.getProperty(TEST_SERVER_DIR));
> try{
> - return getIndependentInstance(dir, findFreePort());
> + return getIndependentInstance(dir, findFreePort(),daemon);
> }catch (Exception ex){
> throw new RuntimeException(ex);
> }
> @@ -200,9 +203,13 @@
> * @return new not cached iserver instance on random port,
> * usefull for testing application loading from different url then base
> */
> +
> public static ServerLauncher getIndependentInstance(int port) {
> + return getIndependentInstance(port, true);
> + }
> + public static ServerLauncher getIndependentInstance(int port,boolean daemon) {
> String dir = (System.getProperty(TEST_SERVER_DIR));
> - return getIndependentInstance(dir,port);
> + return getIndependentInstance(dir,port,daemon);
> }
>
> /**
> @@ -210,7 +217,11 @@
> * @return new not cached iserver instance on random port upon custom www root directory,
> * usefull for testing application loading from different url then base
> */
> +
> public static ServerLauncher getIndependentInstance(String dir, int port) {
> + return getIndependentInstance(dir, port, true);
> + }
> + public static ServerLauncher getIndependentInstance(String dir, int port,boolean daemon) {
>
>
> if (dir == null || dir.trim().length() == 0 || !new File(dir).exists() || !new File(dir).isDirectory()) {
> @@ -218,7 +229,9 @@
> }
> try {
> ServerLauncher lServerLuncher = new ServerLauncher(port, new File(dir));
> - new Thread(lServerLuncher).start();
> + Thread r=new Thread(lServerLuncher);
> + r.setDaemon(daemon);
> + r.start();
> return lServerLuncher;
> } catch (Exception ex) {
> throw new RuntimeException(ex);
More information about the distro-pkg-dev
mailing list