Class HTMLAssertion

    • Constructor Detail

      • HTMLAssertion

        public HTMLAssertion()
    • Method Detail

      • getResult

        public AssertionResult getResult​(SampleResult inResponse)
        Returns the result of the Assertion. If so an AssertionResult containing a FailureMessage will be returned. Otherwise the returned AssertionResult will reflect the success of the Sample.
        Specified by:
        getResult in interface Assertion
        Parameters:
        inResponse - the SampleResult containing information about the Sample (duration, success, etc)
        Returns:
        the AssertionResult containing the information about whether the assertion passed or failed.
      • getDoctype

        public String getDoctype()
        Gets the doctype
        Returns:
        the documemt type
      • isErrorsOnly

        public boolean isErrorsOnly()
        Check if errors will be reported only
        Returns:
        boolean - report errors only?
      • getErrorThreshold

        public long getErrorThreshold()
        Gets the threshold setting for errors
        Returns:
        long error threshold
      • getWarningThreshold

        public long getWarningThreshold()
        Gets the threshold setting for warnings
        Returns:
        long warning threshold
      • setDoctype

        public void setDoctype​(String inDoctype)
        Sets the doctype setting
        Parameters:
        inDoctype - The doctype to be set. If doctype is null or a blank string, DEFAULT_DOCTYPE will be used
      • setErrorsOnly

        public void setErrorsOnly​(boolean inErrorsOnly)
        Sets if errors should be tracked only
        Parameters:
        inErrorsOnly - Flag whether only errors should be tracked
      • setErrorThreshold

        public void setErrorThreshold​(long inErrorThreshold)
        Sets the threshold on error level
        Parameters:
        inErrorThreshold - The max number of parse errors which are to be tolerated
        Throws:
        IllegalArgumentException - if inErrorThreshold is less or equals zero
      • setWarningThreshold

        public void setWarningThreshold​(long inWarningThreshold)
        Sets the threshold on warning level
        Parameters:
        inWarningThreshold - The max number of warnings which are to be tolerated
        Throws:
        IllegalArgumentException - if inWarningThreshold is less or equal zero
      • setHTML

        public void setHTML()
        Enables html validation mode
      • isHTML

        public boolean isHTML()
        Check if html validation mode is set
        Returns:
        boolean
      • setXHTML

        public void setXHTML()
        Enables xhtml validation mode
      • isXHTML

        public boolean isXHTML()
        Check if xhtml validation mode is set
        Returns:
        boolean
      • setXML

        public void setXML()
        Enables xml validation mode
      • isXML

        public boolean isXML()
        Check if xml validation mode is set
        Returns:
        boolean
      • getFilename

        public String getFilename()
        Sets the name of the file where tidy writes the output to
        Returns:
        name of file
      • setFilename

        public void setFilename​(String inName)
        Sets the name of the tidy output file
        Parameters:
        inName - The name of the file tidy will put its output to