Пример #1
0
  public static void assertNonZero(int i, String message) {
    Arguments.assertNotNull("message", message);

    if (i == 0) {
      doThrow(message);
    }
  }
Пример #2
0
  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);
    }
  }
Пример #3
0
  public static void assertNull(Object o, String message) {
    Arguments.assertNotNull("message", message);

    if (o != null) {
      doThrow(message);
    }
  }
Пример #4
0
 // 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()
             + "\"");
   }
 }
Пример #5
0
 public static void assertFalse(boolean condition, String message) {
   if (condition) {
     doThrow(message);
   }
 }