uk.co.thebadgerset.junit.extensions.util.TestUtils Maven / Gradle / Ivy
Go to download
JUnit Toolkit enhances JUnit with performance testing, asymptotic behaviour analysis, and concurrency testing.
The newest version!
/* Copyright Rupert Smith, 2005 to 2007, all rights reserved. */
package uk.co.thebadgerset.junit.extensions.util;
/**
* Provides commonly used functions that aid testing.
*
* CRC Card
* Responsibilities Collaborations
* Provide a short pause.
*
*
* @author Rupert Smith
*/
public class TestUtils
{
/**
* Injects a short pause. The pause may not complete its full length, if the thread is interrupted when waiting.
* In most cases, this will not happen and this method is a vry adequate pause implementation, without the
* need to handle interrupted exceptions.
*
* @param millis The length of the pause in milliseconds.
*/
public static void pause(long millis)
{
try
{
Thread.sleep(millis);
}
catch (InterruptedException e)
{
// Clear the flag and ignore.
Thread.interrupted();
}
}
}