Test Case Execution Sequence

There are differences in the way that JUnit and Java Explorer run tests. In JUnit TestSuites, values and global variables that need to be initialized in the init() test case cannot be passed from one test case to the next.

Example

The execution sequence of the following Java Explorer project, that contains an init() test case, an end() test case, and two test cases, is:
  1. InitTestCase
  2. TestCase1
  3. TestCase2
  4. EndTestCase
In JUnit, the execution sequence of the same project is:
  1. InitTestCase (setUp)
  2. TestCase1 (testMethod1)
  3. EndTestCase (tearDown)
  4. InitTestCase (setUp)
  5. TestCase2 (testMethod2)
  6. EndTestCase (tearDown)