| Author |
JUnit 3.8: trying to accomplish something like Parameterized J-Unit 4.0
|
Deon Cravalho
Greenhorn
Joined: Oct 22, 2009
Posts: 6
|
|
Greetings,
I am forced, at the present time, to use Ant 1.6.5 (within WebLogic). Ant 1.6.5 is not compatible with JUnit 4, from my readings.
I have quite a few methods that need to be tested, but with varying combinations of arguments. Now JUnit 4 has parameterized JUnit tests you can build, which is what I want. However I am forced to use JUnit 3.8. Thus, my only initial idea is to pass my varying list of arguments into my method within a loop and then run the method. Is there a better way to handle this, until I can upgrade to use JUnit 4 parameterized JUnit tests?
Thoughts/ideas on what to do to make my tests "cleanest" would be great! Maybe I'm stuck with sending in array of various arguments, or doing a loop of some sort on the method to send in the different sets of arguments.
Other info: using Java 1.5 and Spring 2.0. Just in case this info is needed for someone supplying me with help. Thank you.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
Deon,
In JUnit 3.8, the pattern still exists, but it's not a built in construct. What you do is implement a suite() method. In that method you build a suite containing the parameterized tests you want to run. I use a loop where I go through the list of things I want to test.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Deon Cravalho
Greenhorn
Joined: Oct 22, 2009
Posts: 6
|
|
Thank you for the quick reply. I will go forth with the idea you mentioned. And, hopefully soon upgrade to JUnit 4 once my Ant (within WebLogic) gets upgraded!
|
 |
 |
|
|
subject: JUnit 3.8: trying to accomplish something like Parameterized J-Unit 4.0
|
|
|