Class AssertionLogMessage
java.lang.Object
de.qytera.qtaf.core.log.model.message.LogMessage
de.qytera.qtaf.core.log.model.message.AssertionLogMessage
Entity class for assertion log messages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjectActual object.protected booleanAssertion condition.protected ThrowableWrapperAssertion Error.protected ObjectExpected object.protected de.qytera.qtaf.core.log.model.message.AssertionLogMessage.StatusAssertion status.protected StepInformationLogMessageStep of assertion.protected AssertionLogMessageTypeType of assertion.Fields inherited from class de.qytera.qtaf.core.log.model.message.LogMessage
abstractScenarioId, featureId, level, message, scenarioId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactual()Returns the assertion's actual object.booleanReturns the assertion's condition.error()Returns the assertion's error.expected()Returns the assertion's expected object.booleanReturns whether the assertion has failed.booleanReturns whether the assertion has passed.Set the actual object.setCondition(boolean condition) Set the assertion's condition.setError(AssertionError error) Set the assertion's error.setExpected(Object expected) Set the expected object.Set the assertion status to failed.Set the assertion status to passed.Set the step where the assertion was executed.Set the assertion's type.step()Returns the assertion's step.type()Returns the assertion's type.booleanReturns whether the assertion was actually executed.Methods inherited from class de.qytera.qtaf.core.log.model.message.LogMessage
getAbstractScenarioId, getFeatureId, getLevel, getMessage, getScenarioId, setAbstractScenarioId, setFeatureId, setLevel, setMessage, setScenarioId
-
Field Details
-
type
Type of assertion. -
step
Step of assertion. This attribute needs to be transient so that it is ignored by JSON serializers. Otherwise, this causes a stack overflow, because it is a circular reference. -
status
protected de.qytera.qtaf.core.log.model.message.AssertionLogMessage.Status statusAssertion status. -
condition
protected boolean conditionAssertion condition. -
actual
Actual object. -
expected
Expected object. -
error
Assertion Error.
-
-
Constructor Details
-
AssertionLogMessage
Constructor.- Parameters:
level- log levelmessage- log message
-
-
Method Details
-
type
Returns the assertion's type.- Returns:
- the type
-
setType
Set the assertion's type.- Parameters:
type- the type- Returns:
- the current assertion
-
step
Returns the assertion's step.- Returns:
- the step
-
setStep
Set the step where the assertion was executed.- Parameters:
step- step log message- Returns:
- this
-
condition
public boolean condition()Returns the assertion's condition.- Returns:
- the condition
-
setCondition
Set the assertion's condition.- Parameters:
condition- the condition- Returns:
- the current assertion
-
actual
Returns the assertion's actual object.- Returns:
- the actual object
-
setActual
Set the actual object.- Parameters:
actual- the actual object- Returns:
- the current assertion
-
expected
Returns the assertion's expected object.- Returns:
- the expected object
-
setExpected
Set the expected object.- Parameters:
expected- the expected object- Returns:
- the current assertion
-
error
Returns the assertion's error.- Returns:
- the error
-
setError
Set the assertion's error.- Parameters:
error- the error- Returns:
- the current assertion
-
wasExecuted
public boolean wasExecuted()Returns whether the assertion was actually executed.- Returns:
- true if it was executed, false otherwise
-
hasPassed
public boolean hasPassed()Returns whether the assertion has passed.- Returns:
- true if it passed, false otherwise
-
hasFailed
public boolean hasFailed()Returns whether the assertion has failed.- Returns:
- true if it failed, false otherwise
-
setStatusToPassed
Set the assertion status to passed.- Returns:
- the current assertion
-
setStatusToFailed
Set the assertion status to failed.- Returns:
- the current assertion
-