This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Run a JUnit 4 test repeatedly

 
Jakub Drzazga
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to run single test many times. How can I do it?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With the exact same data? Why? To test threading or something else? (The answers influence approach which is why the answer comes with questions.)
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or perhaps the same test with different inputs and expected results each time?

Parameterizing test cases, Looking for a best practice to deal with numerous similar JUnit Test Cases, JUnit Parameterized API with examples.
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you try maven to do this job. Maven can invoke junit by using command line. What i will suggest, create one shell script ( in linux) or batch file( in windows), write a code to run the script number of times what you want. in script you can write maven command to invoke junit.

Hope this will help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic