1 21 22 package org.apache.derbyTesting.unitTests.harness; 23 24 27 public class T_Fail extends Exception { 28 29 private Throwable nested; 30 31 36 private T_Fail(String message) { 37 super(message); 38 } 39 40 46 public static T_Fail moduleToTestIdNotFound() 47 { 48 return new T_Fail("Test failed because the configuration does not include the MODULE_TO_TEST_IDENT attribute."); 49 } 50 51 57 public static T_Fail moduleToTestNotFound(String moduleToTest) 58 { 59 return new T_Fail("Test failed due to failure loading " + moduleToTest); 60 } 61 62 71 public static T_Fail exceptionFail(Throwable e) 72 { 73 T_Fail tf = new T_Fail("The test failed with an exception: " + e.toString()); 74 tf.nested = e; 75 return tf; 76 } 77 78 83 public static T_Fail testFail() 84 { 85 return new T_Fail("The test failed"); 86 } 87 88 94 public static T_Fail testFailMsg(String message) 95 { 96 return new T_Fail("Test failed - " + message); 97 } 98 99 105 public static final void T_ASSERT(boolean mustBeTrue) 106 throws T_Fail 107 { 108 if (!mustBeTrue) 109 throw testFail(); 110 } 111 112 120 public static final void T_ASSERT(boolean mustBeTrue,String msg) 121 throws T_Fail 122 { 123 if (!mustBeTrue) 124 throw testFailMsg(msg); 125 } 126 } 127 | Popular Tags |