You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2025/10/11 14:32:48 UTC
(sis) branch main updated (ecf0bfa5b2 -> d5c8e985dd)
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/sis.git
from ecf0bfa5b2 Merge branch 'geoapi-3.1': removal of deprecated methods.
add e8e400397d Consolidation of tests with resolution of some warnings, removing some redundancies in frequently used patterns, and lowering the risk of accidentally disabled tests.
add afe23b664e More test consolidation: reduce the number of assumptions. Factorize better where remaining assumptions are done.
add 49cb980e1a Adjustments in the unit of measurement implementation for alignment with Seshat 1.5.
add a1d8ed95d9 Make non-optional some tests that are not so slow according JUnit report. Fix also a remaining EPSG test which could be accidentally skipped.
add 3596ff7ecd Move `TestUtilities` methods that are actually assertions. Add frequently used assertions for making the test code more readable.
add 2334c7cee4 Retrofit metadata `Assertions` class into the existing classes.
add 19e8496c91 Move to `TestUtilities` methods closer to where they are used. Replace more usages of `java.util.Date` by `java.time.Instant`.
add 5d62feec97 Merge branch 'geoapi-4.0' into geoapi-3.1. This is a consolidation of test code with no significant change in main code.
new d5c8e985dd Merge branch 'geoapi-3.1'
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
endorsed/build.gradle.kts | 1 +
.../org/apache/sis/console/AboutCommandTest.java | 5 +-
.../org/apache/sis/console/CRSCommandTest.java | 42 +--
.../org/apache/sis/console/CommandRunnerTest.java | 11 +-
.../coverage/grid/ConvertedGridCoverageTest.java | 5 +-
.../sis/coverage/grid/DimensionAppenderTest.java | 7 +-
.../coverage/grid/DimensionalityReductionTest.java | 11 +-
.../sis/coverage/grid/GridCoverage2DTest.java | 1 +
.../sis/coverage/grid/GridCoverageBuilderTest.java | 5 +-
.../sis/coverage/grid/GridDerivationTest.java | 79 +++---
.../apache/sis/coverage/grid/GridExtentTest.java | 32 ++-
.../apache/sis/coverage/grid/GridGeometryTest.java | 138 +++++-----
.../sis/coverage/grid/PixelTranslationTest.java | 14 +-
.../coverage/grid/ResampledGridCoverageTest.java | 3 +-
.../test/org/apache/sis/feature/Assertions.java | 27 +-
.../sis/feature/DefaultAssociationRoleTest.java | 11 +-
.../apache/sis/feature/DefaultFeatureTypeTest.java | 5 +-
.../org/apache/sis/feature/FeatureTestCase.java | 7 +-
.../apache/sis/feature/PropertySingletonTest.java | 7 +-
.../apache/sis/feature/SingletonAttributeTest.java | 11 +-
.../feature/builder/FeatureTypeBuilderTest.java | 11 +-
.../sis/geometry/wrapper/j2d/FlatShapeTest.java | 15 +-
.../org/apache/sis/image/ImageProcessorTest.java | 9 +-
.../org/apache/sis/image/ResamplingGridTest.java | 1 +
.../apache/sis/metadata/AbstractMetadataTest.java | 4 +-
.../test/org/apache/sis/metadata/Assertions.java | 221 ---------------
.../apache/sis/metadata/MetadataCopierTest.java | 11 +-
.../apache/sis/metadata/MetadataStandardTest.java | 7 +-
.../org/apache/sis/metadata/NilReasonMapTest.java | 15 +-
.../apache/sis/metadata/PropertyAccessorTest.java | 14 +-
.../sis/metadata/PropertyConsistencyCheck.java | 4 +-
.../sis/metadata/PropertyInformationTest.java | 7 +-
.../apache/sis/metadata/TreeNodeChildrenTest.java | 4 +-
.../test/org/apache/sis/metadata/TreeNodeTest.java | 2 +-
.../org/apache/sis/metadata/TreeTableViewTest.java | 121 +++++++--
.../test/org/apache/sis/metadata/ValueMapTest.java | 7 +-
.../sis/metadata/iso/DefaultIdentifierTest.java | 4 +-
.../sis/metadata/iso/DefaultMetadataTest.java | 8 +-
.../sis/metadata/iso/citation/CitationsTest.java | 28 +-
.../metadata/iso/citation/DefaultCitationTest.java | 21 +-
.../iso/citation/DefaultResponsibilityTest.java | 2 +-
.../constraint/DefaultLegalConstraintsTest.java | 10 +-
.../sis/metadata/iso/content/DefaultBandTest.java | 2 +-
.../sis/metadata/iso/extent/DefaultExtentTest.java | 4 +-
.../extent/DefaultGeographicBoundingBoxTest.java | 13 +-
.../identification/DefaultBrowseGraphicTest.java | 2 +-
.../DefaultDataIdentificationTest.java | 10 +-
.../DefaultRepresentativeFractionTest.java | 2 +-
.../iso/identification/DefaultResolutionTest.java | 2 +-
.../DefaultServiceIdentificationTest.java | 21 +-
.../metadata/iso/lineage/DefaultLineageTest.java | 6 +-
.../quality/AbstractPositionalAccuracyTest.java | 7 +-
.../iso/quality/DefaultQuantitativeResultTest.java | 8 +-
.../sis/metadata/iso/quality/ScopeCodeTest.java | 2 +-
.../sis/metadata/sql/MetadataSourceTest.java | 2 +-
.../sis/metadata/sql/MetadataWriterTest.java | 11 +-
.../apache/sis/temporal/LenientDateFormatTest.java | 28 +-
.../apache/sis/util/iso/DefaultRecordTypeTest.java | 8 +-
.../apache/sis/util/iso/NameMarshallingTest.java | 2 +-
.../sis/xml/CharSequenceSubstitutionTest.java | 2 +-
.../apache/sis/xml/NilReasonMarshallingTest.java | 4 +-
.../org/apache/sis/xml/ReferenceResolverTest.java | 5 +-
.../org/apache/sis/xml/UUIDMarshallingTest.java | 4 +-
.../org/apache/sis/xml/XLinkMarshallingTest.java | 12 +-
.../sis/xml/bind/ModifiableIdentifierMapTest.java | 5 +-
.../sis/xml/bind/cat/CodeListMarshallingTest.java | 1 -
.../sis/xml/bind/cat/EnumMarshallingTest.java | 1 -
.../apache/sis/xml/bind/gml/TimePeriodTest.java | 1 -
.../sis/xml/bind/lan/FreeTextMarshallingTest.java | 1 -
.../apache/sis/xml/bind/lan/LanguageCodeTest.java | 1 -
.../org/apache/sis/xml/bind/lan/PT_LocaleTest.java | 6 +-
.../metadata/replace/QualityParameterTest.java | 1 -
.../metadata/replace/ServiceParameterTest.java | 1 -
.../sis/xml/test/AnnotationConsistencyCheck.java | 4 +-
.../apache/sis/xml/test/DocumentComparator.java | 7 +-
.../test/org/apache/sis/xml/test/TestCase.java | 101 ++++++-
.../sis/openoffice/ReferencingFunctionsTest.java | 10 +-
.../org/apache/sis/openoffice/TransformerTest.java | 18 +-
.../sis/profile/france/FrenchProfileTest.java | 9 +-
.../sis/xml/bind/fra/DataIdentificationTest.java | 7 +-
.../xml/bind/fra/DirectReferenceSystemTest.java | 4 +-
.../gazetteer/GeohashReferenceSystemTest.java | 5 +-
.../referencing/gazetteer/LocationTypeTest.java | 5 +-
.../gazetteer/MilitaryGridReferenceSystemTest.java | 12 +-
.../apache/sis/geometry/AbstractEnvelopeTest.java | 5 +-
.../apache/sis/geometry/CoordinateFormatTest.java | 5 +-
.../apache/sis/geometry/EnvelopeReducerTest.java | 5 +-
.../org/apache/sis/geometry/EnvelopesTest.java | 16 +-
.../sis/geometry/GeneralDirectPositionTest.java | 11 +-
.../apache/sis/geometry/GeneralEnvelopeTest.java | 41 ++-
.../apache/sis/geometry/ImmutableEnvelopeTest.java | 9 +-
.../org/apache/sis/geometry/TransformTestCase.java | 7 +-
.../org/apache/sis/io/wkt/ComparisonWithEPSG.java | 5 +-
.../sis/io/wkt/GeodeticObjectParserTest.java | 25 +-
.../apache/sis/io/wkt/MathTransformParserTest.java | 17 +-
.../org/apache/sis/io/wkt/WKTDictionaryTest.java | 13 +-
.../test/org/apache/sis/io/wkt/WKTFormatTest.java | 7 +-
.../apache/sis/parameter/MatrixParametersTest.java | 4 +-
.../sis/parameter/ParameterMarshallingTest.java | 1 -
.../org/apache/sis/parameter/ParametersTest.java | 7 +-
.../parameter/UnmodifiableParameterValueTest.java | 5 +-
.../referencing/AbstractIdentifiedObjectTest.java | 7 +-
.../referencing/AbstractReferenceSystemTest.java | 12 +-
.../org/apache/sis/referencing/Assertions.java | 30 ++-
.../sis/referencing/AuthorityFactoriesTest.java | 11 +-
.../org/apache/sis/referencing/BuilderTest.java | 3 +-
.../test/org/apache/sis/referencing/CRSTest.java | 11 +-
.../org/apache/sis/referencing/CommonCRSTest.java | 12 +-
.../sis/referencing/EPSGDependentTestCase.java | 52 ----
.../sis/referencing/EPSGFactoryFallbackTest.java | 1 +
.../sis/referencing/GeodesicsOnEllipsoidTest.java | 3 +-
.../sis/referencing/GeodeticCalculatorTest.java | 1 +
.../sis/referencing/IdentifiedObjectsTest.java | 1 +
.../sis/referencing/ImmutableIdentifierTest.java | 4 +-
.../sis/referencing/NamedIdentifierTest.java | 5 +-
.../sis/referencing/StandardDefinitionsTest.java | 6 +-
.../sis/referencing/crs/DefaultDerivedCRSTest.java | 14 +-
.../referencing/crs/DefaultEngineeringCRSTest.java | 1 -
.../referencing/crs/DefaultGeodeticCRSTest.java | 5 +-
.../referencing/crs/DefaultGeographicCRSTest.java | 17 +-
.../referencing/crs/DefaultProjectedCRSTest.java | 10 +-
.../sis/referencing/cs/CoordinateSystemsTest.java | 59 ++--
.../sis/referencing/cs/DefaultCartesianCSTest.java | 9 +-
.../referencing/cs/DefaultEllipsoidalCSTest.java | 9 +-
.../referencing/datum/BursaWolfParametersTest.java | 15 +-
.../datum/DefaultGeodeticDatumTest.java | 10 +-
.../datum/DefaultPrimeMeridianTest.java | 1 -
.../datum/DefaultTemporalDatumTest.java | 9 +-
.../datum/DefaultVerticalDatumTest.java | 7 +-
.../referencing/datum/TimeDependentBWPTest.java | 1 +
.../factory/CommonAuthorityFactoryTest.java | 8 +-
.../factory/ConcurrentAuthorityFactoryTest.java | 2 +
.../sis/referencing/factory/TestFactorySource.java | 10 +-
.../referencing/factory/sql/EPSGFactoryTest.java | 57 ++--
.../referencing/factory/sql/EPSGInstallerTest.java | 15 +-
.../ParameterizedTransformBuilderTest.java | 44 ++-
.../internal/ServicesForMetadataTest.java | 4 +-
.../referencing/legacy/DefaultImageCRSTest.java | 1 -
.../operation/CoordinateOperationFinderTest.java | 170 ++++++------
.../operation/CoordinateOperationRegistryTest.java | 5 +-
.../DefaultConcatenatedOperationTest.java | 21 +-
.../operation/DefaultConversionTest.java | 50 ++--
.../DefaultCoordinateOperationFactoryTest.java | 16 +-
.../operation/DefaultOperationMethodTest.java | 2 +-
.../operation/DefaultPassThroughOperationTest.java | 25 +-
.../operation/SingleOperationMarshallingTest.java | 51 ++--
.../builder/LinearTransformBuilderTest.java | 12 +-
.../operation/builder/LinearizerTest.java | 1 +
.../builder/LocalizationGridBuilderTest.java | 4 +-
.../operation/builder/ResidualGridTest.java | 3 +-
.../referencing/operation/matrix/MatricesTest.java | 13 +-
.../referencing/operation/matrix/Matrix4Test.java | 4 +-
.../operation/matrix/MatrixTestCase.java | 13 +-
.../operation/matrix/NonSquareMatrixTest.java | 38 +--
.../operation/provider/DatumShiftTestCase.java | 14 +-
.../operation/provider/Geographic3Dto2DTest.java | 26 +-
.../operation/provider/LongitudeRotationTest.java | 10 +-
.../referencing/operation/provider/NADCONTest.java | 20 +-
.../referencing/operation/provider/NTv2Test.java | 21 +-
.../operation/provider/ProvidersTest.java | 5 +-
.../transform/ConcatenatedTransformTest.java | 35 +--
.../transform/ContextualParametersTest.java | 25 +-
.../transform/DefaultMathTransformFactoryTest.java | 5 +-
.../operation/transform/DomainDefinitionTest.java | 3 +-
.../transform/EllipsoidToRadiusTransformTest.java | 1 +
.../operation/transform/MathTransformTestCase.java | 1 +
.../operation/transform/MathTransformsTest.java | 72 ++---
.../transform/MolodenskyTransformTest.java | 1 +
.../transform/PassThroughTransformTest.java | 1 +
.../transform/ProjectiveTransformTest.java | 8 +-
.../operation/transform/ScaleTransformTest.java | 10 +-
.../operation/transform/TransferFunctionTest.java | 13 +-
.../transform/TransformSeparatorTest.java | 90 +++----
.../transform/TranslationTransformTest.java | 6 +-
.../transform/WraparoundTransformTest.java | 46 ++--
.../sis/test/integration/ConsistencyTest.java | 8 +-
.../test/integration/CoordinateOperationTest.java | 14 +-
.../sis/test/integration/DatumShiftTest.java | 7 +-
.../sis/test/integration/MetadataVerticalTest.java | 34 +--
.../referencing/SecondDefiningParameterTest.java | 1 -
.../sis/storage/geotiff/GeoTiffStoreTest.java | 17 +-
.../sis/storage/geotiff/SelfConsistencyTest.java | 21 +-
.../sis/storage/geotiff/inflater/CCITTRLETest.java | 4 +-
.../sis/storage/netcdf/SelfConsistencyTest.java | 21 +-
.../apache/sis/storage/netcdf/base/GridTest.java | 8 +-
.../org/apache/sis/storage/sql/SQLStoreTest.java | 8 +-
.../sis/storage/sql/postgis/PostgresTest.java | 4 +-
.../sis/storage/xml/stream/StaxStreamReader.java | 4 +-
.../org/apache/sis/storage/gpx/MetadataTest.java | 5 +-
.../org/apache/sis/storage/gpx/ReaderTest.java | 22 +-
.../org/apache/sis/storage/gpx/UpdaterTest.java | 2 +-
.../org/apache/sis/storage/gpx/WriterTest.java | 9 +-
.../org/apache/sis/storage/FeatureQueryTest.java | 8 +-
.../aggregate/ConcatenatedFeatureSetTest.java | 17 +-
.../sis/storage/base/MetadataBuilderTest.java | 31 +--
.../test/org/apache/sis/storage/csv/StoreTest.java | 11 +-
.../sis/storage/esri/AsciiGridStoreTest.java | 19 +-
.../org/apache/sis/storage/folder/StoreTest.java | 2 -
.../sis/storage/image/WorldFileStoreTest.java | 14 +-
.../test/org/apache/sis/storage/wkt/StoreTest.java | 10 +-
.../test/org/apache/sis/storage/xml/StoreTest.java | 4 +-
.../org/apache/sis/converter/InstantConverter.java | 1 +
.../org/apache/sis/measure/AbstractConverter.java | 18 +-
.../apache/sis/measure/ConcatenatedConverter.java | 3 +
.../org/apache/sis/measure/IdentityConverter.java | 2 +-
.../org/apache/sis/measure/LinearConverter.java | 3 +
.../main/org/apache/sis/measure/RangeFormat.java | 1 +
.../org/apache/sis/measure/ScaleRateOfChange.java | 5 +-
.../main/org/apache/sis/measure/UnitDimension.java | 9 +-
.../main/org/apache/sis/measure/UnitFormat.java | 35 ++-
.../main/org/apache/sis/measure/UnitRegistry.java | 8 +-
.../main/org/apache/sis/measure/UnitServices.java | 4 +-
.../main/org/apache/sis/measure/Units.java | 3 +-
.../main/org/apache/sis/system/DataDirectory.java | 2 +-
.../apache/sis/system/ReferenceQueueConsumer.java | 2 +-
.../main/org/apache/sis/system/Reflect.java | 2 +-
.../main/org/apache/sis/util/StringBuilders.java | 4 +-
.../sis/util/collection/WeakValueHashMap.java | 6 +-
.../sis/util/internal/shared/DefinitionURI.java | 14 +-
.../apache/sis/util/logging/MonolineFormatter.java | 4 +-
.../sis/util/resources/IndexedResourceBundle.java | 4 +-
.../apache/sis/converter/PathConverterTest.java | 26 +-
.../org/apache/sis/measure/AngleFormatTest.java | 68 +++--
.../apache/sis/measure/ConventionalUnitTest.java | 1 +
.../test/org/apache/sis/measure/DateRangeTest.java | 58 ++--
.../apache/sis/measure/LinearConverterTest.java | 2 +
.../test/org/apache/sis/measure/PrefixesTest.java | 1 +
.../org/apache/sis/measure/QuantitiesTest.java | 1 +
.../test/org/apache/sis/measure/ScalarTest.java | 1 +
.../sis/measure/SexagesimalConverterTest.java | 1 +
.../org/apache/sis/measure/SystemUnitTest.java | 1 +
.../org/apache/sis/measure/UnitDimensionTest.java | 1 +
.../org/apache/sis/measure/UnitFormatTest.java | 1 +
.../org/apache/sis/measure/UnitServicesTest.java | 1 +
.../test/org/apache/sis/measure/UnitsTest.java | 1 +
.../test/org/apache/sis/setup/OptionKeyTest.java | 7 +-
.../test/org/apache/sis/test/Assertions.java | 252 +++++++++++++++++-
.../test/org/apache/sis/test/Assumptions.java | 62 -----
.../test/org/apache/sis/test/Benchmark.java | 2 -
.../apache/sis/test/FailureDetailsReporter.java | 4 +-
.../test/org/apache/sis/test/GeoapiAssert.java | 13 +
.../org/apache/sis/test/LogRecordCollector.java | 2 +-
.../test/org/apache/sis/test/OptionalTestData.java | 21 +-
.../org/apache/sis/test/PlatformDependent.java | 36 ---
.../test/org/apache/sis/test/Printer.java | 155 +++++++++++
.../test/org/apache/sis/test/TestCase.java | 248 ++++++++---------
.../org/apache/sis/test/TestConfiguration.java | 104 --------
.../test/org/apache/sis/test/TestUtilities.java | 296 +--------------------
.../test/org/apache/sis/test/package-info.java | 50 ++--
.../apache/sis/test/self/TestUtilitiesTest.java | 59 ----
.../org/apache/sis/util/collection/CacheTest.java | 37 ++-
.../sis/util/collection/DefaultTreeTableTest.java | 25 +-
.../sis/util/collection/WeakHashSetTest.java | 13 +-
.../sis/util/collection/WeakValueHashMapTest.java | 13 +-
.../util/internal/shared/DefinitionURITest.java | 4 +-
.../sis/storage/geopackage/GpkgStoreTest.java | 1 +
.../apache/sis/gui/internal/GUIUtilitiesTest.java | 16 +-
.../resources/embedded/EmbeddedResourcesTest.java | 3 +-
.../sis/referencing/factory/sql/epsg/README.md | 2 +-
.../factory/sql/epsg/ScriptProviderTest.java | 2 +-
260 files changed, 2324 insertions(+), 2498 deletions(-)
delete mode 100644 endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/Assertions.java
delete mode 100644 endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/EPSGDependentTestCase.java
delete mode 100644 endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assumptions.java
delete mode 100644 endorsed/src/org.apache.sis.util/test/org/apache/sis/test/PlatformDependent.java
create mode 100644 endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Printer.java
delete mode 100644 endorsed/src/org.apache.sis.util/test/org/apache/sis/test/TestConfiguration.java
delete mode 100644 endorsed/src/org.apache.sis.util/test/org/apache/sis/test/self/TestUtilitiesTest.java
(sis) 01/01: Merge branch 'geoapi-3.1'
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sis.git
commit d5c8e985dd94ec4dc4f5e1d2ffca15c40dedb353
Merge: ecf0bfa5b2 5d62feec97
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sat Oct 11 16:29:31 2025 +0200
Merge branch 'geoapi-3.1'
endorsed/build.gradle.kts | 1 +
.../org/apache/sis/console/AboutCommandTest.java | 5 +-
.../org/apache/sis/console/CRSCommandTest.java | 42 +--
.../org/apache/sis/console/CommandRunnerTest.java | 11 +-
.../coverage/grid/ConvertedGridCoverageTest.java | 5 +-
.../sis/coverage/grid/DimensionAppenderTest.java | 7 +-
.../coverage/grid/DimensionalityReductionTest.java | 11 +-
.../sis/coverage/grid/GridCoverage2DTest.java | 1 +
.../sis/coverage/grid/GridCoverageBuilderTest.java | 5 +-
.../sis/coverage/grid/GridDerivationTest.java | 79 +++---
.../apache/sis/coverage/grid/GridExtentTest.java | 32 ++-
.../apache/sis/coverage/grid/GridGeometryTest.java | 138 +++++-----
.../sis/coverage/grid/PixelTranslationTest.java | 14 +-
.../coverage/grid/ResampledGridCoverageTest.java | 3 +-
.../test/org/apache/sis/feature/Assertions.java | 27 +-
.../sis/feature/DefaultAssociationRoleTest.java | 11 +-
.../apache/sis/feature/DefaultFeatureTypeTest.java | 5 +-
.../org/apache/sis/feature/FeatureTestCase.java | 7 +-
.../apache/sis/feature/PropertySingletonTest.java | 7 +-
.../apache/sis/feature/SingletonAttributeTest.java | 11 +-
.../feature/builder/FeatureTypeBuilderTest.java | 11 +-
.../sis/geometry/wrapper/j2d/FlatShapeTest.java | 15 +-
.../org/apache/sis/image/ImageProcessorTest.java | 9 +-
.../org/apache/sis/image/ResamplingGridTest.java | 1 +
.../apache/sis/metadata/AbstractMetadataTest.java | 4 +-
.../test/org/apache/sis/metadata/Assertions.java | 221 ---------------
.../apache/sis/metadata/MetadataCopierTest.java | 11 +-
.../apache/sis/metadata/MetadataStandardTest.java | 7 +-
.../org/apache/sis/metadata/NilReasonMapTest.java | 15 +-
.../apache/sis/metadata/PropertyAccessorTest.java | 14 +-
.../sis/metadata/PropertyConsistencyCheck.java | 4 +-
.../sis/metadata/PropertyInformationTest.java | 7 +-
.../apache/sis/metadata/TreeNodeChildrenTest.java | 4 +-
.../test/org/apache/sis/metadata/TreeNodeTest.java | 2 +-
.../org/apache/sis/metadata/TreeTableViewTest.java | 121 +++++++--
.../test/org/apache/sis/metadata/ValueMapTest.java | 7 +-
.../sis/metadata/iso/DefaultIdentifierTest.java | 4 +-
.../sis/metadata/iso/DefaultMetadataTest.java | 8 +-
.../sis/metadata/iso/citation/CitationsTest.java | 28 +-
.../metadata/iso/citation/DefaultCitationTest.java | 21 +-
.../iso/citation/DefaultResponsibilityTest.java | 2 +-
.../constraint/DefaultLegalConstraintsTest.java | 10 +-
.../sis/metadata/iso/content/DefaultBandTest.java | 2 +-
.../sis/metadata/iso/extent/DefaultExtentTest.java | 4 +-
.../extent/DefaultGeographicBoundingBoxTest.java | 13 +-
.../identification/DefaultBrowseGraphicTest.java | 2 +-
.../DefaultDataIdentificationTest.java | 10 +-
.../DefaultRepresentativeFractionTest.java | 2 +-
.../iso/identification/DefaultResolutionTest.java | 2 +-
.../DefaultServiceIdentificationTest.java | 21 +-
.../metadata/iso/lineage/DefaultLineageTest.java | 6 +-
.../quality/AbstractPositionalAccuracyTest.java | 7 +-
.../iso/quality/DefaultQuantitativeResultTest.java | 8 +-
.../sis/metadata/iso/quality/ScopeCodeTest.java | 2 +-
.../sis/metadata/sql/MetadataSourceTest.java | 2 +-
.../sis/metadata/sql/MetadataWriterTest.java | 11 +-
.../apache/sis/temporal/LenientDateFormatTest.java | 28 +-
.../apache/sis/util/iso/DefaultRecordTypeTest.java | 8 +-
.../apache/sis/util/iso/NameMarshallingTest.java | 2 +-
.../sis/xml/CharSequenceSubstitutionTest.java | 2 +-
.../apache/sis/xml/NilReasonMarshallingTest.java | 4 +-
.../org/apache/sis/xml/ReferenceResolverTest.java | 5 +-
.../org/apache/sis/xml/UUIDMarshallingTest.java | 4 +-
.../org/apache/sis/xml/XLinkMarshallingTest.java | 12 +-
.../sis/xml/bind/ModifiableIdentifierMapTest.java | 5 +-
.../sis/xml/bind/cat/CodeListMarshallingTest.java | 1 -
.../sis/xml/bind/cat/EnumMarshallingTest.java | 1 -
.../apache/sis/xml/bind/gml/TimePeriodTest.java | 1 -
.../sis/xml/bind/lan/FreeTextMarshallingTest.java | 1 -
.../apache/sis/xml/bind/lan/LanguageCodeTest.java | 1 -
.../org/apache/sis/xml/bind/lan/PT_LocaleTest.java | 6 +-
.../metadata/replace/QualityParameterTest.java | 1 -
.../metadata/replace/ServiceParameterTest.java | 1 -
.../sis/xml/test/AnnotationConsistencyCheck.java | 4 +-
.../apache/sis/xml/test/DocumentComparator.java | 7 +-
.../test/org/apache/sis/xml/test/TestCase.java | 101 ++++++-
.../sis/openoffice/ReferencingFunctionsTest.java | 10 +-
.../org/apache/sis/openoffice/TransformerTest.java | 18 +-
.../sis/profile/france/FrenchProfileTest.java | 9 +-
.../sis/xml/bind/fra/DataIdentificationTest.java | 7 +-
.../xml/bind/fra/DirectReferenceSystemTest.java | 4 +-
.../gazetteer/GeohashReferenceSystemTest.java | 5 +-
.../referencing/gazetteer/LocationTypeTest.java | 5 +-
.../gazetteer/MilitaryGridReferenceSystemTest.java | 12 +-
.../apache/sis/geometry/AbstractEnvelopeTest.java | 5 +-
.../apache/sis/geometry/CoordinateFormatTest.java | 5 +-
.../apache/sis/geometry/EnvelopeReducerTest.java | 5 +-
.../org/apache/sis/geometry/EnvelopesTest.java | 16 +-
.../sis/geometry/GeneralDirectPositionTest.java | 11 +-
.../apache/sis/geometry/GeneralEnvelopeTest.java | 41 ++-
.../apache/sis/geometry/ImmutableEnvelopeTest.java | 9 +-
.../org/apache/sis/geometry/TransformTestCase.java | 7 +-
.../org/apache/sis/io/wkt/ComparisonWithEPSG.java | 5 +-
.../sis/io/wkt/GeodeticObjectParserTest.java | 25 +-
.../apache/sis/io/wkt/MathTransformParserTest.java | 17 +-
.../org/apache/sis/io/wkt/WKTDictionaryTest.java | 13 +-
.../test/org/apache/sis/io/wkt/WKTFormatTest.java | 7 +-
.../apache/sis/parameter/MatrixParametersTest.java | 4 +-
.../sis/parameter/ParameterMarshallingTest.java | 1 -
.../org/apache/sis/parameter/ParametersTest.java | 7 +-
.../parameter/UnmodifiableParameterValueTest.java | 5 +-
.../referencing/AbstractIdentifiedObjectTest.java | 7 +-
.../referencing/AbstractReferenceSystemTest.java | 12 +-
.../org/apache/sis/referencing/Assertions.java | 30 ++-
.../sis/referencing/AuthorityFactoriesTest.java | 11 +-
.../org/apache/sis/referencing/BuilderTest.java | 3 +-
.../test/org/apache/sis/referencing/CRSTest.java | 11 +-
.../org/apache/sis/referencing/CommonCRSTest.java | 12 +-
.../sis/referencing/EPSGDependentTestCase.java | 52 ----
.../sis/referencing/EPSGFactoryFallbackTest.java | 1 +
.../sis/referencing/GeodesicsOnEllipsoidTest.java | 3 +-
.../sis/referencing/GeodeticCalculatorTest.java | 1 +
.../sis/referencing/IdentifiedObjectsTest.java | 1 +
.../sis/referencing/ImmutableIdentifierTest.java | 4 +-
.../sis/referencing/NamedIdentifierTest.java | 5 +-
.../sis/referencing/StandardDefinitionsTest.java | 6 +-
.../sis/referencing/crs/DefaultDerivedCRSTest.java | 14 +-
.../referencing/crs/DefaultEngineeringCRSTest.java | 1 -
.../referencing/crs/DefaultGeodeticCRSTest.java | 5 +-
.../referencing/crs/DefaultGeographicCRSTest.java | 17 +-
.../referencing/crs/DefaultProjectedCRSTest.java | 10 +-
.../sis/referencing/cs/CoordinateSystemsTest.java | 59 ++--
.../sis/referencing/cs/DefaultCartesianCSTest.java | 9 +-
.../referencing/cs/DefaultEllipsoidalCSTest.java | 9 +-
.../referencing/datum/BursaWolfParametersTest.java | 15 +-
.../datum/DefaultGeodeticDatumTest.java | 10 +-
.../datum/DefaultPrimeMeridianTest.java | 1 -
.../datum/DefaultTemporalDatumTest.java | 9 +-
.../datum/DefaultVerticalDatumTest.java | 7 +-
.../referencing/datum/TimeDependentBWPTest.java | 1 +
.../factory/CommonAuthorityFactoryTest.java | 8 +-
.../factory/ConcurrentAuthorityFactoryTest.java | 2 +
.../sis/referencing/factory/TestFactorySource.java | 10 +-
.../referencing/factory/sql/EPSGFactoryTest.java | 57 ++--
.../referencing/factory/sql/EPSGInstallerTest.java | 15 +-
.../ParameterizedTransformBuilderTest.java | 44 ++-
.../internal/ServicesForMetadataTest.java | 4 +-
.../referencing/legacy/DefaultImageCRSTest.java | 1 -
.../operation/CoordinateOperationFinderTest.java | 170 ++++++------
.../operation/CoordinateOperationRegistryTest.java | 5 +-
.../DefaultConcatenatedOperationTest.java | 21 +-
.../operation/DefaultConversionTest.java | 50 ++--
.../DefaultCoordinateOperationFactoryTest.java | 16 +-
.../operation/DefaultOperationMethodTest.java | 2 +-
.../operation/DefaultPassThroughOperationTest.java | 25 +-
.../operation/SingleOperationMarshallingTest.java | 51 ++--
.../builder/LinearTransformBuilderTest.java | 12 +-
.../operation/builder/LinearizerTest.java | 1 +
.../builder/LocalizationGridBuilderTest.java | 4 +-
.../operation/builder/ResidualGridTest.java | 3 +-
.../referencing/operation/matrix/MatricesTest.java | 13 +-
.../referencing/operation/matrix/Matrix4Test.java | 4 +-
.../operation/matrix/MatrixTestCase.java | 13 +-
.../operation/matrix/NonSquareMatrixTest.java | 38 +--
.../operation/provider/DatumShiftTestCase.java | 14 +-
.../operation/provider/Geographic3Dto2DTest.java | 26 +-
.../operation/provider/LongitudeRotationTest.java | 10 +-
.../referencing/operation/provider/NADCONTest.java | 20 +-
.../referencing/operation/provider/NTv2Test.java | 21 +-
.../operation/provider/ProvidersTest.java | 5 +-
.../transform/ConcatenatedTransformTest.java | 35 +--
.../transform/ContextualParametersTest.java | 25 +-
.../transform/DefaultMathTransformFactoryTest.java | 5 +-
.../operation/transform/DomainDefinitionTest.java | 3 +-
.../transform/EllipsoidToRadiusTransformTest.java | 1 +
.../operation/transform/MathTransformTestCase.java | 1 +
.../operation/transform/MathTransformsTest.java | 72 ++---
.../transform/MolodenskyTransformTest.java | 1 +
.../transform/PassThroughTransformTest.java | 1 +
.../transform/ProjectiveTransformTest.java | 8 +-
.../operation/transform/ScaleTransformTest.java | 10 +-
.../operation/transform/TransferFunctionTest.java | 13 +-
.../transform/TransformSeparatorTest.java | 90 +++----
.../transform/TranslationTransformTest.java | 6 +-
.../transform/WraparoundTransformTest.java | 46 ++--
.../sis/test/integration/ConsistencyTest.java | 8 +-
.../test/integration/CoordinateOperationTest.java | 14 +-
.../sis/test/integration/DatumShiftTest.java | 7 +-
.../sis/test/integration/MetadataVerticalTest.java | 34 +--
.../referencing/SecondDefiningParameterTest.java | 1 -
.../sis/storage/geotiff/GeoTiffStoreTest.java | 17 +-
.../sis/storage/geotiff/SelfConsistencyTest.java | 21 +-
.../sis/storage/geotiff/inflater/CCITTRLETest.java | 4 +-
.../sis/storage/netcdf/SelfConsistencyTest.java | 21 +-
.../apache/sis/storage/netcdf/base/GridTest.java | 8 +-
.../org/apache/sis/storage/sql/SQLStoreTest.java | 8 +-
.../sis/storage/sql/postgis/PostgresTest.java | 4 +-
.../sis/storage/xml/stream/StaxStreamReader.java | 4 +-
.../org/apache/sis/storage/gpx/MetadataTest.java | 5 +-
.../org/apache/sis/storage/gpx/ReaderTest.java | 22 +-
.../org/apache/sis/storage/gpx/UpdaterTest.java | 2 +-
.../org/apache/sis/storage/gpx/WriterTest.java | 9 +-
.../org/apache/sis/storage/FeatureQueryTest.java | 8 +-
.../aggregate/ConcatenatedFeatureSetTest.java | 17 +-
.../sis/storage/base/MetadataBuilderTest.java | 31 +--
.../test/org/apache/sis/storage/csv/StoreTest.java | 11 +-
.../sis/storage/esri/AsciiGridStoreTest.java | 19 +-
.../org/apache/sis/storage/folder/StoreTest.java | 2 -
.../sis/storage/image/WorldFileStoreTest.java | 14 +-
.../test/org/apache/sis/storage/wkt/StoreTest.java | 10 +-
.../test/org/apache/sis/storage/xml/StoreTest.java | 4 +-
.../org/apache/sis/converter/InstantConverter.java | 1 +
.../org/apache/sis/measure/AbstractConverter.java | 18 +-
.../apache/sis/measure/ConcatenatedConverter.java | 3 +
.../org/apache/sis/measure/IdentityConverter.java | 2 +-
.../org/apache/sis/measure/LinearConverter.java | 3 +
.../main/org/apache/sis/measure/RangeFormat.java | 1 +
.../org/apache/sis/measure/ScaleRateOfChange.java | 5 +-
.../main/org/apache/sis/measure/UnitDimension.java | 9 +-
.../main/org/apache/sis/measure/UnitFormat.java | 35 ++-
.../main/org/apache/sis/measure/UnitRegistry.java | 8 +-
.../main/org/apache/sis/measure/UnitServices.java | 4 +-
.../main/org/apache/sis/measure/Units.java | 3 +-
.../main/org/apache/sis/system/DataDirectory.java | 2 +-
.../apache/sis/system/ReferenceQueueConsumer.java | 2 +-
.../main/org/apache/sis/system/Reflect.java | 2 +-
.../main/org/apache/sis/util/StringBuilders.java | 4 +-
.../sis/util/collection/WeakValueHashMap.java | 6 +-
.../sis/util/internal/shared/DefinitionURI.java | 14 +-
.../apache/sis/util/logging/MonolineFormatter.java | 4 +-
.../sis/util/resources/IndexedResourceBundle.java | 4 +-
.../apache/sis/converter/PathConverterTest.java | 26 +-
.../org/apache/sis/measure/AngleFormatTest.java | 68 +++--
.../apache/sis/measure/ConventionalUnitTest.java | 1 +
.../test/org/apache/sis/measure/DateRangeTest.java | 58 ++--
.../apache/sis/measure/LinearConverterTest.java | 2 +
.../test/org/apache/sis/measure/PrefixesTest.java | 1 +
.../org/apache/sis/measure/QuantitiesTest.java | 1 +
.../test/org/apache/sis/measure/ScalarTest.java | 1 +
.../sis/measure/SexagesimalConverterTest.java | 1 +
.../org/apache/sis/measure/SystemUnitTest.java | 1 +
.../org/apache/sis/measure/UnitDimensionTest.java | 1 +
.../org/apache/sis/measure/UnitFormatTest.java | 1 +
.../org/apache/sis/measure/UnitServicesTest.java | 1 +
.../test/org/apache/sis/measure/UnitsTest.java | 1 +
.../test/org/apache/sis/setup/OptionKeyTest.java | 7 +-
.../test/org/apache/sis/test/Assertions.java | 252 +++++++++++++++++-
.../test/org/apache/sis/test/Assumptions.java | 62 -----
.../test/org/apache/sis/test/Benchmark.java | 2 -
.../apache/sis/test/FailureDetailsReporter.java | 4 +-
.../test/org/apache/sis/test/GeoapiAssert.java | 13 +
.../org/apache/sis/test/LogRecordCollector.java | 2 +-
.../test/org/apache/sis/test/OptionalTestData.java | 21 +-
.../org/apache/sis/test/PlatformDependent.java | 36 ---
.../test/org/apache/sis/test/Printer.java | 155 +++++++++++
.../test/org/apache/sis/test/TestCase.java | 248 ++++++++---------
.../org/apache/sis/test/TestConfiguration.java | 104 --------
.../test/org/apache/sis/test/TestUtilities.java | 296 +--------------------
.../test/org/apache/sis/test/package-info.java | 50 ++--
.../apache/sis/test/self/TestUtilitiesTest.java | 59 ----
.../org/apache/sis/util/collection/CacheTest.java | 37 ++-
.../sis/util/collection/DefaultTreeTableTest.java | 25 +-
.../sis/util/collection/WeakHashSetTest.java | 13 +-
.../sis/util/collection/WeakValueHashMapTest.java | 13 +-
.../util/internal/shared/DefinitionURITest.java | 4 +-
.../sis/storage/geopackage/GpkgStoreTest.java | 1 +
.../apache/sis/gui/internal/GUIUtilitiesTest.java | 16 +-
.../resources/embedded/EmbeddedResourcesTest.java | 3 +-
.../sis/referencing/factory/sql/epsg/README.md | 2 +-
.../factory/sql/epsg/ScriptProviderTest.java | 2 +-
260 files changed, 2324 insertions(+), 2498 deletions(-)
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/DimensionalityReductionTest.java
index 1ab16e06d2,ea3f46d23c..02f106df7c
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/DimensionalityReductionTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/DimensionalityReductionTest.java
@@@ -33,10 -33,10 +33,8 @@@ import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestCase;
import org.apache.sis.referencing.crs.HardCodedCRS;
-
- // Specific to the main branch:
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
+ import static org.apache.sis.feature.Assertions.assertGridToCornerEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-
/**
* Tests {@link DimensionalityReduction}.
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/GridDerivationTest.java
index d09f8da1cd,ecc073aad5..996708fb49
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/GridDerivationTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/GridDerivationTest.java
@@@ -47,10 -47,11 +47,11 @@@ import org.apache.sis.test.TestCase
import org.apache.sis.referencing.crs.HardCodedCRS;
import org.apache.sis.referencing.operation.HardCodedConversions;
import static org.apache.sis.referencing.Assertions.assertEnvelopeEquals;
+ import static org.apache.sis.feature.Assertions.assertGridToCenterEquals;
+ import static org.apache.sis.feature.Assertions.assertGridToCornerEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertBetween;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertBetween;
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
/**
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java
index 40806d204b,815ee1ff17..752f2c51c9
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java
@@@ -74,6 -75,6 +74,7 @@@ import static org.apache.sis.test.Geoap
* @author Alexis Manin (Geomatys)
* @author Johann Sorel (Geomatys)
*/
++@SuppressWarnings("exports")
public final class ResampledGridCoverageTest extends TestCase {
/**
* The random number generator used for generating some grid coverage values.
@@@ -314,7 -315,7 +315,7 @@@
final GridCoverage target = processor.resample(source, targetGG);
assertInstanceOf(TranslatedGridCoverage.class, target, "Expected fast path.");
assertSame(targetGG, target.getGridGeometry());
- assertEnvelopeEquals(sourceGG.getEnvelope(), targetGG.getEnvelope(), STRICT);
- assertEnvelopeEquals(sourceGG.getEnvelope(), targetGG.getEnvelope(), 0);
++ assertEnvelopeEquals(sourceGG.getEnvelope(), targetGG.getEnvelope());
/*
* The envelope is BOX(20 15, 80 77). Evaluate a single point inside that envelope.
* The result for identical "real world" coordinates should be the same for both coverages.
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/Assertions.java
index dc206297b3,52d73444f0..cf04b48080
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/Assertions.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/Assertions.java
@@@ -24,10 -27,10 +27,11 @@@ import org.apache.sis.coverage.grid.Pix
// Test dependencies
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.referencing.Assertions.assertMatrixEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.coverage.grid.SequenceType;
+// Specific to the main branch:
+import java.awt.geom.PathIterator;
+import org.apache.sis.image.SequenceType;
/**
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultAssociationRoleTest.java
index 28e1ee3f92,98feb1c3f4..ede830cac0
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultAssociationRoleTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultAssociationRoleTest.java
@@@ -27,8 -27,12 +27,8 @@@ import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertSerializedEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.FeatureAssociationRole;
-import org.opengis.feature.FeatureType;
-
/**
* Tests {@link DefaultAssociationRole}.
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultFeatureTypeTest.java
index 1d79073e9f,dabece676e..1b7b5b4090
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultFeatureTypeTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultFeatureTypeTest.java
@@@ -28,8 -28,12 +28,8 @@@ import static org.junit.jupiter.api.Ass
import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertMessageContains;
import static org.apache.sis.test.Assertions.assertSerializedEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
-
/**
* Tests {@link DefaultFeatureType}.
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/FeatureTestCase.java
index c080642aad,03ca90fa67..3086664902
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/FeatureTestCase.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/FeatureTestCase.java
@@@ -32,9 -32,14 +32,9 @@@ import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.*;
import static org.apache.sis.test.Assertions.assertMessageContains;
import static org.apache.sis.test.Assertions.assertSerializedEquals;
- import org.apache.sis.test.TestUtilities;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.apache.sis.test.TestCase;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Attribute;
-import org.opengis.feature.AttributeType;
-import org.opengis.feature.Property;
-
/**
* Tests common to {@link DenseFeatureTest} and {@link SparseFeatureTest}.
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
index 38ff241c70,f2dfd21286..bb97dbc31a
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
@@@ -28,15 -28,16 +28,15 @@@ import org.apache.sis.feature.internal.
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import static org.apache.sis.test.Assertions.assertMessageContains;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.apache.sis.feature.DefaultFeatureTypeTest;
import org.apache.sis.test.TestCase;
- import org.apache.sis.test.TestUtilities;
import org.apache.sis.referencing.crs.HardCodedCRS;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.AttributeType;
-import org.opengis.feature.FeatureType;
-import org.opengis.feature.IdentifiedType;
-import org.opengis.feature.Operation;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractIdentifiedType;
+import org.apache.sis.feature.DefaultAttributeType;
+import org.apache.sis.feature.DefaultFeatureType;
/**
diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/geometry/wrapper/j2d/FlatShapeTest.java
index 568f008677,fbf15b8b29..50e63e6460
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/geometry/wrapper/j2d/FlatShapeTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/geometry/wrapper/j2d/FlatShapeTest.java
@@@ -39,6 -41,13 +41,13 @@@ public final class FlatShapeTest extend
public FlatShapeTest() {
}
+ /**
+ * Asserts that the path of the actual shape has the same segments as the expected shape.
+ */
+ private static void assertShapeEqual(final Shape expected, final Shape actual) {
- assertPathEquals(expected.getPathIterator(null), actual.getPathIterator(null), 0, 0, null);
++ assertPathEquals(expected.getPathIterator(null), actual.getPathIterator(null), 0);
+ }
+
/**
* Tests {@link Polyline} using {@link Path2D} as a reference implementation.
*/
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/MetadataStandardTest.java
index f584fb9aa3,7a9448e055..25341545ad
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/MetadataStandardTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/MetadataStandardTest.java
@@@ -40,8 -40,12 +40,8 @@@ import org.apache.sis.test.TestCase
import org.apache.sis.metadata.iso.citation.HardCodedCitations;
import static org.apache.sis.test.Assertions.assertMessageContains;
import static org.apache.sis.test.Assertions.assertSerializedEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import java.util.List;
-import org.opengis.coverage.grid.RectifiedGrid;
-
/**
* Tests the {@link MetadataStandard} class.
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java
index a413ae7c33,7834bebffd..0f9862fcbe
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java
@@@ -377,9 -380,9 +377,9 @@@ public final class PropertyAccessorTes
/*
* Compares with the non-deprecated property.
*/
- final Collection<AttributeGroup> groups = instance.getAttributeGroups();
+ final Collection<DefaultAttributeGroup> groups = instance.getAttributeGroups();
assertSame(groups, accessor.get(indexOfReplacement, instance));
- assertEquals(CoverageContentType.IMAGE, getSingleton(getSingleton(groups).getContentTypes()));
+ assertEquals(CoverageContentType.IMAGE, assertSingleton(assertSingleton(groups).getContentTypes()));
/*
* While we can read/write the value through two properties,
* only one should be visible.
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyConsistencyCheck.java
index 74b3df7703,4625dcc01c..398904e26d
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyConsistencyCheck.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyConsistencyCheck.java
@@@ -33,7 -33,11 +33,8 @@@ import org.apache.sis.metadata.internal
import org.junit.jupiter.api.Test;
import org.apache.sis.test.TestUtilities;
import org.apache.sis.xml.test.AnnotationConsistencyCheck;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.util.ControlledVocabulary;
-
/**
* Base class for tests done on metadata objects using reflection. This base class tests JAXB annotations
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeTableViewTest.java
index ddacace30a,ef18e25728..0ef6a247cf
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeTableViewTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeTableViewTest.java
@@@ -91,8 -92,70 +92,70 @@@ public final class TreeTableViewTest ex
public void testToString() {
final TreeTableView metadata = create(ValueExistencePolicy.COMPACT);
assertFalse(metadata.getColumns().contains(MetadataColumn.NIL_REASON));
- assertMultilinesEquals(EXPECTED, formatMetadata(metadata)); // Locale-independent
- assertArrayEquals(toTreeStructure(EXPECTED), toTreeStructure(metadata.toString())); // Locale-dependent.
+ assertMetadataTreeEquals(EXPECTED, metadata); // Locale-independent
+ final String[] structure = {
+ "",
+ " ├─",
+ " ├─",
+ " ├─",
+ " ├─",
+ " │ ├─",
+ " │ └─",
+ " ├─",
+ " │ ├─",
- " │ │ └─",
- " │ │ └─",
- " │ │ └─",
+ " │ └─",
++ " │ └─",
++ " │ └─",
++ " │ └─",
+ " ├─",
+ " ├─",
+ " └─",
+ ""
+ };
+ assertArrayEquals(structure, toTreeStructure(EXPECTED)); // Test of `toTreeStructure(CharSequence)`.
+ assertArrayEquals(structure, toTreeStructure(metadata.toString())); // Locale-dependent.
+ }
+
+ /**
+ * Returns the tree structure of the given string representation, without the localized text.
+ * For example, given the following string:
+ *
+ * <pre class="text">
+ * Citation
+ * ├─Title…………………………………………………… Some title
+ * └─Cited responsible party
+ * └─Individual name……………… Some person of contact</pre>
+ *
+ * this method returns an array containing the following elements:
+ *
+ * <pre class="text">
+ * "",
+ * " ├─",
+ * " └─",
+ * " └─"</pre>
+ *
+ * This method is used for comparing two trees having string representation in different locales.
+ * In such case, we cannot compare the actual text content. The best we can do is to compare
+ * the tree structure.
+ *
+ * @param tree the string representation of a tree.
+ * @return the structure of the given tree, without text.
+ */
+ static CharSequence[] toTreeStructure(final CharSequence tree) {
+ final CharSequence[] lines = CharSequences.split(tree, '\n');
+ for (int i=0; i<lines.length; i++) {
+ final CharSequence line = lines[i];
+ final int length = line.length();
+ for (int j=0; j<length;) {
+ final int c = Character.codePointAt(line, j);
+ if (Character.isLetterOrDigit(c)) {
+ lines[i] = line.subSequence(0, j);
+ break;
+ }
+ j += Character.charCount(c);
+ }
+ }
+ return lines;
}
/**
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/DefaultMetadataTest.java
index 01c06cc607,73cc17f5fd..92799e9ea5
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/DefaultMetadataTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/DefaultMetadataTest.java
@@@ -37,9 -37,13 +37,9 @@@ import org.apache.sis.metadata.iso.cita
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.test.TestUtilities.getSingleton;
- import static org.apache.sis.metadata.Assertions.assertTitleEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-import static org.apache.sis.test.Assertions.assertSingletonCitation;
+ import static org.apache.sis.test.Assertions.assertTitleEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.MetadataScope;
-
/**
* Tests {@link DefaultMetadata}, without Coordinate Reference System (CRS) information.
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/citation/CitationsTest.java
index df44920cbc,9979383b20..f34a2e4ddc
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/citation/CitationsTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/citation/CitationsTest.java
@@@ -35,14 -34,12 +34,15 @@@ import static org.apache.sis.metadata.i
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertSerializedEquals;
- import static org.apache.sis.metadata.Assertions.assertTitleEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertPartyNameEquals;
+ import static org.apache.sis.test.Assertions.assertTitleEquals;
+ import org.apache.sis.test.TestCase;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
+
/**
* Tests {@link Citations}.
@@@ -222,20 -220,12 +223,13 @@@ public final class CitationsTest extend
* Tests {@code getCitedResponsibleParties()} on some {@code Citation} constants.
*/
@Test
+ @org.junit.jupiter.api.Disabled("Requires GeoAPI 3.1.")
public void testGetCitedResponsibleParty() {
- assertEquals("Open Geospatial Consortium", getCitedResponsibleParty(OGC));
- assertEquals("International Organization for Standardization", getCitedResponsibleParty(ISO_19115.get(0)));
- assertEquals("International Organization for Standardization", getCitedResponsibleParty(ISO_19115.get(1)));
- assertEquals("International Association of Oil & Gas producers", getCitedResponsibleParty(EPSG));
- assertEquals("International Association of Oil & Gas producers", getCitedResponsibleParty(IOGP));
- }
-
- /**
- * Returns the responsible party for the given constant.
- */
- private static String getCitedResponsibleParty(final Citation citation) {
- return getSingleton(citation.getCitedResponsibleParties()).getOrganisationName().toString(Locale.US);
+ assertPartyNameEquals("Open Geospatial Consortium", OGC, "OGC");
+ assertPartyNameEquals("International Organization for Standardization", ISO_19115.get(0), "ISO_19115");
+ assertPartyNameEquals("International Organization for Standardization", ISO_19115.get(1), "ISO_19115");
+ assertPartyNameEquals("International Association of Oil & Gas producers", EPSG, "EPSG");
+ assertPartyNameEquals("International Association of Oil & Gas producers", IOGP, "IOGP");
}
/**
@@@ -247,9 -237,9 +241,9 @@@
*/
@Test
public void testEPSG() {
- final Identifier identifier = getSingleton(EPSG.getIdentifiers());
+ final Identifier identifier = assertSingleton(EPSG.getIdentifiers());
assertEquals("EPSG", toCodeSpace(EPSG));
- assertEquals("IOGP", identifier.getCodeSpace());
+// assertEquals("IOGP", identifier.getCodeSpace());
assertEquals("EPSG", identifier.getCode());
}
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
index c7d20efd24,a3083b869b..2b4e19a2f3
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
@@@ -49,12 -49,13 +49,12 @@@ import org.apache.sis.metadata.iso.exte
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.metadata.xml.TestUsingFile;
- import static org.apache.sis.test.TestUtilities.getSingleton;
- import static org.apache.sis.metadata.Assertions.assertTitleEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertTitleEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.citation.CitationDate;
-import org.opengis.metadata.citation.Party;
-import org.opengis.metadata.citation.Responsibility;
+// Specific to the main branch:
+import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.util.CodeList;
/**
@@@ -306,12 -308,12 +307,12 @@@ public final class DefaultCitationTest
public static void verifyUnmarshalledCitation(final Citation c) {
assertTitleEquals("Fight against poverty", c, "citation");
- final var date = (DefaultCitationDate) getSingleton(c.getDates());
- final CitationDate date = assertSingleton(c.getDates());
++ final var date = assertInstanceOf(DefaultCitationDate.class, assertSingleton(c.getDates()));
assertEquals(date.getReferenceDate(), OffsetDateTime.of(2015, 10, 17, 2, 0, 0, 0, ZoneOffset.ofHours(2)));
- assertEquals(DateType.ADOPTED, date.getDateType());
- assertEquals(PresentationForm.PHYSICAL_OBJECT, assertSingleton(c.getPresentationForms()));
+ assertEqualsIgnoreCase(DateType.valueOf("adopted"), date.getDateType());
- assertEqualsIgnoreCase(PresentationForm.valueOf("physicalObject"), getSingleton(c.getPresentationForms()));
++ assertEqualsIgnoreCase(PresentationForm.valueOf("physicalObject"), assertSingleton(c.getPresentationForms()));
- final Iterator<? extends Responsibility> it = c.getCitedResponsibleParties().iterator();
+ final Iterator<? extends ResponsibleParty> it = c.getCitedResponsibleParties().iterator();
final Contact contact = assertResponsibilityEquals(Role.ORIGINATOR, "Maid Marian", it.next());
assertEquals("Send carrier pigeon.", String.valueOf(contact.getContactInstructions()));
@@@ -329,20 -331,10 +330,20 @@@
/**
* Asserts that the given responsibility has the expected properties, then returns its contact info.
*/
- private static Contact assertResponsibilityEquals(final Role role, final String name, final Responsibility actual) {
- assertEquals(role, actual.getRole());
- final Party p = assertSingleton(actual.getParties());
+ private static Contact assertResponsibilityEquals(final Role role, final String name, final ResponsibleParty actual) {
+ assertEqualsIgnoreCase(role, actual.getRole());
- final AbstractParty p = getSingleton(((DefaultResponsibleParty) actual).getParties());
++ final AbstractParty p = assertSingleton(assertInstanceOf(DefaultResponsibleParty.class, actual).getParties());
assertEquals(name, String.valueOf(p.getName()));
- return getSingleton(p.getContactInfo());
+ return assertSingleton(p.getContactInfo());
}
+
+ /**
+ * Asserts that two codes are equal, ignoring case and underscore. This method is used for comparing instances
+ * created by {@code valueOf(String)}, because it is difficult to guarantee that they have the expected case.
+ * It depends on the test order execution, because other tests create the same codes with different cases.
+ */
+ private static void assertEqualsIgnoreCase(CodeList<?> expected, CodeList<?> actual) {
+ assertEquals(expected.getClass(), actual.getClass());
+ assertTrue(expected.name().equalsIgnoreCase(actual.name().replace("_", "")));
+ }
}
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
index f71dde74f6,ea05b7d9af..03e136c7d5
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
@@@ -89,10 -90,10 +89,10 @@@ public final class DefaultLegalConstrai
"</mco:MD_LegalConstraints>\n";
final DefaultLegalConstraints c = new DefaultLegalConstraints();
- c.setUseConstraints(Set.of(Restriction.LICENCE));
+ c.setUseConstraints(Set.of(Restriction.LICENSE));
assertXmlEquals(xml, marshal(c), "xmlns:*");
DefaultLegalConstraints actual = unmarshal(DefaultLegalConstraints.class, xml);
- assertSame(Restriction.LICENSE, getSingleton(actual.getUseConstraints()));
- assertSame(Restriction.LICENCE, assertSingleton(actual.getUseConstraints()));
++ assertSame(Restriction.LICENSE, assertSingleton(actual.getUseConstraints()));
assertEquals(c, actual);
/*
* Above code tested ISO 19115-3 (un)marshalling. Code below test legacy ISO 19139:2007 (un)marshalling.
@@@ -109,7 -111,7 +109,7 @@@
assertXmlEquals(xml, marshal(c, VERSION_2007), "xmlns:*");
actual = unmarshal(DefaultLegalConstraints.class, xml);
- assertSame(Restriction.LICENSE, getSingleton(actual.getUseConstraints()));
- assertSame(Restriction.LICENCE, assertSingleton(actual.getUseConstraints()));
++ assertSame(Restriction.LICENSE, assertSingleton(actual.getUseConstraints()));
assertEquals(c, actual);
}
}
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java
index 334470cb85,68bb57d992..636a6cb9a0
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java
@@@ -29,11 -29,16 +29,11 @@@ import org.apache.sis.xml.NilReason
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.metadata.xml.TestUsingFile;
- import static org.apache.sis.metadata.Assertions.assertTitleEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertTitleEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.parameter.ParameterDirection;
-import org.opengis.metadata.identification.CouplingType;
-import org.opengis.metadata.identification.CoupledResource;
-import org.opengis.metadata.identification.OperationMetadata;
-import org.opengis.metadata.identification.ServiceIdentification;
-import org.opengis.metadata.identification.DistributedComputingPlatform;
+// Specific to the main branch:
+import org.apache.sis.pending.geoapi.evolution.UnsupportedCodeList;
/**
@@@ -81,24 -87,24 +82,24 @@@ public final class DefaultServiceIdenti
* Compare values of the given service identifications against the value expected for the
* instance created by {@link #create()} method.
*/
- private static void verify(final ServiceIdentification id) {
+ private static void verify(final DefaultServiceIdentification id) {
- assertEquals("1.0", getSingleton(id.getServiceTypeVersions()));
+ assertEquals("1.0", assertSingleton(id.getServiceTypeVersions()));
assertEquals("Web Map Server", String.valueOf(id.getServiceType()));
assertEquals("A dummy service for testing purpose.", String.valueOf(id.getAbstract()));
assertEquals(NilReason.MISSING, NilReason.forObject(id.getCitation()));
- assertEquals(CouplingType.LOOSE, id.getCouplingType());
+ assertEquals(UnsupportedCodeList.valueOf("loose"), id.getCouplingType());
- final DefaultCoupledResource resource = getSingleton(id.getCoupledResources());
- final CoupledResource resource = assertSingleton(id.getCoupledResources());
++ final DefaultCoupledResource resource = assertSingleton(id.getCoupledResources());
// assertEquals("scopedName", "mySpace:ABC-123", …) skipped because not present in new ISO 19115-3:2016.
// assertEquals("resourceReference", "WMS specification", …) skipped because not present in legacy ISO 19139:2007.
- final OperationMetadata op = resource.getOperation();
+ final DefaultOperationMetadata op = resource.getOperation();
assertNotNull(op);
assertEquals("Get Map", op.getOperationName());
- assertEquals(UnsupportedCodeList.valueOf("WEB_SERVICES"), getSingleton(op.getDistributedComputingPlatforms()));
- assertEquals(NilReason.MISSING, NilReason.forObject(getSingleton(op.getConnectPoints())));
- assertEquals(DistributedComputingPlatform.WEB_SERVICES, assertSingleton(op.getDistributedComputingPlatforms()));
++ assertEquals(UnsupportedCodeList.valueOf("WEB_SERVICES"), assertSingleton(op.getDistributedComputingPlatforms()));
+ assertEquals(NilReason.MISSING, NilReason.forObject(assertSingleton(op.getConnectPoints())));
- final ParameterDescriptor<?> param = getSingleton(op.getParameters());
+ final ParameterDescriptor<?> param = assertSingleton(op.getParameters());
assertEquals("My service parameter", String.valueOf(param.getName()));
assertEquals(0, param.getMinimumOccurs());
assertEquals(1, param.getMaximumOccurs());
@@@ -111,10 -118,10 +112,10 @@@
*/
@Test
public void testUnmarshal() throws JAXBException {
- final ServiceIdentification id = unmarshalFile(ServiceIdentification.class, openTestFile(Format.XML2016));
+ final DefaultServiceIdentification id = unmarshalFile(DefaultServiceIdentification.class, openTestFile(Format.XML2016));
verify(id);
- final DefaultCoupledResource resource = getSingleton(id.getCoupledResources());
- assertTitleEquals("WMS specification", getSingleton(resource.getResourceReferences()), "resourceReference");
- final CoupledResource resource = assertSingleton(id.getCoupledResources());
++ final DefaultCoupledResource resource = assertSingleton(id.getCoupledResources());
+ assertTitleEquals("WMS specification", assertSingleton(resource.getResourceReferences()), "resourceReference");
}
/**
@@@ -124,9 -131,9 +125,9 @@@
*/
@Test
public void testUnmarshalLegacy() throws JAXBException {
- final ServiceIdentification id = unmarshalFile(ServiceIdentification.class, openTestFile(Format.XML2007));
+ final DefaultServiceIdentification id = unmarshalFile(DefaultServiceIdentification.class, openTestFile(Format.XML2007));
verify(id);
- final DefaultCoupledResource resource = getSingleton(id.getCoupledResources());
- final CoupledResource resource = assertSingleton(id.getCoupledResources());
++ final DefaultCoupledResource resource = assertSingleton(id.getCoupledResources());
assertEquals("mySpace:ABC-123", String.valueOf(resource.getScopedName()));
}
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResultTest.java
index 12e2378377,b487fedd1c..b76ea33aca
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResultTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResultTest.java
@@@ -149,12 -149,12 +149,12 @@@ public final class DefaultQuantitativeR
* Before to compare the two `Element`, compare some individual components.
* The intent is to identify which metadata is not equal in case of test failure.
*/
- final QuantitativeResult uResult = (QuantitativeResult) TestUtilities.getSingleton(unmarshalled.getResults());
- final QuantitativeResult pResult = (QuantitativeResult) TestUtilities.getSingleton(programmatic.getResults());
+ final QuantitativeResult uResult = assertInstanceOf(QuantitativeResult.class, assertSingleton(unmarshalled.getResults()));
+ final QuantitativeResult pResult = assertInstanceOf(QuantitativeResult.class, assertSingleton(programmatic.getResults()));
final RecordType uType = uResult.getValueType();
final RecordType pType = pResult.getValueType();
- final Map<MemberName,Type> uFields = uType.getFieldTypes();
- final Map<MemberName,Type> pFields = pType.getFieldTypes();
+ final Map<MemberName,Type> uFields = uType.getMemberTypes();
+ final Map<MemberName,Type> pFields = pType.getMemberTypes();
final Iterator<MemberName> uIter = uFields.keySet().iterator();
final Iterator<MemberName> pIter = pFields.keySet().iterator();
assertEquals(uFields.size(), pFields.size());
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/quality/ScopeCodeTest.java
index 85f7db7eca,7126c254f7..a48d8fa9dc
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/quality/ScopeCodeTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/quality/ScopeCodeTest.java
@@@ -23,10 -23,9 +23,9 @@@ import org.opengis.metadata.maintenance
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.maintenance.Scope;
+// Specific to the main branch:
+import org.opengis.metadata.quality.Scope;
/**
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataSourceTest.java
index 8a6e143d9b,1cf2845cbf..8581d5a183
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataSourceTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataSourceTest.java
@@@ -18,7 -18,7 +18,6 @@@ package org.apache.sis.metadata.sql
import java.util.Set;
import java.util.Collection;
--import java.util.Collections;
import org.opengis.util.InternationalString;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.distribution.Format;
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataWriterTest.java
index d05dda578d,704ad84971..90f57ebee1
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataWriterTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataWriterTest.java
@@@ -29,13 -29,16 +29,13 @@@ import org.apache.sis.metadata.iso.cita
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.apache.sis.test.TestCase;
- import org.apache.sis.test.TestUtilities;
import org.apache.sis.metadata.iso.citation.HardCodedCitations;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.citation.Contact;
-import org.opengis.metadata.citation.Party;
-import org.opengis.metadata.citation.Responsibility;
-import org.apache.sis.util.internal.shared.URLs;
+// Specific to the main branch:
+import org.opengis.metadata.citation.ResponsibleParty;
/**
@@@ -120,7 -123,7 +121,7 @@@ public final class MetadataWriterTest e
assertEquals("EPSG", source.search(HardCodedCitations.EPSG));
assertEquals("SIS", source.search(HardCodedCitations.SIS));
assertNull ( source.search(HardCodedCitations.ISO_19111));
- assertEquals("EPSG", source.search(TestUtilities.getSingleton(
- assertEquals("{rp}EPSG", source.search(assertSingleton(
++ assertEquals("EPSG", source.search(assertSingleton(
HardCodedCitations.EPSG.getCitedResponsibleParties())));
}
@@@ -152,13 -155,21 +153,13 @@@
/*
* Ask for dependencies that are known to exist.
*/
- final ResponsibleParty responsible = TestUtilities.getSingleton(c.getCitedResponsibleParties());
- final Responsibility responsible = assertSingleton(c.getCitedResponsibleParties());
++ final ResponsibleParty responsible = assertSingleton(c.getCitedResponsibleParties());
assertEquals(Role.PRINCIPAL_INVESTIGATOR, responsible.getRole());
- final Party party = assertSingleton(responsible.getParties());
- assertEquals("International Association of Oil & Gas Producers", party.getName().toString());
- final Contact contact = assertSingleton(party.getContactInfo());
- /*
- * Invoke the deprecated `getOnlineResource()` method (singular form) before the non-deprecated
- * `getOnlineResources()` (plural form) replacement. They shall give the same result no matter
- * which form were stored in the database.
- */
- @SuppressWarnings("deprecation")
- final OnlineResource resource = contact.getOnlineResource();
- assertSame(resource, assertSingleton(contact.getOnlineResources()));
- assertEquals(URLs.EPSG, resource.getLinkage().toString());
+ assertEquals("International Association of Oil & Gas Producers", responsible.getOrganisationName().toString());
+
+ OnlineResource resource = responsible.getContactInfo().getOnlineResource();
+ assertEquals("https://epsg.org/", resource.getLinkage().toString());
assertEquals(OnLineFunction.INFORMATION, resource.getFunction());
/*
* Ask columns that are known to not exist.
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/CharSequenceSubstitutionTest.java
index 59b6ca75ea,031f5b96ce..eb44adaa38
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/CharSequenceSubstitutionTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/CharSequenceSubstitutionTest.java
@@@ -31,11 -31,9 +31,10 @@@ import static org.apache.sis.metadata.i
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.Identifier;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
+import org.apache.sis.metadata.iso.DefaultIdentifier;
/**
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/ReferenceResolverTest.java
index b1f8bd1bdd,5fc6ef730b..d1c7fe39b3
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/ReferenceResolverTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/ReferenceResolverTest.java
@@@ -56,11 -57,11 +57,11 @@@ public final class ReferenceResolverTes
/*
* The fragment should reference the exact same object as the one in the citation.
*/
- final var parent = assertSingleton(citation.getCitedResponsibleParties().iterator().next().getParties());
- final var reusing = assertSingleton(assertSingleton(data.getPointOfContacts()).getParties());
- assertEquals("Little John", reusing.getName().toString());
- assertSame(assertSingleton(parent .getContactInfo()),
- assertSingleton(reusing.getContactInfo()));
+ final var parent = citation.getCitedResponsibleParties().iterator().next();
- final var reusing = getSingleton(data.getPointOfContacts());
++ final var reusing = assertSingleton(data.getPointOfContacts());
+ assertEquals("Little John", reusing.getIndividualName());
+ assertSame(parent .getContactInfo(),
+ reusing.getContactInfo());
}
}
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/cat/CodeListMarshallingTest.java
index 39493a0ffa,d02197bdeb..9ffb36153c
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/cat/CodeListMarshallingTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/cat/CodeListMarshallingTest.java
@@@ -35,10 -35,9 +35,9 @@@ import org.apache.sis.xml.internal.shar
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.citation.Responsibility;
+// Specific to the main branch:
+import org.opengis.metadata.citation.ResponsibleParty;
/**
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/lan/LanguageCodeTest.java
index c86f8ef49b,2c55c17a55..2f004a71c2
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/lan/LanguageCodeTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/lan/LanguageCodeTest.java
@@@ -35,8 -35,10 +35,7 @@@ import org.junit.jupiter.api.TestInstan
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.mock.MetadataMock;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.apache.sis.test.Assertions.assertSingleton;
-
/**
* Tests the XML marshalling of {@code Locale} when used for a language.
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/metadata/replace/QualityParameterTest.java
index 59d36ec33d,4568f09813..d40411cdab
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/metadata/replace/QualityParameterTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/metadata/replace/QualityParameterTest.java
@@@ -26,10 -26,11 +26,9 @@@ import org.apache.sis.xml.Namespaces
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.Identifier;
-import org.opengis.referencing.operation.Matrix;
-import org.opengis.metadata.quality.ValueStructure;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
/**
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/metadata/replace/ServiceParameterTest.java
index c4eb58af24,5b98ab6667..187c646a46
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/metadata/replace/ServiceParameterTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/metadata/replace/ServiceParameterTest.java
@@@ -25,10 -25,10 +25,9 @@@ import org.apache.sis.util.iso.Names
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.Identifier;
-import org.opengis.parameter.ParameterDirection;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
/**
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/test/AnnotationConsistencyCheck.java
index a13ca7d495,93e1964f32..191b318351
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/test/AnnotationConsistencyCheck.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/test/AnnotationConsistencyCheck.java
@@@ -43,9 -43,14 +43,9 @@@ import org.apache.sis.xml.bind.cat.Code
// Test dependencies
import org.opentest4j.AssertionFailedError;
import org.junit.jupiter.api.Test;
- import org.apache.sis.test.TestUtilities;
import org.apache.sis.test.TestCaseWithLogs;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.annotation.Classifier;
-import org.opengis.annotation.Stereotype;
-import org.opengis.util.ControlledVocabulary;
-
/**
* Verifies consistency between {@link UML}, {@link XmlElement} and other annotations.
diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/test/org/apache/sis/referencing/gazetteer/GeohashReferenceSystemTest.java
index e22fd2318f,a3f9638fd0..a79326516e
--- a/endorsed/src/org.apache.sis.referencing.gazetteer/test/org/apache/sis/referencing/gazetteer/GeohashReferenceSystemTest.java
+++ b/endorsed/src/org.apache.sis.referencing.gazetteer/test/org/apache/sis/referencing/gazetteer/GeohashReferenceSystemTest.java
@@@ -30,9 -30,13 +30,9 @@@ import org.apache.sis.measure.Units
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.apache.sis.test.TestCase;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.referencing.gazetteer.Location;
-import org.opengis.referencing.gazetteer.LocationType;
-
/**
* Tests methods from the {@link GeohashReferenceSystem} class.
@@@ -267,7 -272,7 +268,7 @@@ public final class GeohashReferenceSyst
assertEquals("Mapping", rs.getTheme().toString(Locale.ENGLISH));
assertEquals("Cartographie", rs.getTheme().toString(Locale.FRENCH));
- final AbstractLocationType type = TestUtilities.getSingleton(rs.getLocationTypes());
- final LocationType type = assertSingleton(rs.getLocationTypes());
++ final AbstractLocationType type = assertSingleton(rs.getLocationTypes());
assertEquals("Geohash", type.getName().toString(Locale.ENGLISH));
assertEquals(0, type.getParents().size());
assertEquals(0, type.getChildren().size());
diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/test/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystemTest.java
index d334bdff5d,d2dc64daf3..1048fd0146
--- a/endorsed/src/org.apache.sis.referencing.gazetteer/test/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystemTest.java
+++ b/endorsed/src/org.apache.sis.referencing.gazetteer/test/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystemTest.java
@@@ -69,17 -75,17 +71,17 @@@ public final class MilitaryGridReferenc
assertEquals("Mapping", rs.getTheme().toString(Locale.ENGLISH));
assertEquals("Cartographie", rs.getTheme().toString(Locale.FRENCH));
- final AbstractLocationType gzd = TestUtilities.getSingleton(rs.getLocationTypes());
- final LocationType gzd = assertSingleton(rs.getLocationTypes());
++ final AbstractLocationType gzd = assertSingleton(rs.getLocationTypes());
assertEquals("Grid zone designator", gzd.getName().toString(Locale.ENGLISH));
assertEquals(0, gzd.getParents().size());
- final AbstractLocationType sid = TestUtilities.getSingleton(gzd.getChildren());
- final LocationType sid = assertSingleton(gzd.getChildren());
++ final AbstractLocationType sid = assertSingleton(gzd.getChildren());
assertEquals("100 km square identifier", sid.getName().toString(Locale.ENGLISH));
- assertSame(gzd, TestUtilities.getSingleton(sid.getParents()));
+ assertSame(gzd, assertSingleton(sid.getParents()));
- final AbstractLocationType gc = TestUtilities.getSingleton(sid.getChildren());
- final LocationType gc = assertSingleton(sid.getChildren());
++ final AbstractLocationType gc = assertSingleton(sid.getChildren());
assertEquals("Grid coordinate", gc.getName().toString(Locale.ENGLISH));
- assertSame(sid, TestUtilities.getSingleton(gc.getParents()));
+ assertSame(sid, assertSingleton(gc.getParents()));
}
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
index 0c40ddb160,e2b4e30c67..56125e4843
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
@@@ -791,11 -788,10 +794,10 @@@ public final class GeodeticObjectParser
" Scope[“Large and medium scale topographic mapping and engineering survey.”],\n" +
" Id[“EPSG”, 27572, URI[“urn:ogc:def:crs:EPSG::27572”]]]";
- final ProjectedCRS crs = parse(ProjectedCRS.class, wkt);
+ final var crs = parse(DefaultProjectedCRS.class, wkt);
validateParisFranceII(crs, 27572, false);
- assertEquals("Large and medium scale topographic mapping and engineering survey.",
- getSingleton(crs.getDomains()).getScope().toString());
- assertNull(getSingleton(crs.getIdentifiers()).getVersion(), "Identifier shall not have a version.");
+ assertEquals("Large and medium scale topographic mapping and engineering survey.", assertSingletonScope(crs));
+ assertNull(assertSingleton(crs.getIdentifiers()).getVersion(), "Identifier shall not have a version.");
}
/**
@@@ -828,11 -824,10 +830,10 @@@
" Scope[“Large and medium scale topographic mapping and engineering survey.”]],\n" +
" Id[“EPSG”, 27572, URI[“urn:ogc:def:crs:EPSG::27572”]]]";
- final ProjectedCRS crs = parse(ProjectedCRS.class, wkt);
+ final var crs = parse(DefaultProjectedCRS.class, wkt);
validateParisFranceII(crs, 27572, false);
- assertEquals("Large and medium scale topographic mapping and engineering survey.",
- getSingleton(crs.getDomains()).getScope().toString());
- assertNull(getSingleton(crs.getIdentifiers()).getVersion(), "Identifier shall not have a version.");
+ assertEquals("Large and medium scale topographic mapping and engineering survey.", assertSingletonScope(crs));
+ assertNull(assertSingleton(crs.getIdentifiers()).getVersion(), "Identifier shall not have a version.");
}
/**
@@@ -1012,9 -1007,9 +1013,9 @@@
assertNameAndIdentifierEqual("RH2000 height", 5613, crs);
assertNameAndIdentifierEqual("Rikets hojdsystem 2000", 0, crs.getDatum());
- Temporal epoch = assertInstanceOf(DynamicReferenceFrame.class, crs.getDatum()).getFrameReferenceEpoch();
+ Temporal epoch = assertInstanceOf(DefaultVerticalDatum.Dynamic.class, crs.getDatum()).getFrameReferenceEpoch();
assertEquals(Year.of(2000), epoch);
- assertEquals("Geodesy, engineering survey.", getSingleton(crs.getDomains()).getScope().toString());
+ assertEquals("Geodesy, engineering survey.", assertSingletonScope(crs));
assertEquals("Replaces RH70 (CRS code 5718) from 2005.", crs.getRemarks().toString());
}
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/WKTDictionaryTest.java
index 575775fe4a,d151a4c74c..eefa01dbde
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/WKTDictionaryTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/WKTDictionaryTest.java
@@@ -41,14 -41,14 +41,14 @@@ import org.apache.sis.util.collection.B
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
- import org.apache.sis.referencing.EPSGDependentTestCase;
+ import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertSetEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import static org.apache.sis.test.Assertions.assertMessageContains;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.Identifier;
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
/**
@@@ -381,7 -382,7 +382,7 @@@ public final class WKTDictionaryTest ex
* for checking precedence.
*/
GeographicCRS crs = factory.createGeographicCRS("2C");
- ReferenceIdentifier id = TestUtilities.getSingleton(crs.getIdentifiers());
- Identifier id = assertSingleton(crs.getIdentifiers());
++ ReferenceIdentifier id = assertSingleton(crs.getIdentifiers());
assertEquals("TEST", id.getCodeSpace());
assertEquals("21", id.getCode());
assertSame(crs, factory.createGeographicCRS("2C")); // Test caching.
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/Assertions.java
index 84e4241848,ba89350d13..82454489fd
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/Assertions.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/Assertions.java
@@@ -53,16 -54,12 +54,15 @@@ import org.apache.sis.util.internal.sha
// Test dependencies
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
import static org.apache.sis.test.Assertions.assertMultilinesEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
+
/**
- * Assertion methods used by the {@code org.apache.sis.referencing} module in addition of the ones inherited
- * from other modules and libraries.
+ * Assertion methods used by the {@code org.apache.sis.referencing} module.
*
* @author Martin Desruisseaux (Geomatys)
*/
@@@ -487,6 -481,17 +484,17 @@@ public final class Assertions
}
}
+ /**
+ * Asserts that the given transform can be represented by the given matrix.
+ *
+ * @param expected the expected matrix.
+ * @param actual the transform from which to get the actual matrix.
+ * @param message header of the exception message in case of failure, or {@code null} if none.
+ */
+ public static void assertMatrixEquals(final Matrix expected, final MathTransform actual, final String message) {
- org.opengis.test.Assertions.assertMatrixEquals(expected, MathTransforms.getMatrix(actual), message);
++ org.apache.sis.test.GeoapiAssert.assertMatrixEquals(expected, MathTransforms.getMatrix(actual), message);
+ }
+
/**
* Asserts that the WKT of the given object according the given convention is equal to the expected one.
* This method expected the {@code “…”} quotation marks instead of {@code "…"} for easier readability of
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java
index 9e590b2ee9,faf8f9c3b7..fd9af21f06
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java
@@@ -42,12 -42,8 +42,13 @@@ import org.apache.sis.referencing.crs.H
* @author Matthieu Bastianelli (Geomatys)
* @author Martin Desruisseaux (Geomatys)
*/
+ @SuppressWarnings("exports")
public final class GeodesicsOnEllipsoidTest extends GeodeticCalculatorTest {
+ /**
+ * Tolerance threshold for comparison of floating point numbers.
+ */
+ private static final double STRICT = 0;
+
/**
* The {@link GeodesicsOnEllipsoid} instance to be tested.
* A specialized type is used for tracking locale variables.
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/ImmutableIdentifierTest.java
index 9e25de1b6b,032c4bc63e..fb65ea0fae
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/ImmutableIdentifierTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/ImmutableIdentifierTest.java
@@@ -36,12 -36,11 +36,11 @@@ import static org.junit.jupiter.api.Ass
import org.opengis.test.Validators;
import org.apache.sis.xml.test.TestCase;
import static org.apache.sis.test.Assertions.assertMessageContains;
- import static org.apache.sis.metadata.Assertions.assertTitleEquals;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
+ import static org.apache.sis.test.Assertions.assertTitleEquals;
import static org.apache.sis.referencing.Assertions.assertWktEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.metadata.Identifier.*;
+// Specific to the main branch:
+import static org.opengis.referencing.ReferenceIdentifier.*;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/NamedIdentifierTest.java
index 4766e888bf,b289fa6873..4011e13ca2
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/NamedIdentifierTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/NamedIdentifierTest.java
@@@ -54,8 -55,8 +55,8 @@@ public final class NamedIdentifierTest
*/
@Test
public void testCreateFromCode() {
- final NamedIdentifier identifier = new NamedIdentifier(Citations.EPSG, "EPSG", "4326", "8.3", null);
+ final var identifier = new NamedIdentifier(Citations.EPSG, "EPSG", "4326", "8.3", null);
- Validators.validate((Identifier) identifier);
+ Validators.validate((ReferenceIdentifier) identifier);
Validators.validate((GenericName) identifier);
// ImmutableIdentifier properties
@@@ -80,8 -81,8 +81,8 @@@
public void testCreateFromName() {
final NameFactory factory = DefaultNameFactory.provider();
final NameSpace scope = factory.createNameSpace(factory.createLocalName(null, "IOGP"), null);
- final NamedIdentifier identifier = new NamedIdentifier(factory.createGenericName(scope, "EPSG", "4326"));
+ final var identifier = new NamedIdentifier(factory.createGenericName(scope, "EPSG", "4326"));
- Validators.validate((Identifier) identifier);
+ Validators.validate((ReferenceIdentifier) identifier);
Validators.validate((GenericName) identifier);
// ImmutableIdentifier properties
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
index f99783f9da,3e1f6da698..5d87a13449
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
@@@ -39,11 -38,11 +38,11 @@@ import org.apache.sis.referencing.opera
import org.apache.sis.xml.test.TestCase;
import org.apache.sis.referencing.cs.HardCodedCS;
import static org.apache.sis.referencing.Assertions.assertEpsgNameAndIdentifierEqual;
+ import static org.apache.sis.referencing.Assertions.assertMatrixEquals;
import static org.apache.sis.referencing.Assertions.assertWktEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java
index bbe0e90e72,ed6627d0e3..5e21b2c102
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java
@@@ -31,11 -31,10 +31,10 @@@ import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.xml.test.TestCase;
import org.apache.sis.referencing.cs.HardCodedCS;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
import static org.apache.sis.referencing.Assertions.assertWktEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
index e15f77979e,d614bf7202..2f7043ba3f
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
@@@ -30,10 -30,10 +30,10 @@@ import org.opengis.test.Validators
import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertEqualsIgnoreMetadata;
import static org.apache.sis.referencing.Assertions.assertWktEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.Identifier;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
/**
@@@ -94,7 -95,7 +95,7 @@@ public final class DefaultGeographicCRS
@Test
public void testIdentifiers() {
GeographicCRS crs = CommonCRS.WGS72.geographic();
- ReferenceIdentifier identifier = getSingleton(crs.getIdentifiers());
- Identifier identifier = assertSingleton(crs.getIdentifiers());
++ ReferenceIdentifier identifier = assertSingleton(crs.getIdentifiers());
assertEquals("EPSG", identifier.getCodeSpace());
assertEquals("4322", identifier.getCode());
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
index fcec06c232,0d0cf62ce2..d3271e1153
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
@@@ -50,11 -50,12 +50,12 @@@ import static org.junit.jupiter.api.Ass
import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertSetEquals;
import static org.apache.sis.test.Assertions.assertNotDeepEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonAuthorityCode;
import static org.apache.sis.referencing.Assertions.assertWktEqualsRegex;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/TestFactorySource.java
index 13221f3a35,bae2ecf671..bdc9da0fa8
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/TestFactorySource.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/TestFactorySource.java
@@@ -28,9 -28,10 +28,10 @@@ import org.apache.sis.referencing.facto
// Test dependencies
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assumptions.*;
+ import static org.apache.sis.test.TestCase.assumeConnectionToEPSG;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertBetween;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertBetween;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
index 125ec8039e,99d047429c..cfdc62a935
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
@@@ -72,11 -71,10 +71,10 @@@ import org.apache.sis.referencing.facto
import static org.apache.sis.test.Assertions.assertNotDeepEquals;
import static org.apache.sis.referencing.Assertions.assertEpsgNameAndIdentifierEqual;
import static org.apache.sis.referencing.Assertions.assertAliasTipEquals;
- import static org.apache.sis.test.TestCase.TAG_SLOW;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertMatrixEquals;
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
index 90d12db3f1,c9f5de2af0..4549ed817d
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
@@@ -73,10 -74,9 +74,9 @@@ import org.apache.sis.referencing.cs.Ha
import org.apache.sis.referencing.crs.HardCodedCRS;
import static org.apache.sis.test.Assertions.assertMessageContains;
import static org.apache.sis.test.Assertions.assertSetEquals;
- import static org.apache.sis.test.TestCase.STRICT;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.test.Assertions;
+// Specific to the main branch:
+import org.apache.sis.test.GeoapiAssert;
/**
@@@ -162,9 -163,10 +163,9 @@@ public final class CoordinateOperationF
* Verifies that the current transform is a linear transform with a matrix equals to the given one.
*/
private void assertMatrixEquals(final Matrix expected) {
- Assertions.assertMatrixEquals(
- expected,
+ GeoapiAssert.assertMatrixEquals(expected,
assertInstanceOf(LinearTransform.class, transform).getMatrix(),
- STRICT, "transform.matrix");
+ "transform.matrix");
}
/**
@@@ -1013,13 -1012,16 +1012,16 @@@
final var linear = assertInstanceOf(LinearTransform.class, transform);
assertEquals(3, linear.getSourceDimensions());
assertEquals(4, linear.getTargetDimensions());
- GeoapiAssert.assertMatrixEquals(Matrices.create(5, 4, new double[] {
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 1./SECONDS_PER_DAY, 40587,
- 0, 0, 0, 1
- }), linear.getMatrix(), 1E-12, "transform.matrix");
- Assertions.assertMatrixEquals(
++ GeoapiAssert.assertMatrixEquals(
+ Matrices.create(5, 4, new double[] {
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 1./SECONDS_PER_DAY, 40587,
+ 0, 0, 0, 1}),
+ linear.getMatrix(),
+ 1E-12, // Tolerance
+ "transform.matrix");
tolerance = 2E-12;
verifyTransform(new double[] {
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
index da654f1a23,0af8b32bad..93fb33d13e
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
@@@ -45,9 -44,10 +44,10 @@@ import org.junit.jupiter.api.parallel.E
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.apache.sis.referencing.operation.transform.MathTransformTestCase;
import static org.apache.sis.referencing.Assertions.assertEpsgNameAndIdentifierEqual;
+ import static org.apache.sis.test.TestCase.assumeConnectionToEPSG;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.Identifier;
+// Specific to the main branch:
+import org.opengis.referencing.ReferenceIdentifier;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
index 78fd919922,0c2131c328..b98ee7b6ff
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
@@@ -36,11 -37,11 +37,11 @@@ import org.opengis.test.Validators
import org.apache.sis.xml.test.TestCase;
import org.apache.sis.referencing.datum.HardCodedDatum;
import org.apache.sis.referencing.crs.HardCodedCRS;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import static org.apache.sis.referencing.Assertions.assertWktEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertIdentifierEquals;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertIdentifierEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultConversionTest.java
index b9fcea9634,afec45c053..457f6a7748
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultConversionTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultConversionTest.java
@@@ -49,11 -49,8 +49,11 @@@ import org.apache.sis.referencing.datum
import org.apache.sis.parameter.DefaultParameterDescriptorTest;
import static org.apache.sis.test.Assertions.assertMessageContains;
import static org.apache.sis.test.Assertions.assertSerializedEquals;
+ import static org.apache.sis.referencing.Assertions.assertMatrixEquals;
+// Specific to the main branch:
+import static org.apache.sis.pending.geoapi.referencing.MissingMethods.getDatumEnsemble;
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
+
/**
* Tests {@link DefaultConversion}.
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
index c99c4aafe7,dd4d45662c..7dd4f5d2de
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
@@@ -27,12 -28,10 +28,12 @@@ import org.opengis.referencing.operatio
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.opengis.test.Validators;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-import static org.opengis.test.Assertions.assertIdentifierEquals;
+
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertIdentifierEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java
index 1cc9107bea,c1f13bcf1f..4632677458
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java
@@@ -46,14 -45,14 +45,14 @@@ import static org.junit.jupiter.api.Ass
import org.opengis.test.Validators;
import org.apache.sis.xml.bind.referencing.CC_OperationParameterGroupTest;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.test.TestUtilities.getSingleton;
- import static org.apache.sis.test.TestUtilities.getScope;
- import static org.apache.sis.test.TestUtilities.getDomainOfValidity;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonAuthorityCode;
+ import static org.apache.sis.test.Assertions.assertSingletonScope;
+ import static org.apache.sis.test.Assertions.assertSingletonDomainOfValidity;
+ import static org.apache.sis.referencing.Assertions.assertMatrixEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertIdentifierEquals;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertIdentifierEquals;
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
index 5b280b79f5,8daf9b7dc0..954465a1dd
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
@@@ -23,10 -23,9 +23,9 @@@ import static java.lang.Double.NaN
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertMatrixEquals;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/provider/NTv2Test.java
index 7b745c8e30,368fae9223..2d2c01391b
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/provider/NTv2Test.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/provider/NTv2Test.java
@@@ -41,14 -41,11 +41,11 @@@ import org.apache.sis.parameter.Paramet
import org.apache.sis.system.DataDirectory;
// Test dependencies
- import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
- import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static org.junit.jupiter.api.Assertions.*;
- import static org.apache.sis.test.TestCase.TAG_SLOW;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertMatrixEquals;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/provider/ProvidersTest.java
index d6ab4709ce,430de3c4d3..f589ef3438
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/provider/ProvidersTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/provider/ProvidersTest.java
@@@ -39,13 -39,10 +39,11 @@@ import org.apache.sis.referencing.facto
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import static org.junit.jupiter.api.Assumptions.abort;
- import static org.junit.jupiter.api.Assumptions.assumeTrue;
import org.apache.sis.test.TestCase;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertBetween;
+// Specific to the main branch:
+import org.apache.sis.parameter.DefaultParameterDescriptor;
+import static org.apache.sis.test.GeoapiAssert.assertBetween;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java
index c2a85b86e7,6c10782429..40f9ca188d
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java
@@@ -32,11 -31,8 +31,11 @@@ import org.apache.sis.referencing.opera
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import static org.apache.sis.test.TestCase.STRICT;
+ import org.apache.sis.referencing.Assertions;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
+
/**
* Tests the {@link ConcatenatedTransform} class.
@@@ -199,8 -196,8 +199,8 @@@ public final class ConcatenatedTransfor
*/
after .m11 = -after .m11; after .m12 = 0;
before.m11 = -before.m11; before.m12 = 0;
- assertMatrixEquals(before, MathTransforms.getMatrix(steps.get(0)), STRICT, "before");
- assertMatrixEquals(after, MathTransforms.getMatrix(steps.get(2)), STRICT, "after");
- assertMatrixEquals(before, MathTransforms.getMatrix(steps.get(0)), null, "before");
- assertMatrixEquals(after, MathTransforms.getMatrix(steps.get(2)), null, "after");
++ assertMatrixEquals(before, MathTransforms.getMatrix(steps.get(0)), "before");
++ assertMatrixEquals(after, MathTransforms.getMatrix(steps.get(2)), "after");
}
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
index 088284e86d,9cca92ced7..b0f8bb1379
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
@@@ -48,11 -48,8 +48,11 @@@ import org.apache.sis.test.TestCase
import org.apache.sis.referencing.cs.HardCodedCS;
import org.apache.sis.referencing.crs.HardCodedCRS;
import static org.apache.sis.test.Assertions.assertMessageContains;
+ import static org.apache.sis.referencing.Assertions.assertMatrixEquals;
+// Specific to the main branch:
+import static org.apache.sis.referencing.internal.shared.CoordinateOperations.builder;
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
+
/**
* Tests the registration of operation methods in {@link DefaultMathTransformFactory}. This test uses the
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
index c4644fb167,999f0b5cba..260ddc2e58
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
@@@ -32,11 -32,10 +32,10 @@@ import org.apache.sis.geometry.GeneralD
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import static org.apache.sis.test.TestCase.STRICT;
import org.apache.sis.test.TestCase;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertMatrixEquals;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
index 33e162dc33,f9443e90d2..416a663a02
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
@@@ -38,14 -38,11 +38,13 @@@ import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith;
import static org.junit.jupiter.api.Assertions.*;
import org.opengis.test.Validators;
+ import org.apache.sis.referencing.Assertions;
import org.apache.sis.test.FailureDetailsReporter;
- import static org.apache.sis.test.TestCase.STRICT;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.test.referencing.AffineTransformTest;
+// Specific to the main branch:
+import org.opengis.referencing.operation.MathTransformFactory;
+import org.junit.jupiter.api.Disabled;
+import org.opengis.test.referencing.TransformTestCase;
- import org.apache.sis.test.GeoapiAssert;
/**
@@@ -56,19 -53,9 +55,19 @@@
*
* @author Martin Desruisseaux (Geomatys)
*/
- @SuppressWarnings("doclint:missing")
+ @SuppressWarnings("exports")
@ExtendWith(FailureDetailsReporter.class)
-public class ProjectiveTransformTest extends AffineTransformTest {
+public class ProjectiveTransformTest extends TransformTestCase {
+ /**
+ * The factory to use for creating linear transforms.
+ */
+ private final MathTransformFactory mtFactory;
+
+ /**
+ * The matrix for the tested transform.
+ */
+ private Matrix matrix;
+
/**
* A math transform factory which delegates instantiations to the enclosing test class.
* This is a workaround while waiting for JEP 447: Statements before super(…).
@@@ -242,8 -169,8 +241,7 @@@
public void testOptimizeConstant() throws FactoryException, TransformException {
matrix = new Matrix2(0, 10, 0, 1);
transform = mtFactory.createAffineTransform(matrix);
- GeoapiAssert.assertMatrixEquals(matrix, assertInstanceOf(LinearTransform.class, transform).getMatrix(), STRICT,
- "Transform shall use the given matrix unmodified.");
+ Assertions.assertMatrixEquals(matrix, transform, "Transform shall use the given matrix unmodified.");
- verifyConsistency(1, 2, 3, -3, -2, -1);
}
/**
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/TranslationTransformTest.java
index 74d352290f,054a91a845..28f9b8eb86
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/TranslationTransformTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/TranslationTransformTest.java
@@@ -26,10 -26,7 +26,9 @@@ import org.apache.sis.util.internal.sha
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import static org.apache.sis.test.TestCase.STRICT;
-import org.apache.sis.referencing.Assertions;
+
+// Specific to the main branch:
+import org.apache.sis.test.GeoapiAssert;
/**
@@@ -55,7 -53,7 +55,7 @@@ public final class TranslationTransform
final TranslationTransform tr = new TranslationTransform(matrix.getNumRow(), elements);
assertEquals(dimensions, tr.getSourceDimensions());
assertEquals(dimensions, tr.getTargetDimensions());
- GeoapiAssert.assertMatrixEquals(matrix, tr.getMatrix(), STRICT, "matrix");
- Assertions.assertMatrixEquals(matrix, tr, "matrix");
++ GeoapiAssert.assertMatrixEquals(matrix, tr.getMatrix(), "matrix");
assertArrayEquals(elements, getElementAsNumbers(tr));
transform = tr;
validate();
@@@ -96,7 -94,7 +96,7 @@@
final TranslationTransform tr = new TranslationTransform(4, elements);
assertEquals(3, tr.getSourceDimensions());
assertEquals(3, tr.getTargetDimensions());
- GeoapiAssert.assertMatrixEquals(matrix, tr.getMatrix(), STRICT, "matrix");
- Assertions.assertMatrixEquals(matrix, tr, "matrix");
++ GeoapiAssert.assertMatrixEquals(matrix, tr.getMatrix(), "matrix");
replaceZeroByNull(elements, O);
assertArrayEquals(elements, tr.getElementAsNumbers(false));
diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/test/integration/MetadataVerticalTest.java
index 50fd25399b,77e142cc98..03ac6997c1
--- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/test/integration/MetadataVerticalTest.java
+++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/test/integration/MetadataVerticalTest.java
@@@ -44,14 -43,15 +44,15 @@@ import org.apache.sis.temporal.Temporal
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonBBox;
-import static org.apache.sis.test.Assertions.assertSingletonReferenceSystem;
+ import static org.apache.sis.test.Assertions.assertSingletonScope;
import org.apache.sis.xml.test.TestCase;
- import static org.apache.sis.test.TestUtilities.getScope;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import java.nio.charset.StandardCharsets;
-import static org.opengis.test.Assertions.assertIdentifierEquals;
+// Specific to the main branch:
+import org.opengis.metadata.identification.CharacterSet;
+import org.opengis.referencing.datum.VerticalDatumType;
+import static org.apache.sis.test.GeoapiAssert.assertIdentifierEquals;
/**
@@@ -100,10 -100,13 +101,10 @@@ public final class MetadataVerticalTes
* </gmd:CI_ResponsibleParty>
* </gmd:contact>
*/
- final ResponsibleParty contact = getSingleton(metadata.getContacts());
- final Responsibility contact = assertSingleton(metadata .getContacts());
- final Party party = assertSingleton(contact .getParties());
- final Contact contactInfo = assertSingleton(party .getContactInfo());
- final OnlineResource onlineResource = assertSingleton(contactInfo.getOnlineResources());
- assertInstanceOf(Organisation.class, party);
++ final ResponsibleParty contact = assertSingleton(metadata.getContacts());
+ final OnlineResource onlineResource = contact.getContactInfo().getOnlineResource();
assertNotNull(onlineResource);
- assertEquals("Apache SIS", party.getName().toString());
+ assertEquals("Apache SIS", contact.getOrganisationName().toString());
assertEquals(URI.create("http://sis.apache.org"), onlineResource.getLinkage());
assertEquals(OnLineFunction.INFORMATION, onlineResource.getFunction());
assertEquals(Role.PRINCIPAL_INVESTIGATOR, contact.getRole());
@@@ -124,9 -128,7 +126,9 @@@
* </gmd:MD_ReferenceSystem>
* </gmd:referenceSystemInfo>
*/
- assertIdentifierEquals(null, "EPSG", null, "World Geodetic System 84", assertSingletonReferenceSystem(metadata), "referenceSystemInfo");
+ assertIdentifierEquals(null, "EPSG", null, "World Geodetic System 84",
- getSingleton(metadata.getReferenceSystemInfo()).getName(),
++ assertSingleton(metadata.getReferenceSystemInfo()).getName(),
+ "referenceSystemInfo");
/*
* <gmd:identificationInfo>
* <gmd:MD_DataIdentification>
@@@ -137,7 -141,7 +141,7 @@@
assertInstanceOf(NilObject.class, citation);
assertEquals(NilReason.MISSING, ((NilObject) citation).getNilReason());
assertEquals("SIS test", identification.getAbstract().toString());
- assertEquals(Locale.ENGLISH, getSingleton(identification.getLanguages()));
- assertEquals(Locale.ENGLISH, assertSingleton(identification.getLocalesAndCharsets().keySet()));
++ assertEquals(Locale.ENGLISH, assertSingleton(identification.getLanguages()));
/*
* <gmd:geographicElement>
* <gmd:EX_GeographicBoundingBox>
@@@ -164,11 -168,10 +168,11 @@@
assertEquals(10000, ve.getMaximumValue());
final VerticalCRS crs = ve.getVerticalCRS();
verifyIdentifiers("test1", crs);
- assertEquals("World", getScope(crs));
+ assertEquals("World", assertSingletonScope(crs));
final VerticalDatum datum = crs.getDatum();
verifyIdentifiers("test2", datum);
- assertEquals("World", getScope(datum));
+ assertEquals("World", assertSingletonScope(datum));
+ assertEquals(VerticalDatumType.DEPTH, datum.getVerticalDatumType()); // Inferred from the name.
final VerticalCS cs = crs.getCoordinateSystem();
verifyIdentifiers("test3", cs);
final CoordinateSystemAxis axis = cs.getAxis(0);
diff --cc endorsed/src/org.apache.sis.storage.geotiff/test/org/apache/sis/storage/geotiff/GeoTiffStoreTest.java
index 6f66a3d9b4,842426f4b8..771258cf89
--- a/endorsed/src/org.apache.sis.storage.geotiff/test/org/apache/sis/storage/geotiff/GeoTiffStoreTest.java
+++ b/endorsed/src/org.apache.sis.storage.geotiff/test/org/apache/sis/storage/geotiff/GeoTiffStoreTest.java
@@@ -37,13 -37,13 +37,13 @@@ import org.apache.sis.referencing.opera
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.feature.Assertions.assertGridToCornerEquals;
import org.apache.sis.test.TestCase;
- import org.apache.sis.test.TestUtilities;
import org.apache.sis.referencing.crs.HardCodedCRS;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
- import static org.apache.sis.test.GeoapiAssert.assertMatrixEquals;
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
/**
diff --cc endorsed/src/org.apache.sis.storage.netcdf/test/org/apache/sis/storage/netcdf/base/GridTest.java
index 8d3fc7ec96,0d0f6cbf72..2be0c4f427
--- a/endorsed/src/org.apache.sis.storage.netcdf/test/org/apache/sis/storage/netcdf/base/GridTest.java
+++ b/endorsed/src/org.apache.sis.storage.netcdf/test/org/apache/sis/storage/netcdf/base/GridTest.java
@@@ -24,8 -24,11 +24,8 @@@ import org.apache.sis.storage.DataStore
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.test.dataset.TestData;
-
/**
* Tests the {@link Grid} implementation. The default implementation tests
diff --cc endorsed/src/org.apache.sis.storage.sql/test/org/apache/sis/storage/sql/SQLStoreTest.java
index 83b1997b26,cedd0166ec..9f8ac210ef
--- a/endorsed/src/org.apache.sis.storage.sql/test/org/apache/sis/storage/sql/SQLStoreTest.java
+++ b/endorsed/src/org.apache.sis.storage.sql/test/org/apache/sis/storage/sql/SQLStoreTest.java
@@@ -38,16 -38,18 +38,16 @@@ import org.apache.sis.storage.sql.featu
// Test dependencies
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
import org.apache.sis.metadata.sql.TestDatabase;
import static org.apache.sis.test.Assertions.assertSetEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
-import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
-import org.opengis.feature.FeatureAssociationRole;
-import org.opengis.filter.FilterFactory;
-import org.opengis.filter.SortOrder;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractFeature;
+import org.apache.sis.feature.DefaultFeatureType;
+import org.apache.sis.feature.AbstractIdentifiedType;
+import org.apache.sis.feature.DefaultAttributeType;
+import org.apache.sis.feature.DefaultAssociationRole;
/**
@@@ -353,14 -355,16 +353,14 @@@ public final class SQLStoreTest extend
final FeatureSet parks = dataset.findResource("Parks");
final FeatureQuery query = new FeatureQuery();
query.setProjection(FF.property(desiredProperty));
- query.setSortBy(FF.sort(FF.property("country"), SortOrder.DESCENDING),
- FF.sort(FF.property(desiredProperty), SortOrder.ASCENDING));
final FeatureSet subset = parks.subset(query);
/*
- * Verify that all features have the expected property, then verify the sorted values.
+ * Verify that all features have the expected property.
*/
final Object[] values;
- try (Stream<Feature> features = subset.features(false)) {
+ try (Stream<AbstractFeature> features = subset.features(false)) {
values = features.map(f -> {
- final AbstractIdentifiedType p = TestUtilities.getSingleton(f.getType().getProperties(true));
- final PropertyType p = assertSingleton(f.getType().getProperties(true));
++ final AbstractIdentifiedType p = assertSingleton(f.getType().getProperties(true));
assertEquals(desiredProperty, p.getName().toString(), "Feature has wrong property.");
return f.getPropertyValue(desiredProperty);
}).toArray();
@@@ -539,9 -544,9 +539,9 @@@
/*
* Verify the feature type.
*/
- final AbstractIdentifiedType property = TestUtilities.getSingleton(frenchParks.getType().getProperties(true));
- final PropertyType property = assertSingleton(frenchParks.getType().getProperties(true));
++ final AbstractIdentifiedType property = assertSingleton(frenchParks.getType().getProperties(true));
assertEquals("native_name", property.getName().toString());
- assertEquals(String.class, ((AttributeType<?>) property).getValueClass());
+ assertEquals(String.class, ((DefaultAttributeType<?>) property).getValueClass());
/*
* Verify the values.
*/
@@@ -566,8 -571,8 +566,8 @@@
"OFFSET 2 ROWS FETCH NEXT 3 ROWS ONLY")))
{
final FeatureSet parks = store.findResource("MyQuery");
- final FeatureType type = parks.getType();
- final AttributeType<?> property = assertInstanceOf(AttributeType.class, assertSingleton(type.getProperties(true)));
+ final DefaultFeatureType type = parks.getType();
- final var property = (DefaultAttributeType<?>) TestUtilities.getSingleton(type.getProperties(true));
++ final DefaultAttributeType<?> property = assertInstanceOf(DefaultAttributeType.class, assertSingleton(type.getProperties(true)));
assertEquals("title", property.getName().toString(), "Property name should be label defined in query");
assertEquals(String.class, property.getValueClass(), "Attribute should be a string");
assertEquals(0, property.getMinimumOccurs(), "Column should be nullable.");
diff --cc endorsed/src/org.apache.sis.storage.sql/test/org/apache/sis/storage/sql/postgis/PostgresTest.java
index 1a67fce474,53a2eb680e..3fbfb76949
--- a/endorsed/src/org.apache.sis.storage.sql/test/org/apache/sis/storage/sql/postgis/PostgresTest.java
+++ b/endorsed/src/org.apache.sis.storage.sql/test/org/apache/sis/storage/sql/postgis/PostgresTest.java
@@@ -118,9 -116,8 +118,9 @@@ public final class PostgresTest extend
* @param metadata the metadata to verify.
*/
private static void validate(final Metadata metadata) {
- final Identification identification = TestUtilities.getSingleton(metadata.getIdentificationInfo());
+ final Identification identification = assertSingleton(metadata.getIdentificationInfo());
- assertTrue(identification.getSpatialRepresentationTypes().containsAll(
+ var defId = assertInstanceOf(AbstractIdentification.class, identification);
+ assertTrue(defId.getSpatialRepresentationTypes().containsAll(
Arrays.asList(SpatialRepresentationType.TEXT_TABLE,
SpatialRepresentationType.VECTOR,
SpatialRepresentationType.GRID)));
diff --cc endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/MetadataTest.java
index 217f8c426e,bc10977143..ccd17b355c
--- a/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/MetadataTest.java
+++ b/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/MetadataTest.java
@@@ -24,11 -26,7 +26,10 @@@ import java.net.URISyntaxException
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.test.TestUtilities.date;
+// Specific to the main branch:
+import org.junit.jupiter.api.Disabled;
+
/**
* Tests the {@link Metadata} class.
diff --cc endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/ReaderTest.java
index 5e668db119,86cd129697..7c507c76f0
--- a/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/ReaderTest.java
+++ b/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/ReaderTest.java
@@@ -34,13 -33,12 +33,12 @@@ import org.apache.sis.storage.gps.Fix
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingletonFeature;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.test.TestUtilities.date;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.content.FeatureTypeInfo;
-import org.opengis.feature.Feature;
+// Specific to the main branch:
+import org.opengis.util.GenericName;
+import org.apache.sis.feature.AbstractFeature;
/**
@@@ -192,12 -190,12 +190,12 @@@ public final class ReaderTest extends T
* Verifies the list of feature types declared in the given metadata. Those features
* are not listed in GPX files; they are rather hard-coded in Types.metadata constant.
*/
- final var content = assertInstanceOf(FeatureCatalogueDescription.class, getSingleton(md.getContentInfo()));
+ final var content = assertSingletonFeature(md);
assertTrue(content.isIncludedWithDataset());
- final Iterator<? extends FeatureTypeInfo> it = content.getFeatureTypeInfo().iterator();
- assertStringEquals("Route", it.next().getFeatureTypeName().tip());
- assertStringEquals("Track", it.next().getFeatureTypeName().tip());
- assertStringEquals("WayPoint", it.next().getFeatureTypeName().tip());
+ final Iterator<? extends GenericName> it = content.getFeatureTypes().iterator();
+ assertStringEquals("Route", it.next().tip());
+ assertStringEquals("Track", it.next().tip());
+ assertStringEquals("WayPoint", it.next().tip());
assertFalse(it.hasNext());
}
diff --cc endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/UpdaterTest.java
index 4d4a02a121,427187e7db..27f304abec
--- a/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/UpdaterTest.java
+++ b/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/UpdaterTest.java
@@@ -36,10 -36,10 +36,10 @@@ import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
+ import static org.apache.sis.xml.test.TestCase.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Feature;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractFeature;
/**
diff --cc endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/WriterTest.java
index 4e1e10445d,1b213ad6e3..efa995e41b
--- a/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/WriterTest.java
+++ b/endorsed/src/org.apache.sis.storage.xml/test/org/apache/sis/storage/gpx/WriterTest.java
@@@ -34,10 -34,10 +34,10 @@@ import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestUtilities;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertXmlEquals;
+ import static org.apache.sis.xml.test.TestCase.assertXmlEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Feature;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractFeature;
/**
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/FeatureQueryTest.java
index 2d6049a8d8,ac13d60d71..3342afce2a
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/FeatureQueryTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/FeatureQueryTest.java
@@@ -31,18 -31,24 +31,18 @@@ import org.apache.sis.util.iso.Names
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertSetEquals;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import static org.apache.sis.test.Assertions.assertMessageContains;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
-import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
-import org.opengis.feature.IdentifiedType;
-import org.opengis.feature.Operation;
-import org.opengis.filter.Expression;
-import org.opengis.filter.Filter;
-import org.opengis.filter.FilterFactory;
-import org.opengis.filter.MatchAction;
-import org.opengis.filter.SortOrder;
-import org.opengis.filter.SortProperty;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractFeature;
+import org.apache.sis.feature.DefaultFeatureType;
+import org.apache.sis.feature.DefaultAttributeType;
+import org.apache.sis.feature.AbstractIdentifiedType;
+import org.apache.sis.feature.AbstractOperation;
+import org.apache.sis.filter.Expression;
/**
@@@ -139,10 -145,10 +139,10 @@@ public final class FeatureQueryTest ext
/**
* Configures the query for returning a single instance and returns that instance.
*/
- private Feature executeAndGetFirst() throws DataStoreException {
+ private AbstractFeature executeAndGetFirst() throws DataStoreException {
query.setLimit(1);
final FeatureSet subset = query.execute(featureSet);
- return TestUtilities.getSingleton(subset.features(false).collect(Collectors.toList()));
+ return assertSingleton(subset.features(false).collect(Collectors.toList()));
}
/**
@@@ -276,8 -297,8 +276,8 @@@
createFeaturesWithAssociation();
query.setProjection("value2");
assertXPathsEqual("value2");
- final Feature instance = executeAndGetFirst();
- final PropertyType p = assertSingleton(instance.getType().getProperties(true));
+ final AbstractFeature instance = executeAndGetFirst();
- final AbstractIdentifiedType p = TestUtilities.getSingleton(instance.getType().getProperties(true));
++ final AbstractIdentifiedType p = assertSingleton(instance.getType().getProperties(true));
assertEquals("value2", p.getName().toString());
}
@@@ -303,7 -324,7 +303,7 @@@
assertEquals("Unnamed #2", properties.next().getName().toString());
assertFalse(properties.hasNext());
- final AbstractFeature instance = TestUtilities.getSingleton(subset.features(false).collect(Collectors.toList()));
- final Feature instance = assertSingleton(subset.features(false).collect(Collectors.toList()));
++ final AbstractFeature instance = assertSingleton(subset.features(false).collect(Collectors.toList()));
assertSame(type, instance.getType());
}
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/aggregate/ConcatenatedFeatureSetTest.java
index b0961dbc89,cd509bf382..77e5df6357
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/aggregate/ConcatenatedFeatureSetTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/aggregate/ConcatenatedFeatureSetTest.java
@@@ -30,14 -29,14 +29,15 @@@ import org.apache.sis.storage.base.Memo
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertContentInfoEquals;
- import static org.apache.sis.metadata.Assertions.assertFeatureSourceEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonFeature;
+ import static org.apache.sis.test.Assertions.assertContentInfoEquals;
+ import static org.apache.sis.test.Assertions.assertFeatureSourceEquals;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractFeature;
+import org.apache.sis.feature.DefaultFeatureType;
+import org.apache.sis.metadata.iso.DefaultMetadata;
/**
@@@ -74,9 -74,9 +75,9 @@@ public final class ConcatenatedFeatureS
final Metadata md = cfs.getMetadata();
assertNotNull(md);
- assertContentInfoEquals("City", 3, (FeatureCatalogueDescription) getSingleton(md.getContentInfo()));
- final Lineage lineage = getSingleton(((DefaultMetadata) md).getResourceLineages());
- assertFeatureSourceEquals("City", new String[] {"City"}, getSingleton(lineage.getSources()));
+ assertContentInfoEquals("City", 3, assertSingletonFeature(md));
- final Lineage lineage = assertSingleton(md.getResourceLineages());
++ final Lineage lineage = assertSingleton(assertInstanceOf(DefaultMetadata.class, md).getResourceLineages());
+ assertFeatureSourceEquals("City", new String[] {"City"}, assertSingleton(lineage.getSources()));
}
/**
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/base/MetadataBuilderTest.java
index dbbd6193b1,f80fc6a943..96ddd39664
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/base/MetadataBuilderTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/base/MetadataBuilderTest.java
@@@ -29,16 -29,16 +29,16 @@@ import org.apache.sis.feature.DefaultFe
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertTitleEquals;
+ import static org.apache.sis.test.Assertions.assertPartyNameEquals;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.metadata.Assertions.assertTitleEquals;
- import static org.apache.sis.metadata.Assertions.assertPartyNameEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.content.FeatureCatalogueDescription;
-import org.opengis.metadata.content.FeatureTypeInfo;
-import org.opengis.metadata.constraint.LegalConstraints;
-import org.opengis.feature.FeatureType;
+// Specific to the main branch:
+import org.apache.sis.metadata.iso.citation.DefaultCitationDate;
+import org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints;
+import org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription;
+import org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo;
/**
@@@ -89,14 -89,10 +89,15 @@@ public final class MetadataBuilderTest
private static void verifyCopyrightParsing(final String notice) {
final var builder = new MetadataBuilder();
builder.parseLegalNotice(null, notice);
- final var constraints = assertInstanceOf(DefaultLegalConstraints.class, getSingleton(getSingleton(
- builder.build().getIdentificationInfo()).getResourceConstraints()));
- final Citation ref = copyright(builder);
++ final var constraints = assertInstanceOf(
++ DefaultLegalConstraints.class,
++ assertSingleton(assertSingleton(builder.build().getIdentificationInfo()).getResourceConstraints()));
+
- assertEquals(Restriction.COPYRIGHT, getSingleton(constraints.getUseConstraints()));
- final Citation ref = getSingleton(constraints.getReferences());
++ assertEquals(Restriction.COPYRIGHT, assertSingleton(constraints.getUseConstraints()));
++ final Citation ref = assertSingleton(constraints.getReferences());
assertTitleEquals(notice, ref, "reference.title");
assertPartyNameEquals("John Smith", ref, "reference.citedResponsibleParty");
- assertEquals(Year.of(1992), ((DefaultCitationDate) getSingleton(ref.getDates())).getReferenceDate());
- assertEquals(Year.of(1992), assertSingleton(ref.getDates()).getReferenceDate());
++ assertEquals(Year.of(1992), assertInstanceOf(DefaultCitationDate.class, assertSingleton(ref.getDates())).getReferenceDate());
}
/**
@@@ -104,10 -100,10 +105,10 @@@
* This method verifies that the constraint is a copyright.
*/
private static Citation copyright(final MetadataBuilder builder) {
- final var id = getSingleton(builder.build().getIdentificationInfo());
- final var constraints = assertInstanceOf(DefaultLegalConstraints.class, getSingleton(id.getResourceConstraints()));
- assertEquals(Restriction.COPYRIGHT, getSingleton(constraints.getUseConstraints()));
- return getSingleton(constraints.getReferences());
+ final var id = assertSingleton(builder.build().getIdentificationInfo());
- final var constraints = assertInstanceOf(LegalConstraints.class, assertSingleton(id.getResourceConstraints()));
++ final var constraints = assertInstanceOf(DefaultLegalConstraints.class, assertSingleton(id.getResourceConstraints()));
+ assertEquals(Restriction.COPYRIGHT, assertSingleton(constraints.getUseConstraints()));
+ return assertSingleton(constraints.getReferences());
}
/**
@@@ -119,7 -115,7 +120,7 @@@
builder.parseLegalNotice(Locale.ENGLISH, "Copyright (C), John Smith, 1997. All rights reserved.");
builder.parseLegalNotice(Locale.FRENCH, "Copyright (C), John Smith, 1997. Tous droits réservés.");
final Citation ref = copyright(builder);
- assertEquals(Year.of(1997), ((DefaultCitationDate) getSingleton(ref.getDates())).getReferenceDate());
- assertEquals(Year.of(1997), assertSingleton(ref.getDates()).getReferenceDate());
++ assertEquals(Year.of(1997), assertInstanceOf(DefaultCitationDate.class, assertSingleton(ref.getDates())).getReferenceDate());
assertPartyNameEquals("John Smith", ref, "reference.citedResponsibleParty");
final var title = ref.getTitle();
assertEquals("Copyright (C), John Smith, 1997. All rights reserved.", title.toString(Locale.ENGLISH));
@@@ -157,9 -153,9 +158,9 @@@
if (valueToInsert == 0) {
assertTrue(metadata.getContentInfo().isEmpty());
} else {
- final ContentInformation content = getSingleton(metadata.getContentInfo());
+ final ContentInformation content = assertSingleton(metadata.getContentInfo());
- final var catalog = assertInstanceOf(FeatureCatalogueDescription.class, content);
- final FeatureTypeInfo info = assertSingleton(catalog.getFeatureTypeInfo());
+ final var catalog = assertInstanceOf(DefaultFeatureCatalogueDescription.class, content);
- final DefaultFeatureTypeInfo info = getSingleton(catalog.getFeatureTypeInfo());
++ final DefaultFeatureTypeInfo info = assertSingleton(catalog.getFeatureTypeInfo());
assertEquals(expected, info.getFeatureInstanceCount(), errorMessage);
}
}
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/csv/StoreTest.java
index b4f73f8040,b2493af31a..bee2bce9ae
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/csv/StoreTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/csv/StoreTest.java
@@@ -36,15 -36,14 +36,14 @@@ import org.apache.sis.setup.GeometryLib
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.test.TestUtilities.date;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonBBox;
+ import static org.apache.sis.test.Assertions.assertSingletonExtent;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
-import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
+// Specific to the main branch:
+import org.apache.sis.feature.AbstractFeature;
+import org.apache.sis.feature.AbstractIdentifiedType;
+import org.apache.sis.feature.DefaultAttributeType;
+import org.apache.sis.feature.DefaultFeatureType;
- import org.apache.sis.metadata.iso.identification.AbstractIdentification;
/**
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/esri/AsciiGridStoreTest.java
index 77eab420ba,c95bbb2b7e..493d04b93f
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/esri/AsciiGridStoreTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/esri/AsciiGridStoreTest.java
@@@ -33,12 -32,15 +32,14 @@@ import org.apache.sis.storage.ProbeResu
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestCase;
import static org.apache.sis.test.Assertions.assertMultilinesEquals;
- import static org.apache.sis.test.TestUtilities.getSingleton;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonBBox;
+ import static org.apache.sis.test.Assertions.assertSingletonReferenceSystem;
-import static org.apache.sis.test.Assertions.assertSingletonResourceFormat;
+ import org.apache.sis.test.TestCase;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.identification.Identification;
+// Specific to the main branch:
+import org.opengis.metadata.identification.DataIdentification;
/**
@@@ -94,7 -96,9 +95,9 @@@ public final class AsciiGridStoreTest e
* Format information is hard-coded in "SpatialMetadata" database. Complete string should
* be "ESRI ArcInfo ASCII Grid format" but it depends on the presence of Derby dependency.
*/
- final DataIdentification id = (DataIdentification) getSingleton(metadata.getIdentificationInfo());
- final Identification id = assertSingleton(metadata.getIdentificationInfo());
- final String format = assertSingletonResourceFormat(id);
- assertTrue(format.contains("ASCII Grid"), format);
++ final DataIdentification id = assertInstanceOf(
++ DataIdentification.class,
++ assertSingleton(metadata.getIdentificationInfo()));
/*
* This information should have been read from the PRJ file.
*/
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/image/WorldFileStoreTest.java
index eaf19f5eed,a89b710e45..617837a25c
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/image/WorldFileStoreTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/image/WorldFileStoreTest.java
@@@ -36,11 -36,14 +36,13 @@@ import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir;
import static org.junit.jupiter.api.Assertions.*;
import static org.apache.sis.test.Assertions.assertMessageContains;
+ import static org.apache.sis.test.Assertions.assertSingleton;
+ import static org.apache.sis.test.Assertions.assertSingletonBBox;
+ import static org.apache.sis.test.Assertions.assertSingletonReferenceSystem;
-import static org.apache.sis.test.Assertions.assertSingletonResourceFormat;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.identification.Identification;
+// Specific to the main branch:
+import org.opengis.metadata.identification.DataIdentification;
/**
@@@ -100,9 -103,11 +102,11 @@@ public final class WorldFileStoreTest e
*/
assertEquals("gradient", store.getIdentifier().get().toString());
final Metadata metadata = store.getMetadata();
- final DataIdentification id = (DataIdentification) getSingleton(metadata.getIdentificationInfo());
- assertEquals("WGS 84", getSingleton(metadata.getReferenceSystemInfo()).getName().getCode());
- final var bbox = (GeographicBoundingBox) getSingleton(getSingleton(id.getExtents()).getGeographicElements());
- final Identification id = assertSingleton(metadata.getIdentificationInfo());
- final String format = assertSingletonResourceFormat(id);
- assertTrue(format.contains("PNG"), format);
++ final DataIdentification id = assertInstanceOf(
++ DataIdentification.class,
++ assertSingleton(metadata.getIdentificationInfo()));
+ assertEquals("WGS 84", assertSingletonReferenceSystem(metadata).getCode());
+ final GeographicBoundingBox bbox = assertSingletonBBox(id);
assertEquals( -90, bbox.getSouthBoundLatitude());
assertEquals( +90, bbox.getNorthBoundLatitude());
assertEquals(-180, bbox.getWestBoundLongitude());
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/wkt/StoreTest.java
index a8d5b145bf,b20523bb65..768f3ec342
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/wkt/StoreTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/wkt/StoreTest.java
@@@ -28,11 -28,11 +28,11 @@@ import org.apache.sis.storage.DataStore
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
- import org.apache.sis.test.TestUtilities;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.apache.sis.test.TestCase;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import static org.opengis.test.Assertions.assertAxisDirectionsEqual;
+// Specific to the main branch:
+import static org.apache.sis.test.GeoapiAssert.assertAxisDirectionsEqual;
/**
diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/xml/StoreTest.java
index 6f621d2d17,ae783bcb21..faa8d7325b
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/xml/StoreTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/xml/StoreTest.java
@@@ -29,11 -29,11 +29,11 @@@ import org.apache.sis.xml.internal.shar
// Test dependencies
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
+ import static org.apache.sis.test.Assertions.assertSingleton;
import org.apache.sis.test.TestCase;
- import static org.apache.sis.test.TestUtilities.getSingleton;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import java.nio.charset.StandardCharsets;
+// Specific to the main branch:
+import org.opengis.metadata.identification.CharacterSet;
/**
@@@ -102,15 -102,17 +102,15 @@@ public final class StoreTest extends Te
metadata = store.getMetadata();
assertSame(metadata, store.getMetadata(), "Expected cached value.");
}
- final ResponsibleParty resp = getSingleton(metadata.getContacts());
- final Responsibility resp = assertSingleton(metadata.getContacts());
- final Party party = assertSingleton(resp.getParties());
- final Contact contact = assertSingleton(party.getContactInfo());
- final OnlineResource resource = assertSingleton(contact.getOnlineResources());
++ final ResponsibleParty resp = assertSingleton(metadata.getContacts());
+ final Contact contact = resp.getContactInfo();
+ final OnlineResource resource = contact.getOnlineResource();
- assertInstanceOf(Organisation.class, party, "party");
- assertEquals(Locale.ENGLISH, assertSingleton(metadata.getLocalesAndCharsets().keySet()));
- assertEquals(StandardCharsets.UTF_8, assertSingleton(metadata.getLocalesAndCharsets().values()));
+ assertEquals(Locale.ENGLISH, metadata.getLanguage());
+ assertEquals(CharacterSet.UTF_8, metadata.getCharacterSet());
assertEquals(Role.PRINCIPAL_INVESTIGATOR, resp.getRole());
- assertEquals("Apache SIS", String.valueOf(party.getName()));
- assertEquals("https://sis.apache.org", String.valueOf(resource.getLinkage()));
+ assertEquals("Apache SIS", String.valueOf(resp.getOrganisationName()));
+ assertEquals("http://sis.apache.org", String.valueOf(resource.getLinkage()));
assertEquals(OnLineFunction.INFORMATION, resource.getFunction());
}
}
diff --cc endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java
index 3235079d17,c564037de9..77c6388f7b
--- a/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java
+++ b/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java
@@@ -31,6 -32,18 +32,17 @@@ import java.io.ObjectInputStream
import java.io.ObjectOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+ import org.opengis.metadata.Metadata;
+ import org.opengis.metadata.Identifier;
+ import org.opengis.metadata.extent.Extent;
-import org.opengis.metadata.extent.GeographicExtent;
+ import org.opengis.metadata.extent.GeographicBoundingBox;
+ import org.opengis.metadata.identification.Identification;
+ import org.opengis.metadata.content.FeatureCatalogueDescription;
+ import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.maintenance.Scope;
+ import org.opengis.metadata.maintenance.ScopeCode;
++import org.opengis.metadata.lineage.Source;
+ import org.opengis.referencing.IdentifiedObject;
+ import org.opengis.util.InternationalString;
import org.apache.sis.util.Utilities;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.ComparisonMode;
@@@ -38,10 -51,16 +50,16 @@@ import org.apache.sis.util.Classes
// Test dependencies
import static org.junit.jupiter.api.Assertions.*;
-import org.opengis.referencing.ObjectDomain;
-// Specific to the geoapi-3.1 and geoapi-4.0 branches:
-import org.opengis.metadata.citation.Responsibility;
-import org.opengis.metadata.content.FeatureTypeInfo;
-import org.opengis.metadata.lineage.Source;
++// Specific to the main branch:
++import org.opengis.referencing.datum.Datum;
++import org.opengis.referencing.crs.CoordinateReferenceSystem;
++import org.opengis.referencing.operation.CoordinateOperation;
++import org.opengis.metadata.identification.DataIdentification;
+
/**
- * Assertion methods used by the SIS project in addition of the JUnit and GeoAPI assertions.
+ * Assertion methods used by the <abbr>SIS</abbr> project in addition of the JUnit and GeoAPI assertions.
*
* @author Martin Desruisseaux (Geomatys)
* @author Alexis Manin (Geomatys)
@@@ -53,6 -72,222 +71,238 @@@ public final class Assertions
private Assertions() {
}
+ /**
+ * Returns the single element from the given array. If the given array is null or
+ * does not contains exactly one element, then an {@link AssertionError} is thrown.
+ *
+ * @param <E> the type of array elements.
+ * @param array the array from which to get the singleton.
+ * @return the singleton element from the array.
+ */
+ public static <E> E assertSingleton(final E[] array) {
+ assertNotNull(array, "Null array.");
+ assertEquals(1, array.length, "Not a singleton array.");
+ return array[0];
+ }
+
+ /**
+ * Returns the single element from the given collection. If the given collection is null
+ * or does not contains exactly one element, then an {@link AssertionError} is thrown.
+ *
+ * @param <E> the type of collection elements.
+ * @param collection the collection from which to get the singleton.
+ * @return the singleton element from the collection.
+ */
+ public static <E> E assertSingleton(final Iterable<? extends E> collection) {
+ assertNotNull(collection, "Null collection.");
+ final Iterator<? extends E> it = collection.iterator();
+ assertTrue(it.hasNext(), "The collection is empty.");
+ final E element = it.next();
+ assertFalse(it.hasNext(), "The collection has more than one element.");
+ return element;
+ }
+
+ /**
+ * Asserts that the given metadata contains exactly one citation, and returns that citation.
+ *
+ * @param metadata the metadata from which to get the citation.
+ * @return the singleton citation of the given metadata.
+ */
+ public static Citation assertSingletonCitation(final Metadata metadata) {
+ Citation citation = assertSingleton(metadata.getIdentificationInfo()).getCitation();
+ assertNotNull(citation, "citation");
+ return citation;
+ }
+
+ /**
+ * Asserts that the given metadata contains exactly one feature catalog, and returns its description.
+ *
+ * @param metadata the metadata from which to get the catalog description.
+ * @return the singleton catalog description of the given metadata.
+ */
+ public static FeatureCatalogueDescription assertSingletonFeature(final Metadata metadata) {
+ return assertInstanceOf(FeatureCatalogueDescription.class, assertSingleton(metadata.getContentInfo()));
+ }
+
+ /**
+ * Asserts that the given metadata contains exactly one <abbr>CRS</abbr>,
+ * and returns the identifier of that <abbr>CRS</abbr>.
+ *
+ * @param metadata the metadata from which to get the <abbr>CRS</abbr>.
+ * @return the authority code of the singleton <abbr>CRS</abbr> of the given metadata.
+ */
+ public static Identifier assertSingletonReferenceSystem(final Metadata metadata) {
+ return assertSingleton(metadata.getReferenceSystemInfo()).getName();
+ }
+
+ /**
+ * Asserts that the given metadata contains exactly one extent, and returns that extent.
+ *
+ * @param metadata the metadata from which to get the extent.
+ * @return the singleton extent of the given metadata.
+ */
+ public static Extent assertSingletonExtent(final Metadata metadata) {
- return assertSingleton(assertSingleton(metadata.getIdentificationInfo()).getExtents());
++ return assertSingleton(assertInstanceOf(DataIdentification.class, assertSingleton(metadata.getIdentificationInfo())).getExtents());
+ }
+
+ /**
+ * Asserts that the given metadata contains exactly one bounding box, and returns that bounding box.
+ * Vertical and temporal components are ignored.
+ *
+ * @param metadata the metadata from which to get the geographic bounding box.
+ * @return the singleton geographic bounding box.
+ */
+ public static GeographicBoundingBox assertSingletonBBox(final Metadata metadata) {
+ return assertSingletonBBox(assertSingletonExtent(metadata));
+ }
+
+ /**
+ * Asserts that the given identification information contains exactly one bounding box,
+ * and returns that bounding box. Vertical and temporal components are ignored.
+ *
+ * @param identification the identification information from which to get the geographic bounding box.
+ * @return the singleton geographic bounding box.
+ */
+ public static GeographicBoundingBox assertSingletonBBox(final Identification identification) {
- return assertSingletonBBox(assertSingleton(identification.getExtents()));
++ return assertSingletonBBox(assertSingleton(assertInstanceOf(DataIdentification.class, identification).getExtents()));
+ }
+
+ /**
+ * Asserts that the given extent contains exactly one bounding box, and returns that bounding box.
+ * Vertical and temporal components are ignored.
+ *
+ * @param extent the extent from which to get the bounding box.
+ * @return the singleton geographic bounding box.
+ */
+ public static GeographicBoundingBox assertSingletonBBox(final Extent extent) {
+ return assertInstanceOf(GeographicBoundingBox.class, assertSingleton(extent.getGeographicElements()));
+ }
+
- /**
- * Asserts that the given identification information contains exactly one resource format,
- * and returns that format.
- *
- * @param identification the identification information from which to get the resource format.
- * @return the singleton resource format of the given metadata.
- */
- public static String assertSingletonResourceFormat(final Identification identification) {
- return assertSingleton(identification.getResourceFormats()).getFormatSpecificationCitation().getTitle().toString();
- }
-
+ /**
+ * Asserts that the given object contains exactly one identifier, then returns the code of that identifier.
+ *
+ * @param object the object for which to get the authority code.
+ * @return the single authority code of the given object.
+ */
+ public static String assertSingletonAuthorityCode(final IdentifiedObject object) {
+ return assertSingleton(object.getIdentifiers()).getCode();
+ }
+
+ /**
+ * Asserts that the given object contains exactly one scope, then returns that scope in English.
+ *
+ * @param object the object for which to get the scope.
+ * @return the single scope of the given object.
+ */
+ public static String assertSingletonScope(final IdentifiedObject object) {
- InternationalString scope = assertSingleton(object.getDomains()).getScope();
++ InternationalString scope;
++ if (object instanceof CoordinateOperation op) {
++ scope = op.getScope();
++ } else if (object instanceof Datum datum) {
++ scope = datum.getScope();
++ } else {
++ scope = assertInstanceOf(CoordinateReferenceSystem.class, object).getScope();
++ }
+ assertNotNull(scope, "Missing scope.");
+ return scope.toString(Locale.US);
+ }
+
+ /**
+ * Asserts that the given object as exactly one domain of validity, and returns that domain as a bounding box.
+ *
+ * @param object the object for which to get the domain of validity.
+ * @return the single domain of validity of the given object.
+ */
+ public static GeographicBoundingBox assertSingletonDomainOfValidity(final IdentifiedObject object) {
- ObjectDomain domain = assertSingleton(object.getDomains());
- GeographicExtent extent = assertSingleton(domain.getDomainOfValidity().getGeographicElements());
- return assertInstanceOf(GeographicBoundingBox.class, extent);
++ final Extent extent;
++ if (object instanceof CoordinateOperation op) {
++ extent = op.getDomainOfValidity();
++ } else if (object instanceof Datum datum) {
++ extent = datum.getDomainOfValidity();
++ } else {
++ extent = assertInstanceOf(CoordinateReferenceSystem.class, object).getDomainOfValidity();
++ }
++ assertNotNull(extent, "Missing extent.");
++ return assertInstanceOf(GeographicBoundingBox.class, assertSingleton(extent.getGeographicElements()));
+ }
+
+ /**
+ * Asserts that the English title of the given citation is equal to the expected string.
+ *
+ * @param expected the expected English title.
+ * @param citation the citation to test.
+ * @param message the message to report in case of test failure.
+ */
+ public static void assertTitleEquals(final String expected, final Citation citation, final String message) {
+ assertNotNull(citation, message);
+ InternationalString title = citation.getTitle();
+ assertNotNull(title, message);
+ assertEquals(expected, title.toString(Locale.US), message);
+ }
+
+ /**
+ * Asserts that the given citation has only one responsible party,
+ * and its English name is equal to the expected string.
+ *
+ * @param expected the expected English responsibly party name.
+ * @param citation the citation to test.
+ * @param message the message to report in case of test failure.
+ */
+ public static void assertPartyNameEquals(final String expected, final Citation citation, final String message) {
+ assertNotNull(citation, message);
- Responsibility r = assertSingleton(citation.getCitedResponsibleParties());
++ assertSingleton(citation.getCitedResponsibleParties());
++ // TODO: uncomment after merge of `util` with `metadata`:
++ /*
++ DefaultResponsibility r = assertInstanceOf(DefaultResponsibility.class, assertSingleton(citation.getCitedResponsibleParties()));
+ InternationalString name = assertSingleton(r.getParties()).getName();
+ assertNotNull(name, message);
+ assertEquals(expected, name.toString(Locale.US), message);
++ */
+ }
+
+ /**
+ * Verifies that the given {@code ContentInfo} describes the given feature.
+ * This method expects that the given catalog contains exactly one feature info.
+ *
+ * @param name expected feature type name (possibly null).
+ * @param count expected feature instance count (possibly null).
+ * @param catalog the content info to validate.
+ */
+ public static void assertContentInfoEquals(final String name, final Integer count, final FeatureCatalogueDescription catalog) {
- final FeatureTypeInfo info = assertSingleton(catalog.getFeatureTypeInfo());
++ assertEquals(name, assertSingleton(catalog.getFeatureTypes()).tip().toString());
++ // TODO: uncomment after merge of `util` with `metadata`:
++ /*
++ final DefaultFeatureTypeInfo info = assertInstanceOf(
++ DefaultFeatureTypeInfo.class,
++ assertSingleton(assertInstanceOf(DefaultFeatureCatalogueDescription.class, catalog).getFeatureTypeInfo()));
+ assertEquals(name, String.valueOf(info.getFeatureTypeName()), "metadata.contentInfo.featureType");
+ assertEquals(count, info.getFeatureInstanceCount(), "metadata.contentInfo.featureInstanceCount");
++ */
+ }
+
+ /**
+ * Verifies that the source contains the given feature type. This method expects that the given source contains
+ * exactly one scope description and that the hierarchical level is {@link ScopeCode#FEATURE_TYPE}.
+ *
+ * @param name expected source identifier.
+ * @param features expected names of feature type.
+ * @param source the source to validate.
+ */
+ public static void assertFeatureSourceEquals(final String name, final String[] features, final Source source) {
+ assertEquals(name, String.valueOf(source.getSourceCitation().getTitle()), "metadata.lineage.source.sourceCitation.title");
- final Scope scope = source.getScope();
++ // TODO: uncomment after merge of `util` with `metadata`:
++ /*
++ final DefaultScope scope = assertInstanceOf(DefaultScope.class, assertInstanceOf(DefaultSource.class, source).getScope());
+ assertNotNull(scope, "metadata.lineage.source.scope");
+ assertEquals(ScopeCode.FEATURE_TYPE, scope.getLevel(), "metadata.lineage.source.scope.level");
+ final var actual = assertSingleton(scope.getLevelDescription()).getFeatures().toArray(CharSequence[]::new);
+ for (int i=0; i<actual.length; i++) {
+ actual[i] = actual[i].toString();
+ }
+ assertArrayEquals(features, actual, "metadata.lineage.source.scope.levelDescription.feature");
++ */
+ }
+
/**
* Asserts that the two given objects are not equal.
* This method tests all {@link ComparisonMode} except {@code DEBUG}.
diff --cc endorsed/src/org.apache.sis.util/test/org/apache/sis/test/GeoapiAssert.java
index f4658453ce,0000000000..a28f4fb60c
mode 100644,000000..100644
--- a/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/GeoapiAssert.java
+++ b/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/GeoapiAssert.java
@@@ -1,247 -1,0 +1,260 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.test;
+
+import java.util.Collection;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.operation.Matrix;
+import org.opengis.util.InternationalString;
+
+// Test dependencies
+import static org.junit.jupiter.api.Assertions.*;
+import org.opengis.test.Assert;
+
+
+/**
+ * Temporary class for test methods that are expected to be provided in next GeoAPI release.
+ * Those methods are defined in a separated class in order to make easier for us to identify
+ * which methods may be removed from SIS (actually moved to GeoAPI) in a future GeoAPI release.
+ *
+ * <p>This class is needed for Apache SIS main branch, since the later is linked to GeoAPI official release.
+ * But this class can be removed on Apache SIS branches which are linked to a GeoAPI development branch.</p>
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ */
+public final class GeoapiAssert {
+ /**
+ * A flag for code that are pending next GeoAPI release before to be enabled.
+ * This flag is always set to {@code false}, except occasionally just before
+ * a GeoAPI release for testing purpose. It shall be used as below:
+ *
+ * {@snippet lang="java" :
+ * if (PENDING_NEXT_GEOAPI_RELEASE) {
+ * // Do some stuff here.
+ * }
+ * }
+ *
+ * The intend is to make easier to identify test cases that fail with the current version
+ * of the {@code geoapi-conformance} module, but should pass with the development snapshot.
+ */
+ public static final boolean PENDING_NEXT_GEOAPI_RELEASE = false;
+
+ /**
+ * The keyword for unrestricted value in {@link String} arguments.
+ */
+ private static final String UNRESTRICTED = "##unrestricted";
+
+ /**
+ * Do not allow instantiation of this class.
+ */
+ private GeoapiAssert() {
+ }
+
+ private static String nonNull(final String message) {
+ return (message != null) ? message.trim().concat(" ") : "";
+ }
+
+ /**
+ * Returns the concatenation of the given message with the given extension.
+ * This method returns the given extension if the message is null or empty.
+ *
+ * <p>Invoking this method is equivalent to invoking {@code nonNull(message) + ext},
+ * but avoid the creation of temporary objects in the common case where the message
+ * is null.</p>
+ *
+ * @param message the message, or {@code null}.
+ * @param ext the extension to append after the message.
+ * @return the concatenated string.
+ */
+ private static String concat(String message, final String ext) {
+ if (message == null || (message = message.trim()).isEmpty()) {
+ return ext;
+ }
+ return message + ' ' + ext;
+ }
+
+ /**
+ * Verifies if we expected a null value, then returns {@code true} if the value is null as expected.
+ */
+ private static boolean isNull(final Object expected, final Object actual, final String message) {
+ final boolean isNull = (actual == null);
+ if (isNull != (expected == null)) {
+ fail(concat(message, isNull ? "Value is null." : "Expected null."));
+ }
+ return isNull;
+ }
+
+ public static void assertPositive(final int value, final String message) {
+ Assert.assertPositive(message, value);
+ }
+
+ public static void assertStrictlyPositive(final int value, final String message) {
+ Assert.assertStrictlyPositive(message, value);
+ }
+
+ public static <T> void assertValidRange(final Comparable<T> minimum, final Comparable<T> maximum, final String message) {
+ Assert.assertValidRange(message, minimum, maximum);
+ }
+
+ public static void assertValidRange(final int minimum, final int maximum, final String message) {
+ Assert.assertValidRange(message, minimum, maximum);
+ }
+
+ public static void assertValidRange(final double minimum, final double maximum, final String message) {
+ Assert.assertValidRange(message, minimum, maximum);
+ }
+
+ public static <T> void assertBetween(final Comparable<T> minimum, final Comparable<T> maximum, T value, final String message) {
+ Assert.assertBetween(message, minimum, maximum, value);
+ }
+
+ public static void assertBetween(final int minimum, final int maximum, final int value, final String message) {
+ Assert.assertBetween(message, minimum, maximum, value);
+ }
+
+ public static void assertBetween(final double minimum, final double maximum, final double value, final String message) {
+ Assert.assertBetween(message, minimum, maximum, value);
+ }
+
+ public static void assertContains(final Collection<?> collection, final Object value, final String message) {
+ Assert.assertContains(message, collection, value);
+ }
+
+ /**
+ * Asserts that the title or an alternate title of the given citation is equal to the given string.
+ * This method is typically used for testing if a citation stands for the OGC, OGP or EPSG authority
+ * for instance. Such abbreviations are often declared as {@linkplain Citation#getAlternateTitles()
+ * alternate titles} rather than the main {@linkplain Citation#getTitle() title}, but this method
+ * tests both for safety.
+ *
+ * @param expected the expected title or alternate title.
+ * @param actual the citation to test.
+ * @param message header of the exception message in case of failure, or {@code null} if none.
+ */
+ public static void assertAnyTitleEquals(final String expected, final Citation actual, final String message) {
+ if (isNull(expected, actual, message)) {
+ return;
+ }
+ InternationalString title = actual.getTitle();
+ if (title != null && expected.equals(title.toString())) {
+ return;
+ }
+ for (final InternationalString t : actual.getAlternateTitles()) {
+ if (expected.equals(t.toString())) {
+ return;
+ }
+ }
+ fail(concat(message, '"' + expected + "\" not found in title or alternate titles."));
+ }
+
+ /**
+ * Asserts that the given identifier is equal to the given authority, code space, version and code.
+ * If any of the above-cited properties is {@code ""##unrestricted"}, then it will not be verified.
+ * This flexibility is useful in the common case where a test accepts any {@code version} value.
+ *
+ * @param authority the expected authority title or alternate title (may be {@code null}), or {@code "##unrestricted"}.
+ * @param codeSpace the expected code space (may be {@code null}), or {@code "##unrestricted"}.
+ * @param version the expected version (may be {@code null}), or {@code "##unrestricted"}.
+ * @param code the expected code value (may be {@code null}), or {@code "##unrestricted"}.
+ * @param actual the identifier to test.
+ * @param message header of the exception message in case of failure, or {@code null} if none.
+ */
+ public static void assertIdentifierEquals(final String authority, final String codeSpace, final String version,
+ final String code, final ReferenceIdentifier actual, final String message)
+ {
+ if (actual == null) {
+ fail(concat(message, "Identifier is null"));
+ } else {
+ if (!UNRESTRICTED.equals(authority)) assertAnyTitleEquals(authority, actual.getAuthority(), message);
+ if (!UNRESTRICTED.equals(codeSpace)) assertEquals(codeSpace, actual.getCodeSpace(), () -> concat(message, "Wrong code space"));
+ if (!UNRESTRICTED.equals(version)) assertEquals(version, actual.getVersion(), () -> concat(message, "Wrong version"));
+ if (!UNRESTRICTED.equals(code)) assertEquals(code, actual.getCode(), () -> concat(message, "Wrong code"));
+ }
+ }
+
+ /**
+ * Asserts that all axes in the given coordinate system are pointing toward the given directions, in the same order.
+ *
+ * @param cs the coordinate system to test.
+ * @param expected the expected axis directions.
+ */
+ public static void assertAxisDirectionsEqual(final CoordinateSystem cs, final AxisDirection... expected) {
+ assertAxisDirectionsEqual(cs, expected, null);
+ }
+
+ /**
+ * Asserts that all axes in the given coordinate system are pointing toward the given directions,
+ * in the same order.
+ *
+ * @param cs the coordinate system to test.
+ * @param expected the expected axis directions.
+ * @param message header of the exception message in case of failure, or {@code null} if none.
+ */
+ public static void assertAxisDirectionsEqual(final CoordinateSystem cs, final AxisDirection[] expected, final String message) {
+ assertEquals(expected.length, cs.getDimension(), () -> concat(message, "Wrong coordinate system dimension."));
+ for (int i=0; i<expected.length; i++) {
+ final int ci = i; // Because lambda expressions require final values.
+ assertEquals(expected[i], cs.getAxis(i).getDirection(),
+ () -> concat(message, "Wrong axis direction at index" + ci + '.'));
+ }
+ }
+
++ /**
++ * Asserts that the given matrix is equal to the expected one, with a tolerance of zero.
++ * Positive zeros are considered equal to negative zeros, and any NaN value is considered equal
++ * to all other NaN values.
++ *
++ * @param expected the expected matrix, which may be {@code null}.
++ * @param actual the matrix to compare, or {@code null}.
++ * @param label header of the exception message in case of failure, or {@code null} if none.
++ */
++ public static void assertMatrixEquals(final Matrix expected, final Matrix actual, final String label) {
++ assertMatrixEquals(expected, actual, 0, label);
++ }
++
+ /**
+ * Asserts that the given matrix is equal to the expected one, up to the given tolerance value.
+ *
+ * @param expected the expected matrix, which may be {@code null}.
+ * @param actual the matrix to compare, or {@code null}.
+ * @param tolerance the tolerance threshold.
+ * @param message header of the exception message in case of failure, or {@code null} if none.
+ *
+ * @see org.opengis.test.referencing.TransformTestCase#assertMatrixEquals(String, Matrix, Matrix, Matrix)
+ */
+ public static void assertMatrixEquals(final Matrix expected, final Matrix actual, final double tolerance, final String message) {
+ if (isNull(expected, actual, message)) {
+ return;
+ }
+ final int numRow = actual.getNumRow();
+ final int numCol = actual.getNumCol();
+ assertEquals(expected.getNumRow(), numRow, "numRow");
+ assertEquals(expected.getNumCol(), numCol, "numCol");
+ for (int j=0; j<numRow; j++) {
+ for (int i=0; i<numCol; i++) {
+ final double e = expected.getElement(j,i);
+ final double a = actual.getElement(j,i);
+ if (!(StrictMath.abs(e - a) <= tolerance) && Double.doubleToLongBits(a) != Double.doubleToLongBits(e)) {
+ fail(nonNull(message) + "Matrix.getElement(" + j + ", " + i + "): expected " + e + " but got " + a);
+ }
+ }
+ }
+ }
+}