You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2002/03/02 00:43:31 UTC
cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs ExecuteWatchdogTest.java
stevel 02/03/01 15:43:31
Modified: src/testcases/org/apache/tools/ant/taskdefs
ExecuteWatchdogTest.java
Log:
tuned timing in assertions
Revision Changes Path
1.7 +5 -2 jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
Index: ExecuteWatchdogTest.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExecuteWatchdogTest.java 10 Jan 2002 10:13:12 -0000 1.6
+++ ExecuteWatchdogTest.java 1 Mar 2002 23:43:31 -0000 1.7
@@ -71,6 +71,9 @@
private final static String TEST_CLASSPATH = getTestClassPath();
+ private final static int CLOCK_ERROR=200;
+ private final static int TIME_OUT_TEST=TIME_OUT-CLOCK_ERROR;
+
private ExecuteWatchdog watchdog;
public ExecuteWatchdogTest(String name) {
@@ -151,8 +154,8 @@
long elapsed = System.currentTimeMillis() - now;
assertTrue("process should have been killed", watchdog.killedProcess());
// assertTrue("return code is invalid: " + retCode, retCode!=0);
- assertTrue("elapse time is less than timeout value", elapsed > TIME_OUT);
- assertTrue("elapse time is greater than run value", elapsed < TIME_OUT*2);
+ assertTrue("elapse time of "+elapsed+" ms is less than timeout value of "+TIME_OUT_TEST+" ms", elapsed >= TIME_OUT_TEST);
+ assertTrue("elapse time of "+elapsed+" ms is greater than run value of "+(TIME_OUT*2)+" ms", elapsed < TIME_OUT*2);
}
// test a process that runs and failed
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>