Class EolAssertionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.eclipse.epsilon.eol.exceptions.EolRuntimeException
-
- org.eclipse.epsilon.eol.exceptions.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
-
-
Field Summary
-
Fields inherited from class org.eclipse.epsilon.eol.exceptions.EolRuntimeException
ast, context, message, reason
-
-
Constructor Summary
Constructors Constructor Description EolAssertionException(java.lang.String reason, ModuleElement ast, java.lang.Object expected, java.lang.Object actual, java.lang.Object delta)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetActual()Returns the actual value, ornullif not available.java.lang.ObjectgetDelta()Returns the precomputed difference between the expected and the actual value, ornullif not available.java.lang.ObjectgetExpected()Returns the expected value, ornullif not available.-
Methods inherited from class org.eclipse.epsilon.eol.exceptions.EolRuntimeException
findCause, getAst, getColumn, getLine, getMessage, getReason, propagate, propagateDetailed, setAst, setMessage, setReason, toString, wrap
-
-
-
-
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,actualanddelta:- None are
null: expected and actual values are available, and their difference has been precomputed. deltaisnull: expected and actual values are available, but the difference has not been precomputed. A regular text-based line-by-line comparison will be used.- All three are
null: no information is available. This may happen when calling thefail(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.
- None are
-
-
Method Detail
-
getExpected
public java.lang.Object getExpected()
Returns the expected value, ornullif not available.
-
getActual
public java.lang.Object getActual()
Returns the actual value, ornullif not available.
-
getDelta
public java.lang.Object getDelta()
Returns the precomputed difference between the expected and the actual value, ornullif not available.
-
-