What do you like best about JUnit?
- Quick and easy to learn.
- advantage of test methods consuming data arguments directly from the configured source.
- recommended for new learner.
In general:
- JUnit testing saves time and money.
- JUnit testing is an Integral part of extreme programming.
- JUnit testing helps gauge performance.
- JUnit testing improves code coverage.
- JUnit testing reduces code complexity.
The annotations of JUnit testing, that can be used while writing the test cases in Junit framework are
@Test: the test annotation specifies the test method.
@Test(timeout=1000) this type of annotations specifies that the method will be failed if it takes more than 1000 milliseconds.
@BeforeClass: this annotation specifies that the method will be invoked only once before all tests starts.
Before: this method invokes at the very beginning of the each test.
@After: this annotation invokes this method invokes after each test.
@After class annotation specifies that the method will invoke only once at the end of all test.
The org.Junit package contains many interfaces and classes like Assert, Test, before etc Review collected by and hosted on G2.com.