Class EolAssertionException

  • All Implemented Interfaces:
    java.io.Serializable

    public class EolAssertionException
    extends EolRuntimeException
    Exception which is thrown when the expectations in a test case are not met. These exceptions include information about the expected value and the value which was obtained, if available. Optionally, a custom object representing the difference between the expected and actual value can be stored.
    See Also:
    Serialized Form
    • Constructor Detail

      • EolAssertionException

        public EolAssertionException​(java.lang.String reason,
                                     ModuleElement ast,
                                     java.lang.Object expected,
                                     java.lang.Object actual,
                                     java.lang.Object delta)

        Creates a new instance. There are three acceptable combinations for the values of expected, actual and delta:

        1. None are null: expected and actual values are available, and their difference has been precomputed.
        2. delta is null: expected and actual values are available, but the difference has not been precomputed. A regular text-based line-by-line comparison will be used.
        3. All three are null: no information is available. This may happen when calling the fail(msg) built-in operation, for instance, or when using assertNotEquals (it may not make sense to present differences when they are really the same).
        Parameters:
        reason - String explaining the expectation which was not met.
        ast - AST node of the call to the assertion operation whose test failed.
        expected - Expected value, if applicable. Otherwise, null.
        actual - Actual value, if applicable. Otherwise, null.
        delta - Precomputed delta between the values, if available. Otherwise, null.
    • Method Detail

      • getExpected

        public java.lang.Object getExpected()
        Returns the expected value, or null if not available.
      • getActual

        public java.lang.Object getActual()
        Returns the actual value, or null if not available.
      • getDelta

        public java.lang.Object getDelta()
        Returns the precomputed difference between the expected and the actual value, or null if not available.