Class AbstractTestElement

    • Constructor Detail

    • Method Detail

      • setThreadName

         void setThreadName(String inthreadName)
        Parameters:
        inthreadName - The threadName to set.
      • clear

         void clear()

        Clear the TestElement of all data.

      • clearTestElementChildren

         void clearTestElementChildren()

        This method should clear any test element properties that are merged by .addTestElement.

        Default implementation - does nothing

      • setName

         void setName(String name)

        Associates a name with this element.

      • setComment

         void setComment(String comment)

        Associates a comment with this element.

      • getProperty

         JMeterProperty getProperty(String key)

        Get the named property. If it doesn't exist, a new NullProperty object is created with the same name and returned.

      • getPropertyOrNull

        @API(status = API.Status.EXPERIMENTAL, since = "5.6") JMeterProperty getPropertyOrNull(String key)

        Retrieve property or return null if the property is unset.

        Note: the result of the method does not account the default value, so consider using get(PropertyDescriptor) methods if you need to account for default values.

        Since:

        5.6

      • traverse

         void traverse(TestElementTraverser traverser)

        Convenient way to traverse a test element.

        Parameters:
        traverser - The traverser that is notified of the contained elements
      • getPropertyAsInt

         int getPropertyAsInt(String key)

        Return a property as an int value.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property

      • getPropertyAsInt

         int getPropertyAsInt(String key, int defaultValue)

        Return a property as an int value or a default value if no property could be found.

        Parameters:
        key - the name of the property to get
        defaultValue - the default value to use
        Returns:

        the value of the property, or defaultValue if no property could be found

      • getPropertyAsBoolean

         boolean getPropertyAsBoolean(String key)

        Return a property as a boolean value.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property

      • getPropertyAsBoolean

         boolean getPropertyAsBoolean(String key, boolean defaultVal)

        Return a property as a boolean value or a default value if no property could be found.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property, or defaultValue if no property could be found

      • getPropertyAsFloat

         float getPropertyAsFloat(String key)

        Return a property as a float value.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property

      • getPropertyAsLong

         long getPropertyAsLong(String key)

        Return a property as a long value.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property

      • getPropertyAsLong

         long getPropertyAsLong(String key, long defaultValue)

        Return a property as a long value or a default value if no property could be found.

        Parameters:
        key - the name of the property to get
        defaultValue - the default value to use
        Returns:

        the value of the property, or defaultValue if no property could be found

      • getPropertyAsDouble

         double getPropertyAsDouble(String key)

        Return a property as a double value.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property

      • getPropertyAsString

         String getPropertyAsString(String key)

        Return a property as a string value.

        Parameters:
        key - the name of the property to get
        Returns:

        the value of the property

      • getPropertyAsString

         String getPropertyAsString(String key, String defaultValue)

        Return a property as an string value or a default value if no property could be found.

        Parameters:
        key - the name of the property to get
        defaultValue - the default value to use
        Returns:

        the value of the property, or defaultValue if no property could be found

      • setProperty

         void setProperty(JMeterProperty property)

        Sets and overwrites a property in the TestElement. This call will be ignored if the TestElement is currently a "running version".

        Parameters:
        property - the property to be set
      • setProperty

         void setProperty(String name, String value, String dflt)

        Create a String property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.

        Parameters:
        name - property name
        value - current value
        dflt - default
      • setProperty

         void setProperty(String name, boolean value, boolean dflt)

        Create a boolean property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.

        Parameters:
        name - property name
        value - current value
        dflt - default
      • setProperty

         void setProperty(String name, int value, int dflt)

        Create an int property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.

        Parameters:
        name - property name
        value - current value
        dflt - default
      • setProperty

         void setProperty(String name, long value, long dflt)

        Create a long property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.

        Parameters:
        name - property name
        value - current value
        dflt - default
      • recoverRunningVersion

         void recoverRunningVersion()

        Tells the test element to return to the state it was in when setRunningVersion(true) was called.

      • isTemporary

         boolean isTemporary(JMeterProperty property)

        Test whether a given property is only a temporary resident of the TestElement

      • setTemporary

         void setTemporary(JMeterProperty property)

        Indicate that the given property should be only a temporary property in the TestElement.

      • canRemove

         boolean canRemove()

        Called by Remove to determine if it is safe to remove the element. The element can either clean itself up, and return true, or the element can return false.

      • isEnabled

         boolean isEnabled()

        Configures if the current test element should be enabled or not.

      • setEnabled

         void setEnabled(boolean enabled)

        Configures if the current test element should be enabled or not.

      • setRunningVersion

         void setRunningVersion(boolean runningVersion)

        Sets the runningVersion.

        Parameters:
        runningVersion - the runningVersion to set