File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Junit life cycle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Junit life cycle" Watch "Junit life cycle" New topic

Junit life cycle

Ray Kumar

Joined: Jan 22, 2002
Posts: 17

What is the life cycle of Junit testing ?

Thanks in advance
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Are you talking about the lifecycle of the JUnit TestCase objects or the lifecycle of how you write and run unit tests?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ray Kumar

Joined: Jan 22, 2002
Posts: 17
I mean, Testcase life cycle. Thanks
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33117

For each test method in a test case, the setUp() method is called, followed by the test itself, followed by the tearDown() method. If you have multiple tests in a test suite, all of the tests are run using the method described in the previous sentence.

For more details, see the cook's tour article.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Junit life cycle
It's not a secret anymore!