• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JUnit 3.8: trying to accomplish something like Parameterized J-Unit 4.0

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Deon Cravalho
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

 
reply
    Bookmark Topic Watch Topic
  • New Topic