This is a comprehensive and new JUnit 4 practical tutorial, translated from: http://www.javatutorials.co.in/junit-4/, hope to help everyone!
The following is the content settings of this tutorial. You can click the following title to read the content:
JUnit testing framework is the most popular Java unit testing framework. JUnit is used to develop unit tests for Java classes.
This section describes the features and usage of JUnit in Eclipse IDE. Sample Code for writing and running unit test in Eclipse IDE.
The junit4 annotation provides basic functions for writing unit tests. This chapter describes @ beforeclass, @ afterclass, @ before, @ After and @ test annotations.
The assertion method checks the actual values and expected values obtained from the test.
Parameterization testing allows you to test methods in Java classes using parameters of different ranges.
Use the test suite class to run various test classes at the same time.
- JUnit 4 ignore test (ignore Test)
Ignore tests are used to disable some or all of the test methods in the unit test class.
- JUnit 4 timeout test (timeout Test)
The timeout test is used to detect the execution time of some or all methods in the unit test class.
Certificate ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The source of this article is http://blog.csdn.net/luanlouis. For more information, see. Thank you!