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 method will be invoked instead of each method found.
The test method being invoked is passed in, encapsulated in a object so one can run it by invoking .
The test method being invoked is passed in, encapsulated in a object so one can run it by invoking .
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.