Package com.xceptance.xlt.api.validators
Class HttpResponseCodeValidator
java.lang.Object
com.xceptance.xlt.api.validators.HttpResponseCodeValidator
This class validates response codes and can be used as an instance (constructor) or as a global instance for easy
reuse by calling
getInstance()
.-
Constructor Summary
ConstructorsConstructorDescriptionConstructor, using 200 as response code for validation.HttpResponseCodeValidator
(int httpResponseCode) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this validator is equal to another one.int
Returns the set response code.static HttpResponseCodeValidator
Returns an instance of this class with 200 as the response code against which to validate.int
hashCode()
void
validate
(LightWeightPage page) Validates the specified lightweight HTML page.void
Validates the specified HTML page.
-
Constructor Details
-
HttpResponseCodeValidator
public HttpResponseCodeValidator(int httpResponseCode) Constructor.- Parameters:
httpResponseCode
- the expected response code
-
HttpResponseCodeValidator
public HttpResponseCodeValidator()Constructor, using 200 as response code for validation.
-
-
Method Details
-
validate
Validates the specified HTML page.- Parameters:
page
- the page to check- Throws:
AssertionError
- if the page fails validation
-
validate
Validates the specified lightweight HTML page.- Parameters:
page
- the page to check- Throws:
AssertionError
- if the page fails validation
-
getHttpResponseCode
public int getHttpResponseCode()Returns the set response code.- Returns:
- the set response code
-
getInstance
Returns an instance of this class with 200 as the response code against which to validate.- Returns:
- an instance of HttpResponseCodeValidator with 200 as set response code
-
equals
Checks if this validator is equal to another one. It is equal, when it supports the same response code. -
hashCode
public int hashCode()
-