NOTE: You can open this sample inside an IDE using the https://www.jetbrains.com/help/idea/gradle.html#gradle_import_project_start[IntelliJ native importer] or https://projects.eclipse.org/projects/tools.buildship[Eclipse Buildship].

This sample shows how to add additional test types to a JVM project in Gradle. Your project may have many different kinds of tests--unit tests, integration tests, functional tests, etc. A JVM project in Gradle has a single `Test` task, but other tasks can be added to represent each of these test types.

In this sample, we are testing Java projects with JUnit4; however, this applies to other JVM languages as well.

For applications:

====
include::sample[dir="groovy",files="application/build.gradle[]"]
include::sample[dir="kotlin",files="application/build.gradle.kts[]"]
====

For libraries:

====
include::sample[dir="groovy",files="utilities/build.gradle[]"]
include::sample[dir="kotlin",files="utilities/build.gradle.kts[]"]
====

These additional tests can be executed with the `integrationTest` task or as part of lifecycle `check`:

[listing.terminal.sample-command]
----
$ ./gradlew check

BUILD SUCCESSFUL
5 actionable tasks: 5 executed
----

For more information, see link:{userManualPath}/java_testing.html#sec:configuring_java_integration_tests[section Configuring integration tests in the Testing in Java project chapter].
