run single integration test with gradle

The correct syntax is:

gradle testTaskName -DtestTaskName.single=...

In this case:

gradle integrationTest -DintegrationTest.single=...


Since Gradle 1.10 you can write:

 //select specific test method
gradle test --tests org.gradle.SomeTest.someFeature

//select specific test class
gradle test --tests org.gradle.SomeTest

//select all tests from package
gradle test --tests org.gradle.internal*

//select all ui test methods from integration tests by naming convention
gradle test --tests *IntegTest*ui*

//selecting tests from different test tasks
gradle test --tests *UiTest integTest --tests *WebTest*ui

Read more here http://www.gradle.org/docs/1.10/release-notes#executing-specific-tests-from-the-command-line


Just incase anyone is coming here looking for answers. This has been removed in gradle 5.0. Look for test.single in https://docs.gradle.org/current/userguide/upgrading_version_4.html

If you still wish to use a command line option in this style you should be able to use the --tests commandline param. See https://docs.gradle.org/current/userguide/java_testing.html#simple_name_pattern

$ ./gradlew integrationTest --tests=MyTest