Created
April 12, 2012 02:51
-
-
Save danielalexiuc/2364357 to your computer and use it in GitHub Desktop.
Time Bomb - a better alternative to JUnit @ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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