1 package org.testng.asserts; 2 3 /** 4 * Life cycle methods for the assertion class. 5 */ 6 public interface IAssertLifecycle { 7 /** 8 * Run the assert command in parameter. 9 */ executeAssert(IAssert<?> assertCommand)10 void executeAssert(IAssert<?> assertCommand); 11 12 /** 13 * Invoked when an assert succeeds. 14 */ onAssertSuccess(IAssert<?> assertCommand)15 void onAssertSuccess(IAssert<?> assertCommand); 16 17 /** 18 * Invoked when an assert fails. 19 * 20 * @deprecated use onAssertFailure(IAssert assertCommand, AssertionError ex) instead of. 21 */ onAssertFailure(IAssert<?> assertCommand)22 void onAssertFailure(IAssert<?> assertCommand); 23 24 /** 25 * Invoked when an assert fails. 26 * 27 */ onAssertFailure(IAssert<?> assertCommand, AssertionError ex)28 void onAssertFailure(IAssert<?> assertCommand, AssertionError ex); 29 30 /** 31 * Invoked before an assert is run. 32 */ onBeforeAssert(IAssert<?> assertCommand)33 void onBeforeAssert(IAssert<?> assertCommand); 34 35 /** 36 * Invoked after an assert is run. 37 */ onAfterAssert(IAssert<?> assertCommand)38 void onAfterAssert(IAssert<?> assertCommand); 39 } 40