1.8. Example of IHookable

1.8. Example of IHookable


If a test class wants to do something more, like a JAAS authentication, before invoking the test method, it needs to implement IHookable. If a test class implements this interface, its run() method will be invoked instead of each @Testmethod found.
The test method being invoked is passed in, encapsulated in a IHookCallBack object so one can run it by invokingIHookCallBack.runTestMethod().
In the below example, we will skip running the test, based on the test method’s parameter value. If the parameter value is “local” environment, the test is skipped but run for other valid environments.
HookableExample

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.