Package jadex.base.test
Class TestReport
- java.lang.Object
-
- jadex.base.test.TestReport
-
public class TestReport extends java.lang.ObjectA test report captures the description and results of a test.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdescriptionThe test description.protected java.lang.StringnameThe test name .protected java.lang.StringreasonThe failure reason.protected booleansucceededThe test success.
-
Constructor Summary
Constructors Constructor Description TestReport()Create a new test report.TestReport(java.lang.String name, java.lang.String description)Create a new test report.TestReport(java.lang.String name, java.lang.String description, boolean succeded, java.lang.String reason)Create a new test report.TestReport(java.lang.String name, java.lang.String description, java.lang.Exception reason)Create a new test report.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()Get the description.java.lang.StringgetName()Get the name.java.lang.StringgetReason()Get the failure reason.booleanisFinished()Is the test finished, i.e.booleanisSucceeded()Has the test succeeded.voidsetDescription(java.lang.String description)Set the description.voidsetFailed(java.lang.Exception reason)Set the report result to failed and set the failure reason.voidsetFailed(java.lang.String reason)Set the report result to failed and set the failure reason.voidsetName(java.lang.String name)Set the name.voidsetReason(java.lang.String reason)Set the failure reason.voidsetSucceeded(boolean succeded)Set the test success.java.lang.StringtoString()Returns a string representation of the object.
-
-
-
Constructor Detail
-
TestReport
public TestReport()
Create a new test report.
-
TestReport
public TestReport(java.lang.String name, java.lang.String description)Create a new test report.
-
TestReport
public TestReport(java.lang.String name, java.lang.String description, boolean succeded, java.lang.String reason)Create a new test report.
-
TestReport
public TestReport(java.lang.String name, java.lang.String description, java.lang.Exception reason)Create a new test report.
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name.- Returns:
- The name.
-
setName
public void setName(java.lang.String name)
Set the name.- Parameters:
name- The name.
-
getDescription
public java.lang.String getDescription()
Get the description.- Returns:
- The description.
-
setDescription
public void setDescription(java.lang.String description)
Set the description.- Parameters:
description- The description.
-
isSucceeded
public boolean isSucceeded()
Has the test succeeded.- Returns:
- True, if test was successful.
-
isFinished
public boolean isFinished()
Is the test finished, i.e. failed or succeeded?
-
setSucceeded
public void setSucceeded(boolean succeded)
Set the test success.- Parameters:
succeded- True on success.
-
getReason
public java.lang.String getReason()
Get the failure reason.- Returns:
- The failure reason.
-
setReason
public void setReason(java.lang.String reason)
Set the failure reason.- Parameters:
reason- The failure reason.
-
setFailed
public void setFailed(java.lang.Exception reason)
Set the report result to failed and set the failure reason.- Parameters:
reason- The failure reason.
-
setFailed
public void setFailed(java.lang.String reason)
Set the report result to failed and set the failure reason.- Parameters:
reason- The failure reason.
-
toString
public java.lang.String toString()
Returns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object.
-
-