Hi,
I can't seem to be able to use JUnitPerf with JUnit4 either.. It
would be great if someone can show me an example of how I can use
TimedTest and LoadTest with JUnit4. The problem here is that with
JUnit4, test classes don't need to extend from TestCase. So using
the example below, I would NOT be able to set testCase like the
following since TestFooRunner does not extend TestCase:
Test testCase = new TestFooRunner("testFooRunner");
return new TimedTest(testCase, getMaxElapsedTime(), false);
Thanks in advance,
Kay
--- In junitperf@yahoogroups.com, Thomas L Roche <tlroche@...> wrote:
>
> 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
> :-(
>