JUnit: Difference between revisions
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
JUnit | JUnit is a test framework which uses annotation to identify the methods which contain tests. JUnit assumes that all test methods can be performed in an arbitrary order. Therefore tests should not depend other tests. | ||
==Annotations== | ==Annotations== | ||
| Line 6: | Line 6: | ||
===@Test=== | ===@Test=== | ||
Annotation @Test identifies that this method is a test method. | Annotation @Test identifies that this method is a test method. | ||
==Running Test== | |||
===Command Line=== | |||
mvn test | |||
===Eclipse=== | |||
* right click class -> Run As JUnit | |||
Latest revision as of 23:35, 13 March 2021
Introduction[edit]
JUnit is a test framework which uses annotation to identify the methods which contain tests. JUnit assumes that all test methods can be performed in an arbitrary order. Therefore tests should not depend other tests.
Annotations[edit]
@Test[edit]
Annotation @Test identifies that this method is a test method.
Running Test[edit]
Command Line[edit]
mvn test
Eclipse[edit]
- right click class -> Run As JUnit