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.booleanisValid()Returntruewhen assertion is valid.voidThrow 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:IAssertionReturntruewhen assertion is valid.- Specified by:
isValidin interfaceIAssertion- Returns:
trueon valid assertion
-
getStackTrace
Get a stacktrace of the location that raised the assertion.- Returns:
- stacktrace or
null
-
toString
-
throwOnError
Description copied from interface:IAssertionThrow exception in caseIAssertion.isValid()isfalse.- Specified by:
throwOnErrorin interfaceIAssertion- Throws:
AssertionException- whenIAssertion.isValid()isfalse
-