directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <>
Subject Add MultiThreadedMultiInvoker rule to integration tests
Date Thu, 25 Nov 2010 11:06:12 GMT
Hi guys,

I'd like to add the junit-addons dependency to server-integ and add
the MultiThreadedMultiInvoker Rule from there to some tests.

The MultiThreadedMultiInvoker (MTMI) [1] is am implementation of
JUnit's MethodRule. If it is defined in a test class like this

    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker();

the invocation of each test method is intercepted by the rule. In case
of the MTMI class the test method (including setups and teardowns) are
invoked multiple times and optionally in multiple threads.

By default, when running the tests with "mvn test" or from within
Eclipse each test method is invoked only once, so there is no
difference to the current situation. But it is possible to control the
number of threads and invocations per thread via system properties:

It helped me to find some issues with unclosed resources in
integration tests, and especially a problem in StartTlsIT test that
caused hanging tests on Windows, so I think it is quite useful.

Kind Regards,


View raw message