Skip to content

Instantly share code, notes, and snippets.

@danielalexiuc
Created April 12, 2012 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielalexiuc/2364357 to your computer and use it in GitHub Desktop.
Save danielalexiuc/2364357 to your computer and use it in GitHub Desktop.
Time Bomb - a better alternative to JUnit @ignore
/**
* Use to delay a unit test for a bit to give someone the chance to fix it.
*
* Common usage:
*
* if (TestUtils.timeBomb("TDB: Bob please fix", "20100123")){
* if (true) return;
* }
*/
public static boolean timeBomb(String message, String timerExpiresOnYYYYMMDD) {
if (DateUtils.getDateYYYYMMDD(timerExpiresOnYYYYMMDD).getTime() > System.currentTimeMillis()) {
return true;
}
throw new RuntimeException(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment