JUnit: Difference between revisions
Jump to navigation
Jump to search
Line 57: | Line 57: | ||
* [[JUnit Exception Testing]] | * [[JUnit Exception Testing]] | ||
=JUnit | =JUnit XML Reporting File Format= | ||
{{External|https://llg.cubic.org/docs/junit/}} | |||
This file format is understood by the Jenkins [[Jenkins_Pipeline_Syntax#junit|junit]] step, which generates Jenkins test reports from it. | |||
More details: {{Internal|Jenkins_Pipeline_Syntax#junit|Jenkins junit step}} |
Revision as of 05:44, 8 May 2021
External
- https://www.infoq.com/presentations/junit-5-demo
- Latest JUnit 4 version: https://junit.org/junit4/
- https://junit.org/junit4/javadoc/latest/
Internal
Overview
Dependencies
dependencies {
testImplementation "junit:junit:4.12"
}
JUnit and Gradle
The only configuration required to enable unit testing in a Gradle project is to apply the Java plugin and declared JUnit as testImplementation:
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
...
testImplementation "junit:junit:4.12"
}
This will allow to declare @Test methods and will enable result parsing to generate HTML reports.
Passing System Properties to Tests
See:
Concepts
Test Runner
A JUnit plugin that provides custom testing behavior. Specified with @RunWith.
Annotations
Patterns
JUnit XML Reporting File Format
This file format is understood by the Jenkins junit step, which generates Jenkins test reports from it.
More details: