org.apache.jmeter.testelement

## Interface TestElement

- All Superinterfaces:
    java.lang.Cloneable
  All Known Subinterfaces:
    Controller, Sampler
  All Known Implementing Classes:
    AbstractJDBCProcessor, AbstractJDBCTestElement, AbstractListenerElement, AbstractSampler, AbstractScopedAssertion, AbstractScopedTestElement, AbstractTestElement, AbstractThreadGroup, AccessLogSampler, AjpSampler, AnchorModifier, Argument, Arguments, AuthManager, Authorization, BackendListener, BaseJMSSampler, BeanShellAssertion, BeanShellListener, BeanShellPostProcessor, BeanShellPreProcessor, BeanShellSampler, BeanShellTestElement, BeanShellTimer, BoundaryExtractor, BSFAssertion, BSFListener, BSFPostProcessor, BSFPreProcessor, BSFSampler, BSFTestElement, BSFTimer, CacheManager, CompareAssertion, ConfigTestElement, ConstantThroughputTimer, ConstantTimer, Cookie, CookieManager, CounterConfig, CriticalSectionController, CSVDataSet, DataSourceElement, DebugPostProcessor, DebugSampler, DNSCacheManager, DurationAssertion, Example1, Example2, Example3, ExampleSampler, ForeachController, FTPSampler, GaussianRandomTimer, GenericController, Header, HeaderManager, HTMLAssertion, HtmlExtractor, HTTPArgument, HTTPFileArg, HTTPFileArgs, HttpMirrorControl, HTTPSampler, HTTPSamplerBase, HTTPSamplerProxy, IfController, IncludeController, InterleaveControl, JavaConfig, JavaSampler, JDBCPostProcessor, JDBCPreProcessor, JDBCSampler, JMSProperties, JMSProperty, JMSSampler, JSONPathAssertion, JSONPostProcessor, JSR223Assertion, JSR223Listener, JSR223PostProcessor, JSR223PreProcessor, JSR223Sampler, JSR223TestElement, JSR223Timer, JUnitSampler, KeystoreConfig, LDAPArgument, LDAPArguments, LDAPExtSampler, LDAPSampler, LoginConfig, LoopController, MailerModel, MailerResultCollector, MailReaderSampler, MD5HexAssertion, ModuleController, MongoScriptSampler, MongoSourceElement, OnceOnlyController, OnErrorTestElement, PoissonRandomTimer, PostThreadGroup, PreciseThroughputTimer, ProxyControl, PublisherSampler, RandomController, RandomOrderController, RandomTimer, RandomVariableConfig, RecordingController, RegexExtractor, RegExUserParameters, RemoteListenerWrapper, RemoteSampleListenerWrapper, RemoteTestListenerWrapper, RemoteThreadsListenerWrapper, ResponseAssertion, ResultAction, ResultCollector, ResultSaver, RunTime, SampleTimeout, ScriptingTestElement, SetupThreadGroup, SizeAssertion, SMIMEAssertionTestElement, SmtpSampler, StaticHost, SubscriberSampler, SubstitutionElement, Summariser, SwitchController, SyncTimer, SystemSampler, TCPSampler, TestAction, TestFragmentController, TestPlan, ThreadGroup, ThroughputController, TransactionController, TransactionSampler, UniformRandomTimer, URLRewritingModifier, UserParameters, WhileController, WorkBench, XMLAssertion, XMLSchemaAssertion, XPath2Extractor, XPathAssertion, XPathExtractor

      public interface TestElement
      extends java.lang.Cloneable

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `COMMENTS`
    `static java.lang.String` | `ENABLED`
    `static java.lang.String` | `GUI_CLASS`
    `static java.lang.String` | `NAME`
    `static java.lang.String` | `TEST_CLASS`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTestElement(TestElement child)`
    `boolean` | `canRemove()` Called by Remove to determine if it is safe to remove the element.
    `void` | `clear()` Clear the TestElement of all data.
    `void` | `clearTestElementChildren()` This method should clear any test element properties that are merged by `addTestElement(TestElement)`.
    `java.lang.Object` | `clone()`
    `java.lang.String` | `getComment()`
    `java.lang.String` | `getName()` Get the name of this test element
    `JMeterProperty` | `getProperty(java.lang.String propName)` Given the name of the property, returns the appropriate property from JMeter.
    `boolean` | `getPropertyAsBoolean(java.lang.String key)` Return a property as a boolean value.
    `boolean` | `getPropertyAsBoolean(java.lang.String key, boolean defaultValue)` Return a property as a boolean value or a default value if no property could be found.
    `double` | `getPropertyAsDouble(java.lang.String key)` Return a property as a double value.
    `float` | `getPropertyAsFloat(java.lang.String key)` Return a property as a float value.
    `int` | `getPropertyAsInt(java.lang.String key)` Return a property as an int value.
    `int` | `getPropertyAsInt(java.lang.String key, int defaultValue)` Return a property as an int value or a default value if no property could be found.
    `long` | `getPropertyAsLong(java.lang.String key)` Return a property as a long value.
    `long` | `getPropertyAsLong(java.lang.String key, long defaultValue)` Return a property as a long value or a default value if no property could be found.
    `java.lang.String` | `getPropertyAsString(java.lang.String key)` Return a property as a string value.
    `java.lang.String` | `getPropertyAsString(java.lang.String key, java.lang.String defaultValue)` Return a property as an string value or a default value if no property could be found.
    `JMeterContext` | `getThreadContext()`
    `java.lang.String` | `getThreadName()`
    `boolean` | `isEnabled()` Check if ENABLED property is present and true ; defaults to true
    `boolean` | `isRunningVersion()` Returns true or false whether the element is the running version.
    `boolean` | `isTemporary(JMeterProperty property)` Test whether a given property is only a temporary resident of the TestElement
    `PropertyIterator` | `propertyIterator()` Get a Property Iterator for the TestElements properties.
    `void` | `recoverRunningVersion()` Tells the test element to return to the state it was in when setRunningVersion(true) was called.
    `default void` | `removed()` Called when the test element is removed from the test plan.
    `void` | `removeProperty(java.lang.String key)` Remove property stored under the `key`
    `void` | `setComment(java.lang.String comment)` Associates a comment with this element
    `void` | `setEnabled(boolean enabled)` Set the enabled status of the test element
    `void` | `setName(java.lang.String name)`
    `void` | `setProperty(JMeterProperty property)` Sets and overwrites a property in the TestElement.
    `void` | `setProperty(java.lang.String key, boolean value)`
    `void` | `setProperty(java.lang.String key, boolean value, boolean dflt)`
    `void` | `setProperty(java.lang.String key, int value)`
    `void` | `setProperty(java.lang.String key, int value, int dflt)`
    `void` | `setProperty(java.lang.String name, long value)`
    `void` | `setProperty(java.lang.String name, long value, long dflt)`
    `void` | `setProperty(java.lang.String key, java.lang.String value)`
    `void` | `setProperty(java.lang.String key, java.lang.String value, java.lang.String dflt)`
    `void` | `setRunningVersion(boolean run)` Make the test element the running version, or make it no longer the running version.
    `void` | `setTemporary(JMeterProperty property)` Indicate that the given property should be only a temporary property in the TestElement
    `void` | `setThreadContext(JMeterContext threadContext)`
    `void` | `setThreadName(java.lang.String threadName)`
    `void` | `traverse(TestElementTraverser traverser)` Convenient way to traverse a test element.

- - ### Field Detail

    - #### NAME

          static final java.lang.String NAME

      See Also:
        Constant Field Values

    - #### GUI_CLASS

          static final java.lang.String GUI_CLASS

      See Also:
        Constant Field Values

    - #### ENABLED

          static final java.lang.String ENABLED

      See Also:
        Constant Field Values

    - #### TEST_CLASS

          static final java.lang.String TEST_CLASS

      See Also:
        Constant Field Values

    - #### COMMENTS

          static final java.lang.String COMMENTS

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### addTestElement

          void addTestElement(TestElement child)

    - #### clearTestElementChildren

          void clearTestElementChildren()

      This method should clear any test element properties that are merged by `addTestElement(TestElement)`.

    - #### setProperty

          void setProperty(java.lang.String key,
                           java.lang.String value)

    - #### setProperty

          void setProperty(java.lang.String key,
                           java.lang.String value,
                           java.lang.String dflt)

    - #### setProperty

          void setProperty(java.lang.String key,
                           boolean value)

    - #### setProperty

          void setProperty(java.lang.String key,
                           boolean value,
                           boolean dflt)

    - #### setProperty

          void setProperty(java.lang.String key,
                           int value)

    - #### setProperty

          void setProperty(java.lang.String key,
                           int value,
                           int dflt)

    - #### setProperty

          void setProperty(java.lang.String name,
                           long value)

    - #### setProperty

          void setProperty(java.lang.String name,
                           long value,
                           long dflt)

    - #### isEnabled

          boolean isEnabled()

      Check if ENABLED property is present and true ; defaults to true
      Returns:
        true if element is enabled

    - #### setEnabled

          void setEnabled(boolean enabled)

      Set the enabled status of the test element
      Parameters:
        `enabled` - the status to set

    - #### isRunningVersion

          boolean isRunningVersion()

      Returns true or false whether the element is the running version.
      Returns:
        `true` if the element is the running version

    - #### isTemporary

          boolean isTemporary(JMeterProperty property)

      Test whether a given property is only a temporary resident of the TestElement
      Parameters:
        `property` - the property to be tested
      Returns:
        `true` if property is temporary

    - #### setTemporary

          void setTemporary(JMeterProperty property)

      Indicate that the given property should be only a temporary property in the TestElement
      Parameters:
        `property` - void

    - #### getPropertyAsBoolean

          boolean getPropertyAsBoolean(java.lang.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(java.lang.String key,
                                       boolean defaultValue)

      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
        `defaultValue` - the default value to use
      Returns:
        the value of the property, or `defaultValue` if no property could be found

    - #### getPropertyAsLong

          long getPropertyAsLong(java.lang.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(java.lang.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

    - #### getPropertyAsInt

          int getPropertyAsInt(java.lang.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(java.lang.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

    - #### getPropertyAsFloat

          float getPropertyAsFloat(java.lang.String key)

      Return a property as a float value.
      Parameters:
        `key` - the name of the property to get
      Returns:
        the value of the property

    - #### getPropertyAsDouble

          double getPropertyAsDouble(java.lang.String key)

      Return a property as a double value.
      Parameters:
        `key` - the name of the property to get
      Returns:
        the value of the property

    - #### setRunningVersion

          void setRunningVersion(boolean run)

      Make the test element the running version, or make it no longer the running version. This tells the test element that it's current state must be retrievable by a call to recoverRunningVersion(). It is kind of like making the TestElement Read- Only, but not as strict. Changes can be made and the element can be modified, but the state of the element at the time of the call to setRunningVersion() must be recoverable.
      Parameters:
        `run` - flag whether this element should be the running version

    - #### recoverRunningVersion

          void recoverRunningVersion()

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

    - #### clear

          void clear()

      Clear the TestElement of all data.

    - #### getPropertyAsString

          java.lang.String getPropertyAsString(java.lang.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

          java.lang.String getPropertyAsString(java.lang.String key,
                                               java.lang.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

    - #### getProperty

          JMeterProperty getProperty(java.lang.String propName)

      Given the name of the property, returns the appropriate property from JMeter. If it is null, a NullProperty object will be returned.
      Parameters:
        `propName` - the name of the property to get
      Returns:
        `JMeterProperty` stored under the name, or `NullProperty` if no property can be found

    - #### propertyIterator

          PropertyIterator propertyIterator()

      Get a Property Iterator for the TestElements properties.
      Returns:
        PropertyIterator

    - #### removeProperty

          void removeProperty(java.lang.String key)

      Remove property stored under the `key`
      Parameters:
        `key` - name of the property to be removed

    - #### clone

          java.lang.Object clone()

    - #### traverse

          void traverse(TestElementTraverser traverser)

      Convenient way to traverse a test element.
      Parameters:
        `traverser` - The traverser that is notified of the contained elements

    - #### getThreadContext

          JMeterContext getThreadContext()

      Returns:
        Returns the threadContext.

    - #### setThreadContext

          void setThreadContext(JMeterContext threadContext)

      Parameters:
        `threadContext` - The threadContext to set.

    - #### getThreadName

          java.lang.String getThreadName()

      Returns:
        Returns the threadName.

    - #### setThreadName

          void setThreadName(java.lang.String threadName)

      Parameters:
        `threadName` - The threadName to set.

    - #### 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.
      Returns:
        true if safe to remove the element

    - #### getName

          java.lang.String getName()

      Get the name of this test element
      Returns:
        name of this element

    - #### setName

          void setName(java.lang.String name)

      Parameters:
        `name` - of this element

    - #### getComment

          java.lang.String getComment()

      Returns:
        comment associated with this element

    - #### setComment

          void setComment(java.lang.String comment)

      Associates a comment with this element
      Parameters:
        `comment` - to be associated

    - #### removed

          default void removed()

      Called when the test element is removed from the test plan. Must not throw any exception

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.