opengeospatial / geoapi

GeoAPI provides a set of interfaces in programming languages (currently Java and Python) for geospatial applications. The GeoAPI interfaces closely follow OGC specifications, adaptated to match the expectations of programmers.
http://www.geoapi.org
Apache License 2.0
118 stars 37 forks source link

Upgrade tests to JUnit 5 #58

Closed desruisseaux closed 6 months ago

desruisseaux commented 4 years ago

Tests currently uses JUnit 4. We should upgrade them to JUnit 5. It would allow us to remove from GeoAPI some test framework that we developed for working around some JUnit 4 limitations and which are not needed any more with JUnit 5.

kinow commented 4 years ago

Recently did that for Apache Commons Imaging, and was surprised by how simple it was (though demanded some time) and how nice the code looked afterwards.

desruisseaux commented 4 years ago

Created a "jupiter" branch. Tests pass, but this branch still needs more cleaning.

desruisseaux commented 4 years ago

We may lost org.opengis.test.TestSuite for some time, until https://github.com/junit-team/junit5/issues/744 get fixed. We used JUnit 4 TestSuite as a way for implementers to inherit a large set of conformance tests in one class, instead than forcing them to extend each test class in their own test packages.

Maybe there is other ways to achieve the same functionality using for example LauncherDiscoveryRequestBuilder and DiscoverySelectors.selectClass(…), but the way we did with JUnit 4 where implementers just needed to extend org.opengis.test.TestSuite in their own tests was convenient. We will wait and see if such approach become possible with JUnit 5.7.

desruisseaux commented 6 months ago

Migration to JUnit 5 done.