|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.suiterunner.Report
Class used to send reports to a reporter.
An instance of class Report
contains a source, thread, date, name,
message, and optional throwable and rerunnable. This class can be subclassed to send more information
to a reporter.
Constructor Summary | |
Report(java.lang.Object source,
java.lang.String name,
java.lang.String message)
Constructs a new Report with specified source, name,
and message. |
|
Report(java.lang.Object source,
java.lang.String name,
java.lang.String message,
Rerunnable rerunnable)
Constructs a new Report with specified source, name,
message, and rerunnable. |
|
Report(java.lang.Object source,
java.lang.String name,
java.lang.String message,
java.lang.Throwable throwable)
Constructs a new Report with specified source, name,
message, and throwable. |
|
Report(java.lang.Object source,
java.lang.String name,
java.lang.String message,
java.lang.Throwable throwable,
Rerunnable rerunnable)
Constructs a new Report with specified source, name,
message, throwable, and rerunnable. |
|
Report(java.lang.Object source,
java.lang.String name,
java.lang.String message,
java.lang.Throwable throwable,
Rerunnable rerunnable,
java.lang.Thread thread,
java.util.Date date)
Constructs a new Report with specified source, name,
message, throwable, rerunnable, thread, and date. |
Method Summary | |
java.util.Date |
getDate()
Get the Date embedded in this Report . |
java.lang.String |
getMessage()
Get a String message. |
java.lang.String |
getName()
Get a String name of the entity about which this Report was generated. |
Rerunnable |
getRerunnable()
Get a Rerunnable that can be used to rerun the test or other entity
reported about by this Report , or null if the
test or other entity cannot be rerun. |
java.lang.Object |
getSource()
Get the object that generated this report. |
java.lang.Thread |
getThread()
Get the Thread about whose activity this Report was generated. |
java.lang.Throwable |
getThrowable()
Get a Throwable that indicated the condition
reported by this Report . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Report(java.lang.Object source, java.lang.String name, java.lang.String message)
Report
with specified source, name,
and message.source
- the object that generated this report. The source object likely represents
some kind of conceptual test or suite of tests, such as for example an instance
of org.suiterunner.Suite
.name
- the name of the entity about which this report was generated.message
- a String
message.public Report(java.lang.Object source, java.lang.String name, java.lang.String message, java.lang.Throwable throwable)
Report
with specified source, name,
message, and throwable.source
- the object that generated this report. The source object likely represents
some kind of conceptual test or suite of tests, such as for example an instance
of org.suiterunner.Suite
.name
- the name of the entity about which this report was generated.message
- a String
message.throwable
- a relevant Throwable
. For example, this
Throwable
may have indicated a problem being reported by this
Report
, or it may have been created to provide stack trace
information in the Report
.public Report(java.lang.Object source, java.lang.String name, java.lang.String message, Rerunnable rerunnable)
Report
with specified source, name,
message, and rerunnable.source
- the object that generated this report. The source object likely represents
some kind of conceptual test or suite of tests, such as for example an instance
of org.suiterunner.Suite
.name
- the name of the entity about which this report was generated.message
- a String
message.rerunnable
- a Rerunnable
that can be used to rerun a test.NullPointerException
- if any of the specified source
,
name
, message
, or rerunnable
parameters are null
.public Report(java.lang.Object source, java.lang.String name, java.lang.String message, java.lang.Throwable throwable, Rerunnable rerunnable)
Report
with specified source, name,
message, throwable, and rerunnable.source
- the object that generated this report. The source object likely represents
some kind of conceptual test or suite of tests, such as for example an instance
of org.suiterunner.Suite
.name
- the name of the entity about which this report was generated.message
- a String
message.throwable
- a relevant Throwable
. For example, this
Throwable
may have indicated a problem being reported by this
Report
, or it may have been created to provide stack trace
information in the Report
.rerunnable
- a Rerunnable
that can be used to rerun a test.NullPointerException
- if any of the specified source
,
name
, message
, throwable
,
or rerunnable
parameters are null
.public Report(java.lang.Object source, java.lang.String name, java.lang.String message, java.lang.Throwable throwable, Rerunnable rerunnable, java.lang.Thread thread, java.util.Date date)
Report
with specified source, name,
message, throwable, rerunnable, thread, and date.source
- the object that generated this report. The source object likely represents
some kind of conceptual test or suite of tests, such as for example an instance
of org.suiterunner.Suite
.name
- the name of the entity about which this report was generated.message
- a String
message.throwable
- the Throwable
that indicated the problem, or a Throwable
created
to capture stack trace information about the problem, or null
. If null is passed, the problem
is reported without describing a Throwable
and no exception is thrown by this constructor.rerunnable
- a Rerunnable
that can be used to rerun a test (usually a failed
test), or null
. If null
is passed, the test can not be rerun and no
exception is thrown by this constructor.thread
- the Thread
about whose activity this report was generated.date
- a relevant Date
. For example, the a Date
indicating the time this Report
was generated, or a Date
indicating the time the event reported by this Report
occurred.NullPointerException
- if any of the specified source
,
name
, message
, thread
, or
date
references are null
. (Note that
null
references are allowed in the throwable
and rerunnable
parameters.)Method Detail |
public java.lang.Object getSource()
Object
that generated this Report
. This method
will never return null
.public java.lang.String getName()
String
name of the entity about which this Report
was generated.Report
was generated. This method
will never return null
.public java.lang.String getMessage()
String
message.null
.public java.lang.Throwable getThrowable()
Throwable
that indicated the condition
reported by this Report
. If the condition reported by
this Report
was not indicated by a Throwable
,
this method returns null
.Throwable
that indicated the condition reported
by this Report
, or null
.public Rerunnable getRerunnable()
Rerunnable
that can be used to rerun the test or other entity
reported about by this Report
, or null
if the
test or other entity cannot be rerun. Invoking rerun
on the returned
Rerunnable
reruns the test. Results will be reported to the
Reporter
passed to the rerun
method.Rerunnable
that can be used to rerun a test, or null
.public java.lang.Thread getThread()
Thread
about whose activity this Report
was generated. Often,
the Thread
returned will be the Thread
that "fired" this Report
,
i.e., the Thread
that created this Report
and
passed it to a Reporter
. Nevertheless, the Thread
a returned need not always be the
firing Thread
. Thread
A, for example, may wish to report on the activity of a
Thread
B. Thread
A can pass Thread
B to the Report
constructor. Although Thread
A is in this case the firing Thread
, the
getThread
method will return Thread
B.Thread
about whose activity this Report
was generated. This method
will never return null
.public java.util.Date getDate()
Date
embedded in this Report
. Often, this Date
will
represent the time at which the Report
was created, but may also legally represent any
other application-specific timestamp.Date
embedded in this Report
. This method
will never return null
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |