Previous Topic: Using HooksNext Topic: Deploy a New Hook


Create a New Hook

Follow these steps:

  1. Create a Java class that extends com.itko.lisa.test.Hook.

    This class provides the information that is required to execute the logic for your hook.

    public class HeadlineHook extends Hook
    {
     
    }
    
  2. Implement the startupHook method.

    DevTest calls this method when the test starts. If an error occurs or you otherwise want to prevent the test from executing normally, throw a TestRunException.

    public void startupHook( TestExec testExec ) throws TestRunException
    
  3. Implement the endHook method.

    You have an opportunity to perform any post-execution logic for the test.

    public void endHook( TestExec testExec )
    
  4. (Optional) Implement the

    setLongMsg

    method to integrate into Portal Test Monitoring facility.

    You can provide a detailed message for the hook.

    public void setLongMsg( boolean isStarting, String msg )