|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.TestResult
org.apache.qpid.junit.extensions.TKTestResult
public class TKTestResult
TKTestResult extends TestResult in order to calculate test timings, to pass the variable integer parameter for
parameterized test cases to those test cases and to introduce an optional delay before test starts. Interested
TKTestListener
s may be attached to this and will be informed of all relevant test statistics.
Responsibilities | Collaborations |
---|---|
Calculate test timings. | |
Inform timing listeners of timings. | |
Inform memory listeners of memory readings. | |
Inform parameters listeners of parameters. | |
Pass the integer parameter to parameterized test cases. | |
Provide verbose test information on test start and end. |
AsymptoticTestDecorator
.
The AsymptoticTestDecorator.run(junit.framework.TestResult)
method takes a TestResult as an argument and cannot easily get to the
AsymptoticTestCase
class other than through this class. The option of using this class as a place hold
for this value was chosen. Alternatively this class could provide a method for decorators to access the
underlying test case through and then leave the setting of this parameter to the decorator which is a more
natural home for this behaviour. It would also provide a more general framework for decorators., The memory usage may need to be moved in closer to the test method invocation so that as little code as possible
exists between it and the test or the results may be obscured. In fact it certainly does as the teardown method
is getting called first. Wouldn't be a bad idea to move the timing code in closer too., Get rid of the delay logic. Will be replaced by throttle control.Field Summary |
---|
Fields inherited from class junit.framework.TestResult |
---|
fErrors, fFailures, fListeners, fRunTests |
Constructor Summary | |
---|---|
TKTestResult(int delay,
String testCaseName)
Creates a new TKTestResult object. |
Method Summary | |
---|---|
void |
addTKTestListener(TKTestListener listener)
Adds a timing listener to pass all timing events to. |
void |
endTest(junit.framework.Test test)
Callback method use to inform this result that a test was completed. |
int |
getN()
Gets the integer parameter to pass to parameterized test cases. |
protected String |
getTestInfo(junit.framework.Test test)
Helper method that generats a String of verbose information about a test. |
void |
notifyEndBatch()
Called by the test runner to notify this that the current test batch has been ended. |
void |
notifyStartBatch()
Called by the test runner to notify this that a new test batch is being begun. |
void |
notifyTestProperties(Properties properties)
Called by the test runner to notify this of the properties that the test is using. |
protected void |
run(junit.framework.TestCase test)
Intercepts the execution of a test case to pass the variable integer parameter to a test if it is a parameterized test case. |
void |
setConcurrencyLevel(int concurrencyLevel)
Sets the concurrency level to pass into the test result. |
void |
setN(int n)
Sets the integer parameter to pass to parameterized test cases. |
void |
shutdownNow()
Tells this test result that it should stop running tests. |
void |
startTest(junit.framework.Test test)
Callback method use to inform this test result that a test will be started. |
String |
toString()
Prints a string summary of this class, mainly for debugging purposes. |
Methods inherited from class junit.framework.TestResult |
---|
addError, addFailure, addListener, errorCount, errors, failureCount, failures, removeListener, runCount, runProtected, shouldStop, stop, wasSuccessful |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TKTestResult(int delay, String testCaseName)
delay
- A delay in milliseconds to introduce before every test start.testCaseName
- The name of the test case that this is the TestResult object for.Method Detail |
---|
public void startTest(junit.framework.Test test)
startTest
in class junit.framework.TestResult
test
- The test to be started.public void endTest(junit.framework.Test test)
endTest
in class junit.framework.TestResult
test
- The test that has ended.public int getN()
public void setN(int n)
n
- The new value of the integer parameter.public void addTKTestListener(TKTestListener listener)
listener
- The timing listener to register.public void notifyStartBatch()
public void notifyEndBatch()
public void notifyTestProperties(Properties properties)
properties
- The tests set/read properties.protected void run(junit.framework.TestCase test)
run
in class junit.framework.TestResult
test
- The test to run.protected String getTestInfo(junit.framework.Test test)
test
- The test to generate the info string for.
public void setConcurrencyLevel(int concurrencyLevel)
concurrencyLevel
- The concurrency level the tests are running out.public void shutdownNow()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |