FileDocCategorySizeDatePackage
SleepTest.javaAPI DocApache Ant 1.703074Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs

SleepTest

public class SleepTest extends org.apache.tools.ant.BuildFileTest
created
01 May 2001

Fields Summary
private static final String
TASKDEFS_DIR
private static final boolean
TRACE
private static final int
ERROR_RANGE
Constructors Summary
public SleepTest(String name)

	
       
        super(name);
    
Methods Summary
public voidsetUp()

        configureProject(TASKDEFS_DIR + "sleep.xml");
    
public voidtest1()

       Timer timer=new Timer();
        executeTarget("test1");
        timer.stop();
        if(TRACE) System.out.println(" test1 elapsed time="+timer.time());
        assertTrue(timer.time()>=0);
    
public voidtest2()

        Timer timer=new Timer();
        executeTarget("test2");
        timer.stop();
        if(TRACE) System.out.println(" test2 elapsed time="+timer.time());
        assertTrue(timer.time()>=0);
    
public voidtest3()

        Timer timer=new Timer();
        executeTarget("test3");
        timer.stop();
        if(TRACE) System.out.println(" test3 elapsed time="+timer.time());
        assertTrue(timer.time()>=(2000-ERROR_RANGE));
    
public voidtest4()

        Timer timer=new Timer();
        executeTarget("test3");
        timer.stop();
        if(TRACE) System.out.println(" test4 elapsed time="+timer.time());
        assertTrue(timer.time()>=(2000-ERROR_RANGE) && timer.time()<60000);
    
public voidtest5()

        expectBuildException("test5",
            "Negative sleep periods are not supported");
    
public voidtest6()

        Timer timer=new Timer();
        executeTarget("test6");
        timer.stop();
        if(TRACE) System.out.println(" test6 elapsed time="+timer.time());
        assertTrue(timer.time()<2000);