Package org.eclipse.ease.lang.unittest
Class DefaultAssertion
java.lang.Object
org.eclipse.ease.lang.unittest.DefaultAssertion
- All Implemented Interfaces:
IAssertion
A default implementation for
IAssertion
that adds support for error messages.-
Field Summary
Fields inherited from interface org.eclipse.ease.lang.unittest.IAssertion
INVALID, VALID
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAssertion
(boolean valid, String errorDescription) DefaultAssertion
(String errorDescription) Default constructor for invalid assertions.DefaultAssertion
(List<IScriptDebugFrame> stackTrace, boolean valid, String errorDescription) -
Method Summary
Modifier and TypeMethodDescriptionGet a stacktrace of the location that raised the assertion.boolean
isValid()
Returntrue
when assertion is valid.void
Throw exception in caseIAssertion.isValid()
isfalse
.toString()
-
Constructor Details
-
DefaultAssertion
-
DefaultAssertion
-
DefaultAssertion
Default constructor for invalid assertions.- Parameters:
errorDescription
- cause of error
-
-
Method Details
-
isValid
public boolean isValid()Description copied from interface:IAssertion
Returntrue
when assertion is valid.- Specified by:
isValid
in interfaceIAssertion
- Returns:
true
on valid assertion
-
getStackTrace
Get a stacktrace of the location that raised the assertion.- Returns:
- stacktrace or
null
-
toString
-
throwOnError
Description copied from interface:IAssertion
Throw exception in caseIAssertion.isValid()
isfalse
.- Specified by:
throwOnError
in interfaceIAssertion
- Throws:
AssertionException
- whenIAssertion.isValid()
isfalse
-