__._,_.___Hi Jochen,
I have added the issue to JUnitExt as you suggested for future
references... but there is no place for me to flag this as a "request"
instead of "defect"... I think there should be an option on the New
Issue page for different option (ie priority, type).
Thanks,
Vietchau
________________________________
From: ju...@yahoogroups.com [mailto: ju...@yahoogroups.com] On Behalf Of
Jochen Hiller
Sent: Friday, December 15, 2006 5:55 AM
To: ju...@yahoogroups.com
Subject: Re: [junit] how to skip a test at runtime
Hi Vietchau,
JUnitExt does only support prerequisite methods with signature
public boolean aPrereqMethod ()
Actually there is no support to forward the test name into this method.
If
this would make sense for you, could you please add an issue to
JUnitExt?
Please use issue tracking at
http://code.google.com/p/junitext/issues/list.
<http://code.google.com/p/junitext/issues/list. >
Meanwhile: David mentioned some options, writing your own startup and/or
runner, filter. From what I understand, a Filter may be appropriate for
your
requirement.
Bye, Jochen
On 12/13/06, Vietchau Nguyen <vietcha...@eedo.com
<mailto:vietchau.nguyen%40eedo.com> > wrote:
>
> Hello,
>
> I am new to JUnit and I am currently exploring the new verion, JUnit
> 4.1. I need to create unit tests for QA and they require an option to
> select which test to run at runtime. I know that there is the @Ignore
> but it need to be hard code at compile time... so I wonder if there is
> any other option in JUnit to let users specifies at runtime which
tests
> to run? I saw the extension package, which have @Prerequisite
annotation
> and will let me create a method eg. IsDBAvailable But I tried to have
> parameters to the method, eg. RunThisTest(String testName) and it
would
> not allow me to do so. .. I have too many test cases and I don't want
to
> have to write a separate function for each of them. Any suggestion on
> how to skip a test at runtime is appreciated.
>
> Thank you so much in advance,
>
> Vietchau
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | UnsubscribeSPONSORED LINKSNew business?List your web site
in Yahoo! Search.
Yahoo! Groupsin 3 easy steps.
Connect with others.
.
__,_._,___
-----Ursprüngliche Nachricht-----
Von: Vietchau Nguyen [mailto:vietcha...@eedo.com]
Gesendet: Donnerstag, 4. Januar 2007 16:49
An: Jochen Hiller
Betreff: RE: [junit] how to skip a test at runtimeHi Jochen,
Thank you for such a quick response to my enhancement request. I have downloaded JUnitExt 0.2.1 but I couldn’t figure out how to use the new feature. I saw in the changeLog:
- Additional support for Prerequisite signatures
- will first try to call "public void isXxx (Description desc)"
- then try to call "public void isXxx(String className, String methodName)"
- and finally fallback to "public void isXxx()"
- see Bugfix: http://code.google.com/p/junitext/issues/detail?id=3
But there is no sample or tutorial on how to use this new feature. I tried to look at the .jar file but I couldn’t figure out either.
So, the method now should be void, instead of return a Boolean? Then how can the runner decide whether to run the test or not? Am I missing something?
For example, my check method is:
Public void runCurrentTest(String className, String methodName);
Then how can I call in @Prerequisite?
I use:
@Prerequisite(requires="runCurrentTest('myClassName', 'myMethodName')")
But it gives me an internal error when checking Prerequisite.
For my class, I use with:
@RunWith(AnnotationRunner.class)
I notice that the overview page mention that I should use
org.junit.runner.manipulation.Filter, how do I set my program to use this, because when I use
@RunWith(
org.junit.runner.manipulation.Filter
.class)
the compiler complains that the class is incompatible.
Thank you for your help,
Vietchau