Bug 65026 - Migrate tests to Junit 5
Summary: Migrate tests to Junit 5
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 4.1.x-dev
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-24 18:23 UTC by Andreas Beeker
Modified: 2020-12-29 22:51 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Beeker 2020-12-24 18:23:30 UTC
Junit5 brings a few features missing in Junit4 - namely better support for parameterized and nested tests.

I've decided to give it a try, and then I was in the middle of migration purgatory :)

The following changes will be visible after I committed the 1000+ file changes:

a) Junit5 uses different annotations and different packages

b) expected exceptions are now handled via assertThrows

c) ant lacks support for direct test feedback - see https://bz.apache.org/bugzilla/show_bug.cgi?id=64836
  I'm using a custom test listener to print the summary, but this will only be shown when all tests of the current module are processed.

*So don't panic when the build seems to hang - you can track the progress in build/status-as-tests-run.txt*

d) JaCoCo is not handling Junit5 in the "coverage" tag - see https://github.com/jacoco/jacoco/issues/673
  I've worked around it with the "agent" tag, but I haven't test it yet

e) I've deleted all TestSuites (like AllFormulaTests)  locally, as Junit5 doesn't support declarative test suites currently (https://github.com/junit-team/junit5/issues/744)

f) I've cleaned most of the cases where an Assertions.assert* is preferred to a call to .fail()
Comment 1 Andreas Beeker 2020-12-24 18:44:23 UTC
Applied via r1884783

probably still a few fixes need to be applied to satisfy all Jenkins jobs
Comment 2 Andreas Beeker 2020-12-25 16:31:40 UTC
most of the issues with the build are solved - I'm checking now how the gradle build can be convinced to work again.
closing this ticket, so I don't forget about it ...
Comment 3 Dolls France 2020-12-29 22:51:23 UTC
[reply] [−]DescriptionAndreas Beeker 2020-12-24 18:23:30 UTC
Junit5 brings a few features missing in Junit4 - namely better support for parameterized and nested tests.

I've decided to give it a try, and then I was in the middle of migration purgatory :) https://sex-dolls-europe.com

The following changes will be visible after I committed the 1000+ file changes:

a) Junit5 uses different annotations and different packages