Class Event


public class Event extends CollectionElement
  • Constructor Details

    • Event

      public Event(enumEventType evtType, String sourceCode)
      Create a new Event object with the specified EventType (eg., pre-request or test) and source code. The type property is excluded because it is always 'text/javascript', although the schema does theoretically allow for different values
      Parameters:
      evtType - Enumerated value of the event type, eg. pre-request or test
      sourceCode - Source code for the script
      evtType - Content type of the script, always "text/javascript"
  • Method Details

    • getScriptType

      public String getScriptType()
      Returns:
      String
    • getEventType

      public enumEventType getEventType()
      Returns the type of this script, eg., pre-request or test, as an enumerated value.
      Returns:
      enumEventType The event type
    • setEventType

      public void setEventType(enumEventType eventType)
      Sets the type of this event, eg. pre-request or test, as an enumerated value
      Parameters:
      eventType - The type of the event
    • getSourceCode

      public String getSourceCode() throws InvalidPropertyException
      Get complete source for this script, or null if none is set. Concatenates all the elements of the exec array.
      Returns:
      Throws:
      InvalidPropertyException
    • getSourceCodeElements

      public ArrayList<String> getSourceCodeElements()
      Returns:
      ArrayList<String>
    • setSourceCode

      public void setSourceCode(String srcCode)
      Set the source code for this script
      Parameters:
      srcCode - The source code (javascript)
    • getKey

      public String getKey()
      Specified by:
      getKey in class CollectionElement
      Returns:
      String
    • addSourceCodeElement

      public void addSourceCodeElement(String code, int position)
      Pre-pend source code to the end of the exec property array.
      Parameters:
      code -
    • removeSourceCodeElement

      public void removeSourceCodeElement(int position) throws InvalidPropertyException
      Parameters:
      position -
      Throws:
      InvalidPropertyException