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="samples/jvm-components-with-additional-test-types/groovy",files="application/build.gradle[]"]
include::sample[dir="samples/jvm-components-with-additional-test-types/kotlin",files="application/build.gradle.kts[]"]
====

For libraries:

====
include::sample[dir="samples/jvm-components-with-additional-test-types/groovy",files="list/build.gradle[]"]
include::sample[dir="samples/jvm-components-with-additional-test-types/kotlin",files="list/build.gradle.kts[]"]
====

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

====
[.testable-sample,dir="groovy"]
=====
[.sample-command]
----
$ ./gradlew check

BUILD SUCCESSFUL in 2s
11 actionable tasks: 11 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].
