• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ordering of the test cases

 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway where we can gurantee the ordering of the testCases to
be executed.
I mean to say that test1() executes before test2()?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't do that.
If you need some setup code to run before a series of tests, you can put it in the setUp() method of a TestSuite object.
But don't write order-dependent tests. It just makes the tests hard to interpret and hard to maintain.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!