Testing with Gradle Java Plugin: Difference between revisions
Jump to navigation
Jump to search
Line 22: | Line 22: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Test Logging Output== | ==Test Execution Mechanics Logging Output== | ||
The "testLogging" property represents a set of options that control which '''test events''' are logged and at what level. | |||
<syntaxhighlight lang='groovy'> | |||
test { | |||
testLogging { | |||
... | |||
} | |||
} | |||
</syntaxhighlight> | |||
For more details see | |||
==Passing System Properties to Tests== | ==Passing System Properties to Tests== |
Revision as of 22:13, 23 November 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'
}
Test Execution Mechanics Logging Output
The "testLogging" property represents a set of options that control which test events are logged and at what level.
test {
testLogging {
...
}
}
For more details see
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