public static interface Statistics.StatisticsForTest
Modifier and Type | Method and Description |
---|---|
void |
addDouble(java.lang.String statisticName,
double value)
Add
value to the double statistic
statisticName . |
void |
addLong(java.lang.String statisticName,
long value)
Add
value to the long statistic statisticName . |
double |
getDouble(java.lang.String statisticName)
Return the value of the double statistic
statisticName . |
long |
getLong(java.lang.String statisticName)
Return the value of long statistic
statisticName . |
boolean |
getSuccess()
Convenience method that returns whether the test was a success
(errors is zero) or not.
|
Test |
getTest()
Return the Test that the statistics are for.
|
long |
getTime()
Returns the elapsed time for the test.
|
void |
setDouble(java.lang.String statisticName,
double value)
Sets the double statistic
statisticName to the specified
value . |
void |
setLong(java.lang.String statisticName,
long value)
Sets the long statistic
statisticName to the specified
value . |
void |
setSuccess(boolean success)
Convenience method that sets whether the last test should be considered a
success or not.
|
Test getTest()
void setLong(java.lang.String statisticName, long value) throws InvalidContextException, NoSuchStatisticException
statisticName
to the specified
value
.statisticName
- The statistic name. See Statistics
for a list of valid
names.value
- The value.InvalidContextException
- If called when the statistics have already been sent for the
last test performed by this thread - see
Statistics.setDelayReports(boolean)
.NoSuchStatisticException
- If statisticName
does not refer to a known basic
long statistic.void setDouble(java.lang.String statisticName, double value) throws InvalidContextException, NoSuchStatisticException
statisticName
to the specified
value
.statisticName
- The statistic name. See Statistics
for a list of valid
names.value
- The value.InvalidContextException
- If called when the statistics have already been sent for the
last test performed by this thread - see
Statistics.setDelayReports(boolean)
.NoSuchStatisticException
- If statisticName
does not refer to a known basic
double statistic.void addLong(java.lang.String statisticName, long value) throws InvalidContextException, NoSuchStatisticException
value
to the long statistic statisticName
.statisticName
- The statistic name. See Statistics
for a list of valid
names.value
- The value.InvalidContextException
- If called when the statistics have already been sent for the
last test performed by this thread - see
Statistics.setDelayReports(boolean)
.NoSuchStatisticException
- If statisticName
does not refer to a known basic
long statistic.void addDouble(java.lang.String statisticName, double value) throws InvalidContextException, NoSuchStatisticException
value
to the double statistic
statisticName
.statisticName
- The statistic name. See Statistics
for a list of valid
names.value
- The value.InvalidContextException
- If called when the statistics have already been sent for the
last test performed by this thread - see
Statistics.setDelayReports(boolean)
.NoSuchStatisticException
- If statisticName
does not refer to a known basic
double statistic.long getLong(java.lang.String statisticName) throws NoSuchStatisticException
statisticName
.statisticName
- The statistic name. See Statistics
for a list of valid
names.NoSuchStatisticException
- If statisticName
does not refer to a known
basic long statistic.double getDouble(java.lang.String statisticName) throws NoSuchStatisticException
statisticName
.statisticName
- The statistic name. See Statistics
for a list of valid
names.NoSuchStatisticException
- If statisticName
does not refer to a known basic
double statistic.void setSuccess(boolean success) throws InvalidContextException
success
- If true
errors is set to
0
, otherwise errors is set to
1
.InvalidContextException
- If called when the statistics have already been sent for the
last test performed by this thread - see
Statistics.setDelayReports(boolean)
.boolean getSuccess()
long getTime()
If this StatisticsForTest
was
obtained with Statistics.getForCurrentTest()
, the result will be
the elapsed time since the test in progress was started. If it was
obtained with Statistics.getForLastTest()
, the result will be the
time taken by the last test.
getTime()
always returns the time taken by the test, even if the
test was an error and the time will not be added to timedTests.