Package com.xceptance.xlt.api.validators
Class HttpResponseCodeValidator
- java.lang.Object
-
- com.xceptance.xlt.api.validators.HttpResponseCodeValidator
-
public class HttpResponseCodeValidator extends java.lang.ObjectThis class validates response codes and can be used as an instance (constructor) or as a global instance for easy reuse by callinggetInstance().
-
-
Constructor Summary
Constructors Constructor Description HttpResponseCodeValidator()Constructor, using 200 as response code for validation.HttpResponseCodeValidator(int httpResponseCode)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Checks if this validator is equal to another one.intgetHttpResponseCode()Returns the set response code.static HttpResponseCodeValidatorgetInstance()Returns 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.voidvalidate(HtmlPage page)Validates the specified HTML page.
-
-
-
Method Detail
-
validate
public void validate(HtmlPage page)
Validates the specified HTML page.- Parameters:
page- the page to check- Throws:
java.lang.AssertionError- if the page fails validation
-
validate
public void validate(LightWeightPage page)
Validates the specified lightweight HTML page.- Parameters:
page- the page to check- Throws:
java.lang.AssertionError- if the page fails validation
-
getHttpResponseCode
public int getHttpResponseCode()
Returns the set response code.- Returns:
- the set response code
-
getInstance
public static HttpResponseCodeValidator 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
public boolean equals(java.lang.Object obj)
Checks if this validator is equal to another one. It is equal, when it supports the same response code.- Overrides:
equalsin classjava.lang.Object- Returns:
- true if both validators check for the same response code, false otherwise
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-