Class EolAssertionException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EUnitFailedModelComparisonException

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:
  • Constructor Details

    • EolAssertionException

      public EolAssertionException(String reason, ModuleElement ast, Object expected, Object actual, 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 Details

    • getExpected

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

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

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