I've been happily using JUnitPerf's TimedTest, but I'd also like to
use JUnit4. Unfortunately JUnit4's timeout requires a constant
expression, but I want to be able to get the timeout value
dynamically. But I'd also like to make some refactorings to my tests,
and that'd be a lot easier to do without JUnit3's forced inheritance
from TestCase. My JUnit3 timed code is like
public static Test suite() throws RunnerException {
Test testCase = new TestFooRunner("testFooRunner");
return new TimedTest(testCase, getMaxElapsedTime(), false);
}
How can I most easily run a TimedTest from a JUnit4 class? I'm
guessing this is easy, but I'm just not seeing it, and everything I've
tried has failed in some way, and not from timing out, unfortunately
:-(