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

Skip or order JUnit tests in Eclipse

 
Min Huang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to do this? I understand that having this need reveals a deeper problem in my unit tests themselves (ie they are not actually unit tests, but functional or they are just plain bad, bad I tell you!), but please humor me
 
Jan Cumps
Bartender
Posts: 2596
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can skip tests by annotating them with @Ignore.

You can't order tests (if order means: decide in which order they run; JUnit does not guarantee a specific order of execution), but you can group tests as described in Lasse's weblog.

Regards, jan
 
Min Huang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I didn't specify that this is JUnit3 specific. I strongly suspect that there is nothing I can do in this situation..
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also implement your own suite method and hard code the order of the tests. Then have Eclipse run that.

Keep in mind that you have to maintain the suite then which is problematic.
 
Min Huang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I realize that. I was just wondering if there is some easy way to do it. I did stumble upon ct-eclipse, but there is are no files available for downloading. I was hoping if somebody knew of an alternative.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic