summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/helper/ProcessHandler.java
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-07-29 13:59:06 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-07-29 13:59:06 +0000
commitd2f490169ee8fe6b23c204713453e7fa1cd6a168 (patch)
tree17b84c5c739759052791c89fbc2d383c45d00796 /qadevOOo/runner/helper/ProcessHandler.java
parent6a839e2cd28d2e31b2b7f0c39fa4d944ad6130be (diff)
CWS-TOOLING: integrate CWS perftest09b
2009-07-22 08:34:25 +0200 lla r274216 : #i103694# use bash as shell 2009-07-21 12:33:51 +0200 lla r274178 : #160203# 2009-07-20 13:42:20 +0200 lla r274124 : #106358# add helper tool to get access to rpm in the environment for SOI 2009-07-20 12:43:26 +0200 lla r274119 : #i103656# compatiblity
Diffstat (limited to 'qadevOOo/runner/helper/ProcessHandler.java')
-rw-r--r--qadevOOo/runner/helper/ProcessHandler.java39
1 files changed, 34 insertions, 5 deletions
diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java
index 859f00a55593..6fa842c4ebb8 100644
--- a/qadevOOo/runner/helper/ProcessHandler.java
+++ b/qadevOOo/runner/helper/ProcessHandler.java
@@ -36,6 +36,9 @@ import java.io.PrintStream;
import java.io.LineNumberReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
import lib.TestParameters;
import util.PropertyName;
import util.utils;
@@ -492,6 +495,29 @@ public class ProcessHandler
isStarted = false;
}
+ /**
+ * Returns the time in seconds since 1st January 1970
+ * @return
+ */
+ public static long getSystemTime()
+ {
+ // Calendar cal = new GregorianCalendar();
+ // final long nTime = cal.getTimeInMillis();
+ final long nTime = System.currentTimeMillis();
+ return nTime;
+ }
+ private long m_nExactStartTimeInMillisec;
+
+ private void initialExactStartTime()
+ {
+ m_nExactStartTimeInMillisec = getSystemTime();
+ }
+
+ public long getProcessStartTime()
+ {
+ return m_nExactStartTimeInMillisec;
+ }
+
protected void execute()
{
if (isStarted())
@@ -511,7 +537,7 @@ public class ProcessHandler
log.print(" ");
}
log.println("");
-
+ initialExactStartTime();
m_aProcess = runtime.exec(cmdLineArray, envVars);
}
else
@@ -547,6 +573,9 @@ public class ProcessHandler
stderr = new Pump(m_aProcess.getErrorStream(), log, "err > ");
stdIn = new PrintStream(m_aProcess.getOutputStream());
+ // int nExitValue = m_aProcess.exitValue();
+ // int dummy = 0;
+
dbg("execute: flush io-streams");
flushInput();
@@ -583,10 +612,10 @@ public class ProcessHandler
* @return <code>true</code> if process correctly exited
* (exit code doesn't affect to this result).
*/
- public boolean waitFor(long timeout)
- {
- return waitFor(timeout, true);
- }
+ public boolean waitFor(long timeout)
+ {
+ return waitFor(timeout, true);
+ }
private boolean waitFor(long timeout, boolean bKillProcessAfterTimeout)
{