A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
Junit Execution order
Joined: Dec 09, 2010
Mar 14, 2011 05:46:09
I have few classes where i have
When i execute the
cases in this class individually it executed properly in the order of occurence,
However when i put it in a test suite. The testcases are executed in a different order which has cascading effect and my test suite result is affected.
I am using junit 4.6 in eclipse environment.
Could anybody please help me out in sorting this .
Thanks in advance
Joined: Apr 14, 2004
Mar 14, 2011 06:19:50
I don't think there is anything in JUnit to tell a runner to order tests (I may be wrong, but there certainly never used to be). The usual
for testing is:
Which is why JUnit supplied the @Before and @After annotations. If you really need to control the ordering of test cases you'll need to define these in a test suite.
I agree. Here's the link:
subject: Junit Execution order
Run as Junit Test case
Lazy Initialization Exception while running my Junit Test Cases
How to test a Web Application using JUNIT ???
using Test suite
Ant - the junit task: can load TestCases from jar ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015