org.apache.jmeter.testelement

## Class AbstractScopedTestElement

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.testelement.AbstractScopedTestElement

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Searchable, TestElement
  Direct Known Subclasses:
    AbstractScopedAssertion, BoundaryExtractor, HtmlExtractor, JSONPostProcessor, RegexExtractor, XPath2Extractor, XPathExtractor

      public abstract class AbstractScopedTestElement
      extends AbstractTestElement

  Super-class for TestElements that can be applied to main sample, sub-samples or both. [Assertions use a different class because they use a different value for the `getScopeName()` constant]

  Their corresponding GUI classes need to add the ScopePanel to the GUI using the AbstractXXXGui methods:

  - createScopePanel()
  - saveScopeSettings()
  - showScopeSettings()
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.apache.jmeter.testelement.TestElement

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractScopedTestElement()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `fetchScope()` Get the scope setting
    `protected java.util.List<SampleResult>` | `getSampleList(SampleResult result)` Generate a list of qualifying sample results, depending on the scope.
    `protected java.lang.String` | `getScopeName()`
    `java.lang.String` | `getVariableName()`
    `boolean` | `isScopeAll(java.lang.String scope)` Is the assertion to be applied to the all samples?
    `boolean` | `isScopeChildren(java.lang.String scope)` Is the assertion to be applied to the sub-samples (children)?
    `boolean` | `isScopeParent(java.lang.String scope)` Is the assertion to be applied to the main (parent) sample?
    `protected boolean` | `isScopeVariable()` Is the assertion to be applied to the all samples?
    `boolean` | `isScopeVariable(java.lang.String scope)` Is the assertion to be applied to the all samples?
    `void` | `setScopeAll()`
    `void` | `setScopeChildren()`
    `void` | `setScopeParent()`
    `void` | `setScopeVariable(java.lang.String variableName)`

    - ### Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

      `addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.TestElement

      `removed`

- - ### Constructor Detail

    - #### AbstractScopedTestElement

          public AbstractScopedTestElement()

  - ### Method Detail

    - #### getScopeName

          protected java.lang.String getScopeName()

    - #### fetchScope

          public java.lang.String fetchScope()

      Get the scope setting
      Returns:
        the scope, default parent

    - #### isScopeParent

          public boolean isScopeParent(java.lang.String scope)

      Is the assertion to be applied to the main (parent) sample?
      Parameters:
        `scope` - name of the scope to be checked
      Returns:
        `true` if the assertion is to be applied to the parent sample.

    - #### isScopeChildren

          public boolean isScopeChildren(java.lang.String scope)

      Is the assertion to be applied to the sub-samples (children)?
      Parameters:
        `scope` - name of the scope to be checked
      Returns:
        `true` if the assertion is to be applied to the children.

    - #### isScopeAll

          public boolean isScopeAll(java.lang.String scope)

      Is the assertion to be applied to the all samples?
      Parameters:
        `scope` - name of the scope to be checked
      Returns:
        `true` if the assertion is to be applied to the all samples.

    - #### isScopeVariable

          public boolean isScopeVariable(java.lang.String scope)

      Is the assertion to be applied to the all samples?
      Parameters:
        `scope` - name of the scope to be checked
      Returns:
        `true` if the assertion is to be applied to the all samples.

    - #### isScopeVariable

          protected boolean isScopeVariable()

      Is the assertion to be applied to the all samples?
      Returns:
        `true` if the assertion is to be applied to the all samples.

    - #### getVariableName

          public java.lang.String getVariableName()

    - #### setScopeParent

          public void setScopeParent()

    - #### setScopeChildren

          public void setScopeChildren()

    - #### setScopeAll

          public void setScopeAll()

    - #### setScopeVariable

          public void setScopeVariable(java.lang.String variableName)

    - #### getSampleList

          protected java.util.List<SampleResult> getSampleList(SampleResult result)

      Generate a list of qualifying sample results, depending on the scope.
      Parameters:
        `result` - current sample
      Returns:
        list containing the current sample and/or its child samples

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