Search the web
Sign In
New User? Sign Up
junitperf
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
using TimedTest with JUnit 4   Message List  
Reply | Forward Message #87 of 94 |
Re: using TimedTest with JUnit 4

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
> :-(
>





Tue Mar 27, 2007 5:54 pm

kaycheungchan
Offline Offline
Send Email Send Email

Forward
Message #87 of 94 |
Expand Messages Author Sort by Date

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...
Thomas L Roche
tlroche
Offline Send Email
Mar 26, 2007
1:07 pm

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...
kaycheungchan
Offline Send Email
Mar 27, 2007
5:55 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help