Since version 2.1 of the Ant Plugin, the generated Ant build files allow to run individual unit tests. You merely need to specify the simple name of the desired test class via the system property test as illustrated below:
ant test -Dtest=MyFavoriteTest
This will run a test matching the pattern **/MyFavoriteTest.java . You can also employ a simple pattern to select multiple tests:
ant test -Dtest=*FavoriteTest
Note : Unlike the Surefire Plugin, the Ant scripts do not support a comma-separated value for the test property.