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 TypeMethodDescriptionbooleanChecks if this validator is equal to another one.intReturns the set response code.static HttpResponseCodeValidatorReturns an instance of this class with 200 as the response code against which to validate.inthashCode()voidvalidate(LightWeightPage page) Validates the specified lightweight HTML page.voidValidates 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()
-