Exemplo n.º 1
0
  public static void assertNonZero(int i, String message) {
    Arguments.assertNotNull("message", message);

    if (i == 0) {
      doThrow(message);
    }
  }
Exemplo n.º 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);
    }
  }
Exemplo n.º 3
0
  public static void assertNull(Object o, String message) {
    Arguments.assertNotNull("message", message);

    if (o != null) {
      doThrow(message);
    }
  }
Exemplo n.º 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()
             + "\"");
   }
 }
Exemplo n.º 5
0
 public static void assertFalse(boolean condition, String message) {
   if (condition) {
     doThrow(message);
   }
 }