Size: 333
Comment:
|
Size: 1395
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
== Imports == {{{#!highlight java import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.Ignore; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; }}} == 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". }}} |
|
Line 17: | Line 37: |
== Maven dependency == {{{ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> </dependency> }}} On a Maven project the tests may be located inside '''/src/test/java/''' so they are integrated in the main artifact generated by Maven. |
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>
On a Maven project the tests may be located inside /src/test/java/ so they are integrated in the main artifact generated by Maven.