org.apache.jmeter.assertions

## Class JSONPathAssertion

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.assertions.JSONPathAssertion

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Assertion, Searchable, TestElement

      public class JSONPathAssertion
      extends AbstractTestElement
      implements java.io.Serializable, Assertion

  This is main class for JSONPath Assertion which verifies assertion on previous sample result using JSON path expression
  Since:
    4.0
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `EXPECT_NULL`
    `static java.lang.String` | `EXPECTEDVALUE`
    `static java.lang.String` | `INVERT`
    `static java.lang.String` | `ISREGEX`
    `static java.lang.String` | `JSONPATH`
    `static java.lang.String` | `JSONVALIDATION`

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

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONPathAssertion()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getExpectedValue()`
    `java.lang.String` | `getJsonPath()`
    `AssertionResult` | `getResult(SampleResult samplerResult)` Returns the AssertionResult object encapsulating information about the success or failure of the assertion.
    `boolean` | `isExpectNull()`
    `boolean` | `isInvert()`
    `boolean` | `isJsonValidationBool()`
    `boolean` | `isUseRegex()`
    `static java.lang.String` | `objectToString(java.lang.Object subj)`
    `void` | `setExpectedValue(java.lang.String expectedValue)`
    `void` | `setExpectNull(boolean val)`
    `void` | `setInvert(boolean invert)`
    `void` | `setIsRegex(boolean flag)`
    `void` | `setJsonPath(java.lang.String jsonPath)`
    `void` | `setJsonValidationBool(boolean jsonValidation)`

    - ### 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`

- - ### Field Detail

    - #### JSONPATH

          public static final java.lang.String JSONPATH

      See Also:
        Constant Field Values

    - #### EXPECTEDVALUE

          public static final java.lang.String EXPECTEDVALUE

      See Also:
        Constant Field Values

    - #### JSONVALIDATION

          public static final java.lang.String JSONVALIDATION

      See Also:
        Constant Field Values

    - #### EXPECT_NULL

          public static final java.lang.String EXPECT_NULL

      See Also:
        Constant Field Values

    - #### INVERT

          public static final java.lang.String INVERT

      See Also:
        Constant Field Values

    - #### ISREGEX

          public static final java.lang.String ISREGEX

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JSONPathAssertion

          public JSONPathAssertion()

  - ### Method Detail

    - #### getJsonPath

          public java.lang.String getJsonPath()

    - #### setJsonPath

          public void setJsonPath(java.lang.String jsonPath)

    - #### getExpectedValue

          public java.lang.String getExpectedValue()

    - #### setExpectedValue

          public void setExpectedValue(java.lang.String expectedValue)

    - #### setJsonValidationBool

          public void setJsonValidationBool(boolean jsonValidation)

    - #### setExpectNull

          public void setExpectNull(boolean val)

    - #### isExpectNull

          public boolean isExpectNull()

    - #### isJsonValidationBool

          public boolean isJsonValidationBool()

    - #### setInvert

          public void setInvert(boolean invert)

    - #### isInvert

          public boolean isInvert()

    - #### setIsRegex

          public void setIsRegex(boolean flag)

    - #### isUseRegex

          public boolean isUseRegex()

    - #### getResult

          public AssertionResult getResult(SampleResult samplerResult)

      Description copied from interface: `Assertion`
      Returns the AssertionResult object encapsulating information about the success or failure of the assertion.
      Specified by:
        `getResult` in interface `Assertion`
      Parameters:
        `samplerResult` - the SampleResult containing information about the Sample (duration, success, etc)
      Returns:
        the AssertionResult containing the information about whether the assertion passed or failed.

    - #### objectToString

          public static java.lang.String objectToString(java.lang.Object subj)

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