Package org.apache.jmeter.assertions
Class XPathAssertion
- java.lang.Object
-
- org.apache.jmeter.testelement.AbstractTestElement
-
- org.apache.jmeter.testelement.AbstractScopedTestElement
-
- org.apache.jmeter.testelement.AbstractScopedAssertion
-
- org.apache.jmeter.assertions.XPathAssertion
-
- All Implemented Interfaces:
Serializable,Cloneable,Assertion,Searchable,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- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_XPATH-
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
-
Constructor Summary
Constructors Constructor Description XPathAssertion()
-
Method Summary
All Methods Instance Methods Concrete Methods 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 documentbooleanisDownloadDTDs()booleanisNamespace()Is this namespace aware?booleanisNegated()Negate the XPath test, that is return true if something is not found.booleanisQuiet()booleanisTolerant()Is this using tolerant mode?booleanisValidating()Is this validatingbooleanisWhitespace()Is this whitepsace ignored.booleanreportErrors()voidsetDownloadDTDs(boolean val)voidsetNamespace(boolean namespace)Set whether this is namespace awarevoidsetNegated(boolean negate)voidsetQuiet(boolean val)voidsetReportErrors(boolean val)voidsetShowWarnings(boolean val)voidsetTolerant(boolean tolerant)Set tolerant mode if requiredvoidsetValidating(boolean validate)Set use validationvoidsetWhitespace(boolean whitespace)Set whether to ignore element whitespacevoidsetXPathString(String xpath)Set the XPath String this will be used as an xpathbooleanshowWarnings()-
Methods inherited from class org.apache.jmeter.testelement.AbstractScopedAssertion
getScopeName
-
Methods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElement
fetchScope, getSampleList, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable
-
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
-
-
-
-
Field Detail
-
DEFAULT_XPATH
public static final String DEFAULT_XPATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getResult
public 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
public String getXPathString()
Get The XPath String that will be used in matching the document- Returns:
- String xpath String
-
setXPathString
public void setXPathString(String xpath)
Set the XPath String this will be used as an xpath- Parameters:
xpath- String
-
setWhitespace
public void setWhitespace(boolean whitespace)
Set whether to ignore element whitespace- Parameters:
whitespace- Flag whether whitespace elements should be ignored
-
setValidating
public void setValidating(boolean validate)
Set use validation- Parameters:
validate- Flag whether validation should be used
-
setNamespace
public void setNamespace(boolean namespace)
Set whether this is namespace aware- Parameters:
namespace- Flag whether namespace should be used
-
setTolerant
public void setTolerant(boolean tolerant)
Set tolerant mode if required- Parameters:
tolerant- true/false
-
setNegated
public void setNegated(boolean negate)
-
isWhitespace
public boolean isWhitespace()
Is this whitepsace ignored.- Returns:
- boolean
-
isValidating
public boolean isValidating()
Is this validating- Returns:
- boolean
-
isNamespace
public boolean isNamespace()
Is this namespace aware?- Returns:
- boolean
-
isTolerant
public boolean isTolerant()
Is this using tolerant mode?- Returns:
- boolean
-
isNegated
public boolean isNegated()
Negate the XPath test, that is return true if something is not found.- Returns:
- boolean negated
-
setReportErrors
public void setReportErrors(boolean val)
-
reportErrors
public boolean reportErrors()
-
setShowWarnings
public void setShowWarnings(boolean val)
-
showWarnings
public boolean showWarnings()
-
setQuiet
public void setQuiet(boolean val)
-
isQuiet
public boolean isQuiet()
-
setDownloadDTDs
public void setDownloadDTDs(boolean val)
-
isDownloadDTDs
public boolean isDownloadDTDs()
-
-