public static void assertNonZero(int i, String message) { Arguments.assertNotNull("message", message); if (i == 0) { doThrow(message); } }
public static void assertEquals(String message, int expected, int actual) { Arguments.assertNotNull("message", message); if (expected != actual) { doThrow(message + ": expected " + expected + ", but actual is " + actual); } }
public static void assertNull(Object o, String message) { Arguments.assertNotNull("message", message); if (o != null) { doThrow(message); } }
// TODO consider moving to another more Swing-related class public static void assertIsEDT() { if (!SwingUtilities.isEventDispatchThread()) { doThrow( "Expected to be called from EDT. Was \"" + Thread.currentThread().getClass().getName() + "\" with name \"" + Thread.currentThread().getName() + "\""); } }
public static void assertFalse(boolean condition, String message) { if (condition) { doThrow(message); } }