db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1539068 - in /db/derby/code/branches/10.10: ./ java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
Date Tue, 05 Nov 2013 17:19:15 GMT
Author: myrnavl
Date: Tue Nov  5 17:19:15 2013
New Revision: 1539068

URL: http://svn.apache.org/r1539068
Log:
DERBY-6400; harness.NetServer method waitFor() is not reflecting timeout values
   merge of revision 1538692 from trunk.

Modified:
    db/derby/code/branches/10.10/   (props changed)
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java

Propchange: db/derby/code/branches/10.10/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1538692

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java?rev=1539068&r1=1539067&r2=1539068&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
(original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
Tue Nov  5 17:19:15 2013
@@ -44,6 +44,7 @@ public class NetServer
     String jvmflags;
     String framework;
 	String appsRequiredPassword;
+	int timeout=60;
     static String hostName;
     
     Object[] frameworkInfo;
@@ -132,6 +133,18 @@ public class NetServer
         this.javaCmd = javaCmd;
         this.jvmflags = jvmflags;
 	this.framework = framework;
+	
+    if (jvmflags != null && jvmflags.length() > 0)
+    {
+        int start=jvmflags.indexOf("-Dtimeout");
+        if (start >= 0) {
+            String timeoutStr = jvmflags.substring(start);
+            String[] tokens = timeoutStr.split(" ");
+            timeoutStr = tokens[0];
+            timeoutStr = timeoutStr.substring(10);
+            timeout = Integer.parseInt(timeoutStr.trim());
+        }
+    }
 
 	    // if authentication is required to shutdown server we need password
 	    // for user APP (the dbo).
@@ -322,7 +335,7 @@ public class NetServer
 		Process prconn = Runtime.getRuntime().exec(connCmd);
 		// Give the server sixty seconds to shutdown.
 		TimedProcess tp = new TimedProcess(prconn);
-		tp.waitFor(60);
+		tp.waitFor(timeout);
 		
 		String[] stopcmd2 = (String[]) frameworkInfo[STOP_CMD2_POS];
 		if (stopcmd2 != null)
@@ -343,7 +356,7 @@ public class NetServer
 		// Try a TimedProcess as Phil did for the WLServer
 		tp = new TimedProcess(pr);
 		// In case the Server didn't shut down, force it to ...
-		tp.waitFor(60);
+		tp.waitFor(timeout);
 		
 		// Finish and close the redirected out and err files
 		outSaver.finish();

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?rev=1539068&r1=1539067&r2=1539068&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
(original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
Tue Nov  5 17:19:15 2013
@@ -292,6 +292,13 @@ public class RunTest
                 spacedJvmFlags = spaceJvmFlags(jvmflags);   
             }
             
+            if (!(timeoutStr.isEmpty()) && !(timeoutStr==null) && (timeout
>= 0)) {
+                if  (spacedJvmFlags != null)
+                    spacedJvmFlags = "-Dtimeout=" + timeoutStr + " " + spacedJvmFlags;
+                else
+                    spacedJvmFlags = "-Dtimeout=" + timeoutStr + " ";
+            }
+            
             System.out.println("Initialize for framework: "+ framework );
             if (jvmnet && framework.startsWith("DerbyNet"))
             {



Mime
View raw message