Package com.xceptance.xlt.api.validators
Class XHTMLValidator
java.lang.Object
com.xceptance.xlt.api.validators.XHTMLValidator
This validator executes JTidy to check the returned HTML code for standard conformance. It supports different level
of stoppage in case of validation problems.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XHTMLValidatorReturns the an instance of this validator.voidvalidate(LightWeightPage page) Validates the specified lightweight HTML page.voidDoes the validation and raises an exception if configured.voidValidates the specified HTML page.
-
Constructor Details
-
XHTMLValidator
public XHTMLValidator(boolean breakOnErrors, boolean breakOnWarnings) Constructor.- Parameters:
breakOnErrors- should we issue an assertion in case of errorsbreakOnWarnings- should we issue an assertion in case of warnings
-
-
Method Details
-
validate
Validates the specified HTML page.- Parameters:
page- the page to check- Throws:
AssertionError- if the page fails validationException
-
validate
Validates the specified lightweight HTML page.- Parameters:
page- the page to check- Throws:
AssertionError- if the page fails validationException
-
validate
Does the validation and raises an exception if configured. You can use this method directly, but it is encouraged to use the default validator method instead.- Parameters:
content- the page to validate- Throws:
Exception- an exception in case of an error
-
getInstance
Returns the an instance of this validator. The validation itself can be switched ON/OFF by property.Note, assuming the validator is enabled by property, it will stop on ALL errors and ALL warnings.
- Returns:
- the default instance
-