• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

JUNIT testscript execution, skipping

Hi,


I am using JUNIT to run some test scripts. I would like to know how to skip some of the tests within the script.
Please advise on how can i resolve it. Any ideas, sample code, links, resources highly appreciated. thanks in advance
0
gudii9
Asked:
gudii9
  • 2
  • 2
3 Solutions
 
objectsCommented:
you'll need to comment them out, you cannot skip individual tests.
0
 
for_yanCommented:
You can have, say, sequential  numbers of those tests you want to run as
command line arguments and then have if clauses in you code which
will excute each test depending on the presence of particular number in your command line

Then you'd be able at least to run different tests
without recompiling  
 
0
 
objectsCommented:
Typically there is no need to skip an individual test, somewhat defeats the purpose of testing by reducing your test coverage.

If you just want maven to skip the tests then that can be achieved with a command switch
http://helpdesk.objects.com.au/java/how-can-i-skip-running-tests-during-a-maven-build
0
 
cmalakarCommented:
If you use Junit4, you can do it..

Check this thread.

http://tech.groups.yahoo.com/group/junit/message/16832
0
 
cmalakarCommented:
Also you can use Ignore annotation..

http://junit.org/junit/javadoc/4.5/org/junit/Ignore.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now