org.apache.jmeter.assertions

Class XPathAssertion

Implemented Interfaces:
Serializable, Assertion, Cloneable, Serializable, TestElement

public class XPathAssertion
extends AbstractTestElement
implements Serializable, Assertion

Checks if the result is a well-formed XML content and whether it matches an XPath

Field Summary

static String
DEFAULT_XPATH

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

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Method Summary

AssertionResult
getResult(SampleResult response)
Returns the result of the Assertion.
String
getXPathString()
Get The XPath String that will be used in matching the document
boolean
isNamespace()
Is this namespace aware?
boolean
isNegated()
Negate the XPath test, that is return true if something is not found.
boolean
isQuiet()
boolean
isTolerant()
Is this using tolerant mode?
boolean
isValidating()
Is this validating
boolean
isWhitespace()
Is this whitepsace ignored.
boolean
reportErrors()
void
setNamespace(boolean namespace)
Set whether this is namespace aware
void
setNegated(boolean negate)
void
setQuiet(boolean val)
void
setReportErrors(boolean val)
void
setShowWarnings(boolean val)
void
setTolerant(boolean tolerant)
Set tolerant mode if required
void
setValidating(boolean validate)
Set use validation
void
setWhitespace(boolean whitespace)
Set whether to ignore element whitespace
void
setXPathString(String xpath)
Set the XPath String this will be used as an xpath
boolean
showWarnings()

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

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

Field Details

DEFAULT_XPATH

public static final String DEFAULT_XPATH

Method Details

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)
Specified by:
getResult in interface Assertion

getXPathString

public String getXPathString()
Get The XPath String that will be used in matching the document
Returns:
String xpath String

isNamespace

public boolean isNamespace()
Is this namespace aware?
Returns:
boolean

isNegated

public boolean isNegated()
Negate the XPath test, that is return true if something is not found.
Returns:
boolean negated

isQuiet

public boolean isQuiet()

isTolerant

public boolean isTolerant()
Is this using tolerant mode?
Returns:
boolean

isValidating

public boolean isValidating()
Is this validating
Returns:
boolean

isWhitespace

public boolean isWhitespace()
Is this whitepsace ignored.
Returns:
boolean

reportErrors

public boolean reportErrors()

setNamespace

public void setNamespace(boolean namespace)
Set whether this is namespace aware
Parameters:
namespace -

setNegated

public void setNegated(boolean negate)

setQuiet

public void setQuiet(boolean val)

setReportErrors

public void setReportErrors(boolean val)

setShowWarnings

public void setShowWarnings(boolean val)

setTolerant

public void setTolerant(boolean tolerant)
Set tolerant mode if required
Parameters:
tolerant - true/false

setValidating

public void setValidating(boolean validate)
Set use validation
Parameters:
validate -

setWhitespace

public void setWhitespace(boolean whitespace)
Set whether to ignore element whitespace
Parameters:
whitespace -

setXPathString

public void setXPathString(String xpath)
Set the XPath String this will be used as an xpath
Parameters:
xpath - String

showWarnings

public boolean showWarnings()

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