Package org.apache.jmeter.assertions
Class XPathAssertion
-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Cloneable,org.apache.jmeter.assertions.Assertion,org.apache.jmeter.gui.Searchable,org.apache.jmeter.testelement.TestElement
public class XPathAssertion extends AbstractScopedAssertion implements Serializable, Assertion
Checks if the result is a well-formed XML content and whether it matches an XPath
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringDEFAULT_XPATHpublic transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description XPathAssertion()
-
Method Summary
Modifier and Type Method Description AssertionResultgetResult(SampleResult response)Returns the result of the Assertion. StringgetXPathString()Get The XPath String that will be used in matching the document voidsetXPathString(String xpath)Set the XPath String this will be used as an xpath voidsetWhitespace(boolean whitespace)Set whether to ignore element whitespace voidsetValidating(boolean validate)Set use validation voidsetNamespace(boolean namespace)Set whether this is namespace aware voidsetTolerant(boolean tolerant)Set tolerant mode if required voidsetNegated(boolean negate)booleanisWhitespace()Is this whitespace ignored. booleanisValidating()Is this validating booleanisNamespace()Is this namespace aware? booleanisTolerant()Is this using tolerant mode? booleanisNegated()Negate the XPath test, that is return true if something is not found. voidsetReportErrors(boolean val)booleanreportErrors()voidsetShowWarnings(boolean val)booleanshowWarnings()voidsetQuiet(boolean val)booleanisQuiet()voidsetDownloadDTDs(boolean val)booleanisDownloadDTDs()-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse -
Methods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElement
fetchScope, getProps, getSchema, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable -
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getResult
AssertionResult getResult(SampleResult response)
Returns the result of the Assertion. Checks if the result is well-formed XML, and that the XPath expression is matched (or not, as the case may be)
-
getXPathString
String getXPathString()
Get The XPath String that will be used in matching the document
- Returns:
String xpath String
-
setXPathString
void setXPathString(String xpath)
Set the XPath String this will be used as an xpath
- Parameters:
xpath- String
-
setWhitespace
void setWhitespace(boolean whitespace)
Set whether to ignore element whitespace
- Parameters:
whitespace- Flag whether whitespace elements should be ignored
-
setValidating
void setValidating(boolean validate)
Set use validation
- Parameters:
validate- Flag whether validation should be used
-
setNamespace
void setNamespace(boolean namespace)
Set whether this is namespace aware
- Parameters:
namespace- Flag whether namespace should be used
-
setTolerant
void setTolerant(boolean tolerant)
Set tolerant mode if required
- Parameters:
tolerant- true/false
-
setNegated
void setNegated(boolean negate)
-
isWhitespace
boolean isWhitespace()
Is this whitespace ignored.
- Returns:
boolean
-
isValidating
boolean isValidating()
Is this validating
- Returns:
boolean
-
isNamespace
boolean isNamespace()
Is this namespace aware?
- Returns:
boolean
-
isTolerant
boolean isTolerant()
Is this using tolerant mode?
- Returns:
boolean
-
isNegated
boolean isNegated()
Negate the XPath test, that is return true if something is not found.
- Returns:
boolean negated
-
setReportErrors
void setReportErrors(boolean val)
-
reportErrors
boolean reportErrors()
-
setShowWarnings
void setShowWarnings(boolean val)
-
showWarnings
boolean showWarnings()
-
setQuiet
void setQuiet(boolean val)
-
isQuiet
boolean isQuiet()
-
setDownloadDTDs
void setDownloadDTDs(boolean val)
-
isDownloadDTDs
boolean isDownloadDTDs()
-
-
-
-