Thursday, 24 February 2011

Maven Surefire executing only one test method in a test class

I have just worked on a improvement in Apache Maven Surefire Plugin.
Most of the time you have a test class which contains a lot of test methods.
When only one failed you have to execute all methods of the class (with -Dtest=MyClass)
This can be long and boring :-).

So now (see [1]), you will be able to use -Dtest=MyClass#myMethod to execute only the method called myMethod from the test class MyClass.

The feature has been pushed in a github fork [2].
Why in a github fork : I'd like to have feedback fast :-)

So how to test it ? :

Get the sources :

git clone git://
cd maven-surefire
mvn clean install (add -DskipTests if you don't want to execute all integration tests).

Update you pom :


And now test it :-)

-Dtest=MyTestClass#myMethod (note the support of * : -Dtest=MyTestClass#*Method )

NOTE : supported only for junit 4.x

Update : now supported for testng too.

Update 25 Feb : merged in ASF svn repo

Update 12 March : released in surefire 2.8 (Yeahhh :-) )

Have Fun ! (and don't miss to put feedback in case of issues)


Wednesday, 2 February 2011

Sonar Instance @ASF

A Sonar instance is now available at ASF

Builds are provided by Jenkins : (yes I couldn't resist to use it even before the first official release :-) ).

If you want to add your project see :

Have Fun and Thanks ASF INFRA !