|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TKTestListener
TKTestListener is a listener interface for listeners that want to be informed of the run times of tests, the memory
usage of tests, the 'size' parameters of parameterized tests and the begin and end events of complete test runs.
TKTestResult
is an example of a test result class that listeners
interested in these events can be attached to.
The timing(junit.framework.Test, long, Long)
, memoryUsed(junit.framework.Test, long, long, Long)
,
parameterValue(junit.framework.Test, int, Long)
and endTest(junit.framework.Test, Long)
methods
all accept on optional thread id parameter.
Responsibilities |
---|
Listen to test timings. |
Listen to test memory usages. |
Listen to parameterized test parameters. |
Method Summary | |
---|---|
void |
addFailure(junit.framework.Test test,
junit.framework.AssertionFailedError e,
Long threadId)
Called when a test completes to mark it as a test fail. |
void |
concurrencyLevel(junit.framework.Test test,
int threads,
Long threadId)
Should be called every time a test completes with the current number of test threads running. |
void |
endBatch(Properties parameters)
Notifies listeners of the end of a complete run of tests. |
void |
endTest(junit.framework.Test test,
Long threadId)
Called when a test completes. |
void |
memoryUsed(junit.framework.Test test,
long memStart,
long memEnd,
Long threadId)
Should be called every time a test completed with the amount of memory used before and after the test was run. |
void |
parameterValue(junit.framework.Test test,
int parameter,
Long threadId)
Should be called every time a parameterized test completed with the int value of its test parameter. |
void |
properties(Properties properties)
Notifies listeners of the tests read/set properties. |
void |
reset(junit.framework.Test test,
Long threadId)
Resets the test results to the default state of time zero, memory usage zero, parameter zero, test passed. |
void |
startBatch()
Notifies listeners of the start of a complete run of tests. |
void |
timing(junit.framework.Test test,
long nanos,
Long threadId)
Should be called every time a test completes with the run time of that test. |
void |
timing2(junit.framework.Test test,
Long nanos,
Long threadId)
Optionally called every time a test completes with the second timing test. |
Methods inherited from interface junit.framework.TestListener |
---|
addError, addFailure, endTest, startTest |
Method Detail |
---|
void reset(junit.framework.Test test, Long threadId)
test
- The test to resest any results for.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void timing(junit.framework.Test test, long nanos, Long threadId)
test
- The name of the test.nanos
- The run time of the test in nanoseconds.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void timing2(junit.framework.Test test, Long nanos, Long threadId)
test
- The name of the test.nanos
- The second timing information of the test in nanoseconds.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void memoryUsed(junit.framework.Test test, long memStart, long memEnd, Long threadId)
test
- The test which memory was measured for.memStart
- The total JVM memory used before the test was run.memEnd
- The total JVM memory used after the test was run.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void parameterValue(junit.framework.Test test, int parameter, Long threadId)
test
- The test which memory was measured for.parameter
- The int parameter value.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void concurrencyLevel(junit.framework.Test test, int threads, Long threadId)
test
- The test for which the measurement is being generated.threads
- The number of tests being run concurrently.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void endTest(junit.framework.Test test, Long threadId)
test
- The test which completed.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError e, Long threadId)
test
- The test which failed.e
- The assertion that failed the test.threadId
- Optional thread id if not calling from thread that started the test method. May be null.void startBatch()
void endBatch(Properties parameters)
parameters
- The optional test parameters to log out with the batch results.void properties(Properties properties)
properties
- The tests read/set properties.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |