[jboss-cvs] JBossAS SVN: r108927 - in branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts: test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 27 04:03:02 EDT 2010


Author: rsvoboda at redhat.com
Date: 2010-10-27 04:03:00 -0400 (Wed, 27 Oct 2010)
New Revision: 108927

Modified:
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/README.txt
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/RunTestCase.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java
Log:
JBQA-3309 JBQA-3753  configurable timeouts for server startup and shutdown in scripts tests 


Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/README.txt
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/README.txt	2010-10-26 20:58:25 UTC (rev 108926)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/README.txt	2010-10-27 08:03:00 UTC (rev 108927)
@@ -21,6 +21,9 @@
 - run.sh is used to start the servers
 - JMX shutdown or shutdown.sh is used to stop the servers, depending on
 the test case in question
+- You can increase timeout for server startup and shutdown with these parameters
+ -Djbosstest.jbossas.startup.timeout=300 -Djbosstest.jbossas.shutdown.timeout=45
+ applies for RunTestCase and ShutdownTestCase
 
 3. The commands and servers are executed using a small framework based
 on the classes AbstractShellScriptExecutor, ShellScriptExecutor and

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/RunTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/RunTestCase.java	2010-10-26 20:58:25 UTC (rev 108926)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/RunTestCase.java	2010-10-27 08:03:00 UTC (rev 108927)
@@ -24,17 +24,10 @@
 
 import java.io.File ;
 import java.io.IOException ;
-import java.lang.InterruptedException ;
-import java.net.URL ;
-import java.net.MalformedURLException ;
 import javax.management.ObjectName ;
 import javax.management.MalformedObjectNameException ;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
-import org.jboss.test.JBossTestSetup ;
 
 /**
  * Unit tests of run.sh and run.bat.
@@ -64,9 +57,11 @@
 public class RunTestCase extends ScriptsTestBase
 {
 	private ObjectName SERVER_OBJ_NAME = null ;
-	private int START_TIMEOUT = 120 ;
-	private int STOP_TIMEOUT = 120 ;
-		
+        public static final String SYSTEM_PROPERTY_JBOSSAS_STARTUP_TIMEOUT  = "jbosstest.jbossas.startup.timeout";
+        public static final String SYSTEM_PROPERTY_JBOSSAS_SHUTDOWN_TIMEOUT = "jbosstest.jbossas.shutdown.timeout";
+        private static final int STOP_TIMEOUT = Integer.parseInt(System.getProperty(SYSTEM_PROPERTY_JBOSSAS_SHUTDOWN_TIMEOUT, "30"));
+        private static final int START_TIMEOUT = Integer.parseInt(System.getProperty(SYSTEM_PROPERTY_JBOSSAS_STARTUP_TIMEOUT, "120"));
+
    /**
     * Create a new RunTestCase.
     * 
@@ -75,7 +70,7 @@
    public RunTestCase(String name)
    {
       super(name);     
-      
+
       // init the server ON
       try {
     	  SERVER_OBJ_NAME = new ObjectName("jboss.system:type=Server") ;
@@ -159,13 +154,13 @@
 	   // waitForServerStart kills the process and throws an exception if server does not start 
 	   try {
 		   ScriptsTestBase.waitForServerStart(getAsyncShellScriptExecutor(), getServerHost(), START_TIMEOUT) ;
-		   System.out.println("Server started successfully") ;
+		   System.out.println("Server started successfully, START_TIMEOUT is " + START_TIMEOUT) ;
 	   }
 	   catch(IOException e) {
 		   System.out.println("IOException: message = " + e.getMessage()) ;
 		   writeLogsToTestCase() ;
 		   
-		   fail("Server failed to start") ;
+		   fail("Server failed to start in " + START_TIMEOUT + "seconds") ;
 	   }
 	   
 	   // check assertions on the console output generated by the run command

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java	2010-10-26 20:58:25 UTC (rev 108926)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java	2010-10-27 08:03:00 UTC (rev 108927)
@@ -24,17 +24,10 @@
 
 import java.io.File ;
 import java.io.IOException ;
-import java.lang.InterruptedException ;
-import java.net.URL ;
-import java.net.MalformedURLException ;
 import javax.management.ObjectName ;
 import javax.management.MalformedObjectNameException ;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
-import org.jboss.test.JBossTestSetup ;
 
 /**
  * Unit tests of shutdown.sh and shutdown.bat.
@@ -59,8 +52,10 @@
 public class ShutdownTestCase extends ScriptsTestBase
 {
 	private ObjectName SERVER_OBJ_NAME = null ;
-	private int START_TIMEOUT = 120 ;
-	private int STOP_TIMEOUT = 120 ;
+        public static final String SYSTEM_PROPERTY_JBOSSAS_STARTUP_TIMEOUT  = "jbosstest.jbossas.startup.timeout";
+        public static final String SYSTEM_PROPERTY_JBOSSAS_SHUTDOWN_TIMEOUT = "jbosstest.jbossas.shutdown.timeout";
+        private static final int STOP_TIMEOUT = Integer.parseInt(System.getProperty(SYSTEM_PROPERTY_JBOSSAS_SHUTDOWN_TIMEOUT, "30"));
+        private static final int START_TIMEOUT = Integer.parseInt(System.getProperty(SYSTEM_PROPERTY_JBOSSAS_STARTUP_TIMEOUT, "120"));
 		
    /**
     * Create a new ShutdownTestCase.



More information about the jboss-cvs-commits mailing list