public class

SpringFailOnTimeout

extends Statement
java.lang.Object
   ↳ Statement
     ↳ org.springframework.test.context.junit4.statements.SpringFailOnTimeout

Class Overview

SpringFailOnTimeout is a custom JUnit 4.5+ 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.

See Also

Summary

Public Constructors
SpringFailOnTimeout(Statement next, long timeout)
Constructs a new SpringFailOnTimeout statement.
Public Methods
void evaluate()
Invokes the next Statement statement in the execution chain (typically an instance of org.junit.internal.runners.statements.InvokeMethod InvokeMethod or org.junit.internal.runners.statements.ExpectException ExpectException) and throws an exception if the next statement takes more than the specified timeout .
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SpringFailOnTimeout (Statement next, long timeout)

Constructs a new SpringFailOnTimeout statement.

Parameters
next the next Statement in the execution chain
timeout the configured timeout for the current test
See Also
  • Timed#millis()

Public Methods

public void evaluate ()

Invokes the next Statement statement in the execution chain (typically an instance of org.junit.internal.runners.statements.InvokeMethod InvokeMethod or org.junit.internal.runners.statements.ExpectException ExpectException) and throws an exception if the next statement takes more than the specified timeout .

Throws
Throwable