Testing with Gradle Java Plugin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 10: | Line 10: | ||
Testing is performed by the "[[Gradle_Java_Plugin#tes|test]]" task (implemented by [https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html Test]), which automatically detects and executes all unit tests in the test source set and generates a report once test execution is complete. JUnit and TestNG are both supported. | Testing is performed by the "[[Gradle_Java_Plugin#tes|test]]" task (implemented by [https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html Test]), which automatically detects and executes all unit tests in the test source set and generates a report once test execution is complete. JUnit and TestNG are both supported. | ||
=Configuring the "test" Task= | =Configuring the "test" Task= | ||
Line 35: | Line 33: | ||
Also see [[Maven_Surefire_Plugin#Configuration_Example|Maven Surefire Configuration Example]]. | Also see [[Maven_Surefire_Plugin#Configuration_Example|Maven Surefire Configuration Example]]. | ||
=TODO= | |||
<font color='darkgray'> | |||
TODO process https://docs.gradle.org/current/userguide/java_testing.html | |||
</font> |
Revision as of 22:15, 25 October 2018
External
- Gradle Docs - Testing in Java & JVM projects https://docs.gradle.org/current/userguide/java_testing.html
Internal
Overview
Testing is performed by the "test" task (implemented by Test), which automatically detects and executes all unit tests in the test source set and generates a report once test execution is complete. JUnit and TestNG are both supported.
Configuring the "test" Task
Use a script block in build.gradle:
test {
useJUnit()
maxHeapSize = '1G'
}
Passing System Properties to Tests
test {
...
systemProperty 'rootDir', "${rootDir}"
...
}
Also see Maven Surefire Configuration Example.
TODO
TODO process https://docs.gradle.org/current/userguide/java_testing.html