public interface IHookable extends ITestNGListener
This is useful to test classes that require JAAS authentication, which can be implemented as follows:
public void run(final IHookCallBack icb, ITestResult testResult) {
// Preferably initialized in a @Configuration method
mySubject = authenticateWithJAAs();
Subject.doAs(mySubject, new PrivilegedExceptionAction() {
public Object run() {
icb.callback(testResult);
}
};
}
| Modifier and Type | Method and Description |
|---|---|
void |
run(IHookCallBack callBack,
ITestResult testResult) |
void run(IHookCallBack callBack, ITestResult testResult)