Class SpringFailOnTimeout
java.lang.Object
org.junit.runners.model.Statement
org.springframework.test.context.junit4.statements.SpringFailOnTimeout
Deprecated.
SpringFailOnTimeout is a custom JUnit Statement which adds
support for Spring's @Timed
annotation by throwing an exception if the next statement in the execution
chain takes more than the specified number of milliseconds.
In contrast to JUnit's
FailOnTimeout,
the next statement will be executed in the same thread as the
caller and will therefore not be aborted preemptively.
- Since:
- 3.0
- Author:
- Sam Brannen
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionSpringFailOnTimeout(Statement next, long timeout) Deprecated.Construct a newSpringFailOnTimeoutstatement for the suppliedtimeout.SpringFailOnTimeout(Statement next, Method testMethod) Deprecated.Construct a newSpringFailOnTimeoutstatement for the suppliedtestMethod, retrieving the configured timeout from the@Timedannotation on the supplied method.
- 
Method SummaryModifier and TypeMethodDescriptionvoidevaluate()Deprecated.Evaluate the nextstatementin the execution chain (typically an instance ofSpringRepeat) and throw aTimeoutExceptionif the nextstatementexecutes longer than the specifiedtimeout.
- 
Constructor Details- 
SpringFailOnTimeoutDeprecated.Construct a newSpringFailOnTimeoutstatement for the suppliedtestMethod, retrieving the configured timeout from the@Timedannotation on the supplied method.- Parameters:
- next- the next- Statementin the execution chain
- testMethod- the current test method
- See Also:
 
- 
SpringFailOnTimeoutDeprecated.Construct a newSpringFailOnTimeoutstatement for the suppliedtimeout.If the supplied timeoutis0, the execution of thenextstatement will not be timed.- Parameters:
- next- the next- Statementin the execution chain; never- null
- timeout- the configured- timeoutfor the current test, in milliseconds; never negative
 
 
- 
- 
Method Details- 
evaluateDeprecated.Evaluate the nextstatementin the execution chain (typically an instance ofSpringRepeat) and throw aTimeoutExceptionif the nextstatementexecutes longer than the specifiedtimeout.
 
- 
SpringExtensionand JUnit Jupiter