/** * Assert that a boolean value is true. * @param b the boolean value to check * @throws InternalGemFireError if false */ public static void assertTrue(boolean b) { if (!b) { throwError(null); } }
/** * Assert that a boolean value is true. * @param b the boolean value to check * @throws InternalGemFireError if false */ public static void assertTrue(boolean b) { if (!b) { throwError(null); } }
/** * Assert that a boolean value is true.The * message object will be sent toString() * and used for an error message. * * @param b the boolean value to check * @param message used for error message * @throws InternalGemFireError if false */ public static void assertTrue(boolean b, Object message) { if (!b) { throwError(message); } }
public static void fail(Object message) { throwError(message); }
/** * Assert that a boolean value is true.The * message object will be sent toString() * and used for an error message. * * @param b the boolean value to check * @param message used for error message * @throws InternalGemFireError if false */ public static void assertTrue(boolean b, Object message) { if (!b) { throwError(message); } }
public static void fail(Object message) { throwError(message); }
public static void assertTrue(boolean b, boolean message) { if (!b) { throwError(Boolean.valueOf(message)); } }
public static void assertTrue(boolean b, int message) { if (!b) { throwError(Integer.valueOf(message)); } }
public static void assertTrue(boolean b, long message) { if (!b) { throwError(Long.valueOf(message)); } }
public static void assertTrue(boolean b, double message) { if (!b) { throwError(Double.valueOf(message)); } }
public static void assertTrue(boolean b, float message) { if (!b) { throwError(new Float(message)); } }
public static void assertTrue(boolean b, int message) { if (!b) { throwError(Integer.valueOf(message)); } }
public static void assertTrue(boolean b, boolean message) { if (!b) { throwError(Boolean.valueOf(message)); } }
public static void assertTrue(boolean b, char message) { if (!b) { throwError(Character.valueOf(message)); } }
public static void assertTrue(boolean b, float message) { if (!b) { throwError(new Float(message)); } }
public static void assertTrue(boolean b, char message) { if (!b) { throwError(new Character(message)); } }
public static void assertTrue(boolean b, long message) { if (!b) { throwError(Long.valueOf(message)); } }
public static void assertTrue(boolean b, double message) { if (!b) { throwError(Double.valueOf(message)); } }
/** * This is a workaround for X bug 38288. JRockit can throw a NullPointerException * from Thread.holdsLock, so we catch the NullPointerException if it happens. * * This method returns true, unless it throws an exception. This is so we can disable * these tests for performance reasons with a java assertion, eg * <code>assert Assert.assertHoldLock(lock, true);</code> * @param lock The lock to test * @param shouldBeHeld true if this thread should hold this lock. * @return true, unless the method throws an exception. */ public static boolean assertHoldsLock(Object lock, boolean shouldBeHeld) { try { if(Thread.holdsLock(lock) != shouldBeHeld) { throwError(null); } } catch (NullPointerException jrockitSucks) { assertTrue(lock != null); } return true; } }
/** * This is a workaround for X bug 38288. JRockit can throw a NullPointerException * from Thread.holdsLock, so we catch the NullPointerException if it happens. * * This method returns true, unless it throws an exception. This is so we can disable * these tests for performance reasons with a java assertion, eg * <code>assert Assert.assertHoldLock(lock, true);</code> * @param lock The lock to test * @param shouldBeHeld true if this thread should hold this lock. * @return true, unless the method throws an exception. */ public static boolean assertHoldsLock(Object lock, boolean shouldBeHeld) { try { if(Thread.holdsLock(lock) != shouldBeHeld) { throwError(null); } } catch (NullPointerException jrockitSucks) { assertTrue(lock != null); } return true; } }