Class SimpleReportEntry
- java.lang.Object
-
- org.apache.maven.surefire.api.report.SimpleReportEntry
-
- All Implemented Interfaces:
ReportEntry
,TestSetReportEntry
- Direct Known Subclasses:
CategorizedReportEntry
public class SimpleReportEntry extends Object implements TestSetReportEntry
Basic implementation ofTestSetReportEntry
(immutable and thread-safe object).- Author:
- Kristian Rosenvold
-
-
Constructor Summary
Constructors Constructor Description SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText)
SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, Integer elapsed)
SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, String message)
SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, Map<String,String> systemProperties)
SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter, Integer elapsed)
SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter, Integer elapsed, String message, Map<String,String> systemProperties)
SimpleReportEntry(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter, Integer elapsed, Map<String,String> systemProperties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimpleReportEntry
assumption(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, String message)
boolean
equals(Object o)
Integer
getElapsed()
Gets the runtime for the item.int
getElapsed(int fallback)
String
getGroup()
The group/category of the testcaseString
getMessage()
A message relating to a non-successful termination.String
getName()
The name of the test caseString
getNameText()
Human readabletest case
.String
getNameWithGroup()
A source name of the test case together with the group or category (if any exists).String
getReportNameWithGroup()
A source text of the test case together with the group or category (if any exists).RunMode
getRunMode()
Run mode.String
getSourceName()
The class name of the testString
getSourceText()
Human readabletest class
.StackTraceWriter
getStackTraceWriter()
The group/category of the testcaseMap<String,String>
getSystemProperties()
Long
getTestRunId()
This represents a reference pointing to a literal representation of test description or literal unique id.int
hashCode()
static SimpleReportEntry
ignored(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, String message)
String
toString()
static SimpleReportEntry
withException(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter)
-
-
-
Constructor Detail
-
SimpleReportEntry
public SimpleReportEntry(@Nonnull RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText)
-
SimpleReportEntry
public SimpleReportEntry(@Nonnull RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, Map<String,String> systemProperties)
-
SimpleReportEntry
public SimpleReportEntry(@Nonnull RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, Integer elapsed)
-
SimpleReportEntry
public SimpleReportEntry(@Nonnull RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, String message)
-
SimpleReportEntry
public SimpleReportEntry(@Nonnull RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter, Integer elapsed, String message, Map<String,String> systemProperties)
-
SimpleReportEntry
public SimpleReportEntry(@Nonnull RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter, Integer elapsed)
-
-
Method Detail
-
assumption
public static SimpleReportEntry assumption(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, String message)
-
ignored
public static SimpleReportEntry ignored(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, String message)
-
withException
public static SimpleReportEntry withException(RunMode runMode, Long testRunId, String source, String sourceText, String name, String nameText, StackTraceWriter stackTraceWriter)
-
getSourceName
public String getSourceName()
Description copied from interface:ReportEntry
The class name of the test- Specified by:
getSourceName
in interfaceReportEntry
- Returns:
- A string with the class name
-
getSourceText
public String getSourceText()
Description copied from interface:ReportEntry
Human readabletest class
.- Specified by:
getSourceText
in interfaceReportEntry
- Returns:
- source text
-
getName
public String getName()
Description copied from interface:ReportEntry
The name of the test case- Specified by:
getName
in interfaceReportEntry
- Returns:
- A string describing the test case
-
getNameText
public String getNameText()
Description copied from interface:ReportEntry
Human readabletest case
.- Specified by:
getNameText
in interfaceReportEntry
- Returns:
- name text
-
getGroup
public String getGroup()
Description copied from interface:ReportEntry
The group/category of the testcase- Specified by:
getGroup
in interfaceReportEntry
- Returns:
- A string
-
getStackTraceWriter
public StackTraceWriter getStackTraceWriter()
Description copied from interface:ReportEntry
The group/category of the testcase- Specified by:
getStackTraceWriter
in interfaceReportEntry
- Returns:
- stack trace object
-
getElapsed
public Integer getElapsed()
Description copied from interface:ReportEntry
Gets the runtime for the item. Optional parameter. If the value is not set, it will be determined within the reporting subsystem. Some providers like to calculate this value themselves, and it gets the most accurate value.- Specified by:
getElapsed
in interfaceReportEntry
- Returns:
- duration of a test in milli seconds
-
getElapsed
public int getElapsed(int fallback)
Description copied from interface:ReportEntry
- Specified by:
getElapsed
in interfaceReportEntry
- Parameters:
fallback
- usually 0- Returns:
- elapsed time if
ReportEntry.getElapsed()
is not null; otherwise returnsfallback
-
getMessage
public String getMessage()
Description copied from interface:ReportEntry
A message relating to a non-successful termination. May be the "message" from an exception or the reason for a test being ignored- Specified by:
getMessage
in interfaceReportEntry
- Returns:
- A string that explains an anomaly
-
getNameWithGroup
public String getNameWithGroup()
Description copied from interface:ReportEntry
A source name of the test case together with the group or category (if any exists).- Specified by:
getNameWithGroup
in interfaceReportEntry
- Returns:
- A string with the test case name and group/category, or just the name.
-
getReportNameWithGroup
public String getReportNameWithGroup()
Description copied from interface:ReportEntry
A source text of the test case together with the group or category (if any exists).- Specified by:
getReportNameWithGroup
in interfaceReportEntry
- Returns:
- A string with the test case text and group/category, or just the source text. If no source text is provided, then this will return null.
-
getRunMode
@Nonnull public final RunMode getRunMode()
Description copied from interface:ReportEntry
Run mode.- Specified by:
getRunMode
in interfaceReportEntry
- Returns:
- a normal run, or re-run.
-
getTestRunId
public final Long getTestRunId()
Description copied from interface:ReportEntry
This represents a reference pointing to a literal representation of test description or literal unique id.- Specified by:
getTestRunId
in interfaceReportEntry
- Returns:
- id
-
getSystemProperties
public Map<String,String> getSystemProperties()
- Specified by:
getSystemProperties
in interfaceTestSetReportEntry
-
-