ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs ExecuteWatchdogTest.java
Date Fri, 01 Mar 2002 23:43:31 GMT
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:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message