JUnit
A programmer-oriented testing framework for Java.
Annotations
- @Before , public void setUp(){}
- @Test , public void textAbc(){}
- @After , public void tearDown(){}
Imports
Inclusion classes
http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
By default, the Surefire Plugin will automatically include all test classes with the following wildcard patterns: "**/Test*.java" - includes all of its subdirectories and all java filenames that start with "Test". "**/*Test.java" - includes all of its subdirectories and all java filenames that end with "Test". "**/*TestCase.java" - includes all of its subdirectories and all java filenames that end with "TestCase".
Import methods
Maven dependency
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> </dependency>