* finished (possibly blocking forever).
*/
private int determineTimeout(TestCandidate c) {
Integer timeout = null;
Timeout timeoutAnn = c.instanceProvider.getTestClass().getAnnotation(Timeout.class);
if (timeoutAnn != null) {
timeout = (int) Math.min(Integer.MAX_VALUE, timeoutAnn.millis());
}
// @Test annotation timeout value.
Test testAnn = c.method.getAnnotation(Test.class);
if (testAnn != null && testAnn.timeout() > 0) {
timeout = (int) Math.min(Integer.MAX_VALUE, testAnn.timeout());
}
// Method-override.
timeoutAnn = c.method.getAnnotation(Timeout.class);
if (timeoutAnn != null) {
timeout = timeoutAnn.millis();
}
return testTimeout.getTimeout(timeout);
}