[jboss-cvs] JBossAS SVN: r61199 - branches/Branch_4_0/test/src/main/org/jboss/test/util/server.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 7 12:36:52 EST 2007


Author: akostadinov
Date: 2007-03-07 12:36:52 -0500 (Wed, 07 Mar 2007)
New Revision: 61199

Modified:
   branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerController.java
   branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerManager.java
Log:
JBAS-4120 startup timeout and destroy process if timeout

Modified: branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerController.java
===================================================================
--- branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerController.java	2007-03-07 16:11:07 UTC (rev 61198)
+++ branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerController.java	2007-03-07 17:36:52 UTC (rev 61199)
@@ -186,6 +186,12 @@
             return;
          }
       }
+
+      Process process = server.getProcess();
+      System.err.println("Failed to start server \"" + server.getName()
+            + "\" before timeout. Destroying the process.");
+      process.destroy();
+
       throw new IOException("Server failed to start; see logs.");
 
    }
@@ -376,4 +382,4 @@
       }
    }
 
-}
\ No newline at end of file
+}

Modified: branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerManager.java
===================================================================
--- branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerManager.java	2007-03-07 16:11:07 UTC (rev 61198)
+++ branches/Branch_4_0/test/src/main/org/jboss/test/util/server/ServerManager.java	2007-03-07 17:36:52 UTC (rev 61199)
@@ -215,7 +215,8 @@
     */
    public int getShutdownTimeout()
    {
-      return 120;
+      // set this property in env.ANT_OPTS
+      return Integer.parseInt(System.getProperty("jbossas.startup.timeout", "120"));
    }
 
    /** 
@@ -224,7 +225,7 @@
     */
    public int getStartupTimeout()
    {
-      return 120;
+      return Integer.parseInt(System.getProperty("jbossas.startup.timeout", "120"));
    }
 
    /**
@@ -247,4 +248,4 @@
       this.udpGroup = udpGroup;
    }
    
-}
\ No newline at end of file
+}




More information about the jboss-cvs-commits mailing list