You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lécharny <el...@gmail.com> on 2019/05/05 07:50:55 UTC
JUNIT 5 migration
Hi,
I'm almost done with LDAP API junit 5 migration, with only one burden :
the multithreaded Rule that has to be ported. Junit 5 does not support
@Rule, there is a new mechanism called extensions [1]. I still have to
study it. The other used rule is the one using temporary folder
creation. Atm, I just skipped it and replaced it with a init function
doing the same thing, but that could be improved.
All in all, I'm not sure we will need the junit-addons project, except
if we decide to create the multithreaded extension and make it
available for other projects.
The migration was quite simple, except that it took a bit of time (and
was boring). It was all about changing the imports, and the concurrent
annotations - which are now embedded into junit.
As a side note, surefire also support running tests in parallel ([2]).
That may be an opportunity to remove all the concurrent annotation from
the tests.
[1] https://junit.org/junit5/docs/snapshot/user-guide/#extensions
[2] https://www.baeldung.com/maven-junit-parallel-tests
Re: JUNIT 5 migration
Posted by Emmanuel Lécharny <el...@gmail.com>.
On 05/05/2019 12:30, Stefan Seelmann wrote:
> On 5/5/19 9:50 AM, Emmanuel Lécharny wrote:
>> I'm almost done with LDAP API junit 5 migration, with only one burden :
>> the multithreaded Rule that has to be ported. Junit 5 does not support
>> @Rule, there is a new mechanism called extensions [1]. I still have to
>> study it. The other used rule is the one using temporary folder
>> creation. Atm, I just skipped it and replaced it with a init function
>> doing the same thing, but that could be improved.
> I guess we can remove that rule.
>
>> All in all, I'm not sure we will need the junit-addons project, except
>> if we decide to create the multithreaded extension and make it
>> available for other projects.
> I guess we can get rid of it.
>
>> As a side note, surefire also support running tests in parallel ([2]).
>> That may be an opportunity to remove all the concurrent annotation from
>> the tests.
> I assume we use the annotation because some tests cannot run in parallel?
AFAICT, yes, some of the schema tests are required to be run one after
the other.
Otherwise, augmenting the surefire configuration allows us to run the
tests concurrently, which is good, and incidentally allowed me to find
some buggy tests :-)
Re: JUNIT 5 migration
Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 5/5/19 9:50 AM, Emmanuel Lécharny wrote:
> I'm almost done with LDAP API junit 5 migration, with only one burden :
> the multithreaded Rule that has to be ported. Junit 5 does not support
> @Rule, there is a new mechanism called extensions [1]. I still have to
> study it. The other used rule is the one using temporary folder
> creation. Atm, I just skipped it and replaced it with a init function
> doing the same thing, but that could be improved.
I guess we can remove that rule.
> All in all, I'm not sure we will need the junit-addons project, except
> if we decide to create the multithreaded extension and make it
> available for other projects.
I guess we can get rid of it.
> As a side note, surefire also support running tests in parallel ([2]).
> That may be an opportunity to remove all the concurrent annotation from
> the tests.
I assume we use the annotation because some tests cannot run in parallel?
Anyway, thanks Emmanuel for doing the migration!
Kind Regards,
Stefan