A newbie to JUnit (in fact JUnit 4) and came across suite way of executing test
@RunWith(Suite.class)
@Suite.SuiteClasses(
{
CreateNewProfile.class,
EditProfile.class,
})
public class ProfileTestSuite {
}
This is the code sample I came across while browsing through the test code base at my new employer. During execution I fund that - CreateNewProfile tests are executed first and then EditProfile, which does make sense but then it introduces dependency among tests.
I have been following non dependent test mechanism from couple of months (though I used to use TestNG and not JUnit) and would expect EditProfile being able to be executed in isolation as well. That is edit profile should take care of creating profile and then editing it and then asserting the operations.
My question here is - has Junit 4 introduced test ordering feature. Is this feature intended or one easter egg as I always felt JUnit = independent tests.