• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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