This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-3.1 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 5d62feec97ec12129eb5cfe2f30a1949a0acbbb4 Merge: 90b66dd6ad 19e8496c91 Author: Martin Desruisseaux <[email protected]> AuthorDate: Sat Oct 11 14:19:12 2025 +0200 Merge branch 'geoapi-4.0' into geoapi-3.1. This is a consolidation of test code with no significant change in main code. 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 | 9 +- .../sis/coverage/grid/GridCoverage2DTest.java | 3 +- .../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 | 10 +- .../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 +- .../org/apache/sis/filter/CapabilitiesTest.java | 5 +- .../sis/geometry/wrapper/j2d/FlatShapeTest.java | 15 +- .../org/apache/sis/image/ImageProcessorTest.java | 9 +- .../test/org/apache/sis/image/MaskedImageTest.java | 12 +- .../org/apache/sis/image/ResamplingGridTest.java | 1 + .../apache/sis/metadata/AbstractMetadataTest.java | 4 +- .../test/org/apache/sis/metadata/Assertions.java | 218 ---------------- .../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 | 12 +- .../sis/metadata/iso/citation/CitationsTest.java | 28 +-- .../metadata/iso/citation/DefaultCitationTest.java | 27 +- .../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 | 5 +- .../sis/metadata/sql/MetadataWriterTest.java | 17 +- .../sis/metadata/xml/SchemaComplianceTest.java | 10 +- .../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 | 11 +- .../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 | 9 +- .../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 | 6 +- .../apache/sis/xml/test/DocumentComparator.java | 7 +- .../org/apache/sis/xml/test/PackageVerifier.java | 24 +- .../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 +- .../test/org/apache/sis/io/wkt/CRSParserTest.java | 26 +- .../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 | 173 ++++++------- .../operation/CoordinateOperationRegistryTest.java | 5 +- .../DefaultConcatenatedOperationTest.java | 21 +- .../operation/DefaultConversionTest.java | 52 ++-- .../DefaultCoordinateOperationFactoryTest.java | 16 +- .../operation/DefaultOperationMethodTest.java | 2 +- .../operation/DefaultPassThroughOperationTest.java | 27 +- .../operation/SingleOperationMarshallingTest.java | 49 ++-- .../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 +-- .../projection/ObliqueStereographicTest.java | 4 +- .../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 | 34 ++- .../transform/ContextualParametersTest.java | 25 +- .../transform/DefaultMathTransformFactoryTest.java | 7 +- .../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 | 7 +- .../operation/transform/ScaleTransformTest.java | 10 +- .../operation/transform/TransferFunctionTest.java | 13 +- .../transform/TransformSeparatorTest.java | 90 +++---- .../transform/TranslationTransformTest.java | 10 +- .../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 | 50 ++-- .../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 | 22 +- .../test/org/apache/sis/storage/csv/StoreTest.java | 10 +- .../sis/storage/esri/AsciiGridStoreTest.java | 20 +- .../org/apache/sis/storage/folder/StoreTest.java | 2 - .../sis/storage/image/WorldFileStoreTest.java | 15 +- .../test/org/apache/sis/storage/wkt/StoreTest.java | 10 +- .../test/org/apache/sis/storage/xml/StoreTest.java | 14 +- .../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 | 237 +++++++++++++++++- .../test/org/apache/sis/test/Assumptions.java | 62 ----- .../test/org/apache/sis/test/Benchmark.java | 2 - .../apache/sis/test/FailureDetailsReporter.java | 4 +- .../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 | 276 +-------------------- .../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 +- geoapi/snapshot | 2 +- .../sis/storage/geopackage/GpkgStoreTest.java | 1 + .../apache/sis/gui/internal/GUIUtilitiesTest.java | 16 +- .../resources/embedded/EmbeddedResourcesTest.java | 7 +- .../sis/referencing/factory/sql/epsg/README.md | 2 +- .../factory/sql/epsg/ScriptProviderTest.java | 2 +- 266 files changed, 2375 insertions(+), 2552 deletions(-) diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java index 5ce9295394,79706b62a6..7834bebffd --- 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 @@@ -60,14 -60,9 +60,14 @@@ import static org.junit.jupiter.api.Ass import org.apache.sis.test.TestCase; import org.apache.sis.test.mock.GeographicCRSMock; import org.apache.sis.metadata.iso.citation.HardCodedCitations; - 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 main and geoapi-3.1 branches: +import java.util.Date; +import org.opengis.metadata.citation.ResponsibleParty; +import org.opengis.referencing.ReferenceIdentifier; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import org.opengis.metadata.content.AttributeGroup; import org.opengis.referencing.ReferenceSystemType; diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyInformationTest.java index 0c2e7242fd,f15e38773b..685221b81b --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyInformationTest.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyInformationTest.java @@@ -35,11 -35,11 +35,11 @@@ import static org.junit.jupiter.api.Ass import org.apache.sis.test.TestCase; import org.apache.sis.metadata.iso.citation.HardCodedCitations; 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.assertTitleEquals; + import static org.apache.sis.test.Assertions.assertSingleton; -// Specific to the geoapi-4.0 branch: -import org.opengis.annotation.Obligation; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.Obligation; /** diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeNodeTest.java index 5e97e57d6b,e5325ecaad..08dbea4a9d --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeNodeTest.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeNodeTest.java @@@ -39,12 -39,8 +39,12 @@@ 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.assertMessageContains; - import static org.apache.sis.metadata.Assertions.assertTitleEquals; + import static org.apache.sis.test.Assertions.assertTitleEquals; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.citation.ResponsibleParty; +import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import org.opengis.metadata.citation.Party; diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/TreeTableViewTest.java index 8b3e026c46,0fb5d71398..ef18e25728 --- 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/ValueMapTest.java index b000745c91,d8277513d7..3e847e09fd --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/ValueMapTest.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/ValueMapTest.java @@@ -33,10 -33,10 +33,10 @@@ import org.apache.sis.metadata.iso.cita 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.getSingleton; + import static org.apache.sis.test.Assertions.assertSingleton; -// Specific to the geoapi-4.0 branch: -import org.apache.sis.metadata.iso.citation.DefaultResponsibility; +// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty; /** diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/content/DefaultBandTest.java index e6cbe2a20f,acfd833178..a5eca91a6a --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/content/DefaultBandTest.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/content/DefaultBandTest.java @@@ -24,10 -24,9 +24,9 @@@ 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-4.0 branch: -import org.opengis.metadata.content.PolarisationOrientation; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.content.PolarizationOrientation; /** diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/sql/MetadataWriterTest.java index 562a10edac,c753ccb625..704ad84971 --- 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 @@@ -122,7 -123,7 +123,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("{rp}EPSG", source.search(TestUtilities.getSingleton( - assertEquals("EPSG", source.search(assertSingleton( ++ assertEquals("{rp}EPSG", source.search(assertSingleton( HardCodedCitations.EPSG.getCitedResponsibleParties()))); } diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/cat/EnumMarshallingTest.java index 965ee8fa16,bfaf7a9932..cbc925dfbe --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/cat/EnumMarshallingTest.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/xml/bind/cat/EnumMarshallingTest.java @@@ -28,8 -28,10 +28,7 @@@ 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.Assertions.assertSetEquals; - import static org.apache.sis.metadata.Assertions.assertXmlEquals; -// Specific to the geoapi-4.0 branch: -import java.util.EnumSet; - /** * Tests the XML marshalling of {@code Enum}. diff --cc endorsed/src/org.apache.sis.profile.france/test/org/apache/sis/profile/france/FrenchProfileTest.java index fd3fa0c68f,735feef1de..dd55e565af --- a/endorsed/src/org.apache.sis.profile.france/test/org/apache/sis/profile/france/FrenchProfileTest.java +++ b/endorsed/src/org.apache.sis.profile.france/test/org/apache/sis/profile/france/FrenchProfileTest.java @@@ -31,10 -31,10 +31,10 @@@ import org.apache.sis.xml.bind.fra.Dire 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.getSingleton; + import static org.apache.sis.test.Assertions.assertSingleton; -// Specific to the geoapi-4.0 branch: -import org.apache.sis.metadata.iso.DefaultIdentifier; +// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.xml.bind.metadata.replace.RS_Identifier; /** diff --cc endorsed/src/org.apache.sis.profile.france/test/org/apache/sis/xml/bind/fra/DirectReferenceSystemTest.java index ad06b36cc1,a22a443de6..402137112f --- a/endorsed/src/org.apache.sis.profile.france/test/org/apache/sis/xml/bind/fra/DirectReferenceSystemTest.java +++ b/endorsed/src/org.apache.sis.profile.france/test/org/apache/sis/xml/bind/fra/DirectReferenceSystemTest.java @@@ -28,13 -28,13 +28,13 @@@ import org.apache.sis.util.ComparisonMo // 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.xml.test.TestCase; - import org.apache.sis.test.TestUtilities; import org.apache.sis.metadata.iso.citation.HardCodedCitations; -// Specific to the geoapi-4.0 branch: -import org.opengis.metadata.citation.Responsibility; -import org.apache.sis.metadata.iso.DefaultIdentifier; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.citation.ResponsibleParty; +import org.apache.sis.xml.bind.metadata.replace.RS_Identifier; /** @@@ -69,12 -69,12 +69,12 @@@ public final class DirectReferenceSyste private static DefaultMetadata createMetadata(final boolean legacy) { final DefaultMetadata metadata = new DefaultMetadata(); final DefaultCitation citation = new DefaultCitation("EPSG Geodetic Parameter Dataset"); - Collection<Responsibility> r = HardCodedCitations.EPSG.getCitedResponsibleParties(); + Collection<ResponsibleParty> r = HardCodedCitations.EPSG.getCitedResponsibleParties(); if (legacy) { - r = Set.of(new DefaultResponsibleParty(TestUtilities.getSingleton(r))); + r = Set.of(new DefaultResponsibleParty(assertSingleton(r))); } citation.setCitedResponsibleParties(r); - final DirectReferenceSystem refSys = new DirectReferenceSystem(new DefaultIdentifier(citation, "4326")); + final DirectReferenceSystem refSys = new DirectReferenceSystem(new RS_Identifier(citation, "4326")); metadata.setReferenceSystemInfo(Set.of(refSys)); return metadata; } diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/io/wkt/GeodeticObjectParserTest.java index d825bec631,58fc045756..e2b4e30c67 --- 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 @@@ -58,11 -58,10 +58,13 @@@ import static org.apache.sis.test.Asser import static org.apache.sis.test.Assertions.assertMultilinesEquals; import static org.apache.sis.referencing.Assertions.assertAxisEquals; import static org.apache.sis.referencing.Assertions.assertDiagonalEquals; - import static org.apache.sis.test.TestUtilities.getSingleton; + import static org.apache.sis.test.Assertions.assertSingleton; + import static org.apache.sis.test.Assertions.assertSingletonAuthorityCode; + import static org.apache.sis.test.Assertions.assertSingletonScope; +// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.temporal.TemporalDate; + /** * Tests {@link GeodeticObjectParser}. @@@ -1008,8 -1006,8 +1009,8 @@@ public final class GeodeticObjectParser assertNameAndIdentifierEqual("Rikets hojdsystem 2000", 0, crs.getDatum()); Temporal epoch = assertInstanceOf(DynamicReferenceFrame.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().orElseThrow().toString()); + assertEquals("Replaces RH70 (CRS code 5718) from 2005.", crs.getRemarks().toString()); } /** diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/parameter/ParametersTest.java index 4f7a9129bc,a5401ce15d..a05c92cc2e --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/parameter/ParametersTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/parameter/ParametersTest.java @@@ -34,12 -34,9 +34,12 @@@ import org.apache.sis.measure.Units 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.test.TestCase; - import org.apache.sis.test.TestUtilities; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.referencing.ReferenceIdentifier; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import java.util.Optional; import org.opengis.parameter.ParameterDirection; diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java index 6f9bb259a2,bc96b1e65b..76739871b6 --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java @@@ -34,11 -34,11 +34,11 @@@ import org.opengis.test.Validators 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; import static org.apache.sis.referencing.Assertions.assertRemarksEquals; -// Specific to the geoapi-4.0 branch: -import org.opengis.metadata.Identifier; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.referencing.ReferenceIdentifier; /** diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/CommonCRSTest.java index c248b470a3,f8f7bccfb3..220c09f21a --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/CommonCRSTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/CommonCRSTest.java @@@ -47,11 -48,8 +48,11 @@@ import org.apache.sis.test.TestCase import static org.junit.jupiter.api.Assertions.*; import static org.apache.sis.test.Assertions.assertEqualsIgnoreMetadata; import static org.apache.sis.test.Assertions.assertMessageContains; - import static org.apache.sis.test.TestUtilities.*; + import static org.apache.sis.test.Assertions.assertSingleton; +// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.temporal.TemporalDate; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import org.opengis.referencing.datum.RealizationMethod; import org.opengis.test.Validators; diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java index dc6845ddef,d5a87c2e60..76ac08e456 --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java @@@ -29,14 -29,11 +29,14 @@@ import org.junit.jupiter.api.Test import static org.junit.jupiter.api.Assertions.*; import org.apache.sis.xml.test.TestCase; import org.apache.sis.metadata.iso.citation.HardCodedCitations; + import static org.apache.sis.test.Assertions.assertSingleton; + import static org.apache.sis.test.Assertions.assertSingletonScope; import static org.apache.sis.referencing.Assertions.assertWktEquals; import static org.apache.sis.referencing.Assertions.assertRemarksEquals; - import static org.apache.sis.test.TestUtilities.getSingleton; - import static org.apache.sis.test.TestUtilities.getScope; +// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.temporal.TemporalDate; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import static org.opengis.referencing.ObjectDomain.*; import static org.opengis.referencing.IdentifiedObject.*; @@@ -130,10 -128,10 +131,10 @@@ public final class DefaultTemporalDatum public void testUnmarshalling() throws JAXBException { final DefaultTemporalDatum datum = unmarshalFile(DefaultTemporalDatum.class, openTestFile()); assertIdentifierEquals("Apache Spatial Information System", "SIS", null, "MJ", - getSingleton(datum.getIdentifiers()), "identifier"); + assertSingleton(datum.getIdentifiers()), "identifier"); assertEquals("Modified Julian", datum.getName().getCode()); assertRemarksEquals("Time measured as days since November 17, 1858 at 00:00 UTC.", datum, null); - assertEquals("History.", getScope(datum)); + assertEquals("History.", assertSingletonScope(datum)); - assertEquals(ORIGIN, datum.getOrigin()); + assertEquals(ORIGIN, TemporalDate.toTemporal(datum.getOrigin())); } } diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/legacy/DefaultImageCRSTest.java index d426f736bf,6f68d1667e..2d32da3090 --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/legacy/DefaultImageCRSTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/legacy/DefaultImageCRSTest.java @@@ -32,14 -32,8 +32,13 @@@ import static org.junit.jupiter.api.Ass import org.apache.sis.xml.test.TestCase; import org.apache.sis.referencing.cs.HardCodedCS; import org.apache.sis.referencing.cs.HardCodedAxes; - import static org.apache.sis.metadata.Assertions.assertXmlEquals; import static org.apache.sis.referencing.Assertions.assertWktEquals; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.referencing.datum.PixelInCell; +import org.apache.sis.referencing.legacy.DefaultImageCRS; +import org.apache.sis.referencing.legacy.DefaultImageDatum; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import static org.opengis.test.Assertions.assertAxisDirectionsEqual; diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java index 508d9deaf4,3b637f77a1..4258ca9ad6 --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java @@@ -217,10 -213,11 +218,11 @@@ public final class DefaultCoordinateOpe " TimeUnit[“day”, 86400]]]"); final CoordinateReferenceSystem targetCRS = parse("$Mercator"); - final CoordinateOperation operation = factory.createOperation(sourceCRS, targetCRS, CONTEXT); - assertSame (sourceCRS, operation.getSourceCRS()); - assertSame (targetCRS, operation.getTargetCRS()); - assertInstanceOf(ConcatenatedOperation.class, operation); + final ConcatenatedOperation operation = assertInstanceOf( + ConcatenatedOperation.class, - factory.createOperation(sourceCRS, targetCRS, null)); ++ factory.createOperation(sourceCRS, targetCRS, CONTEXT)); + assertSame(sourceCRS, operation.getSourceCRS()); + assertSame(targetCRS, operation.getTargetCRS()); /* * The accuracy of the coordinate operation depends on whether a path has been found with the help * of the EPSG database. See testProjectionAndLongitudeRotation() for more information. diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java index a7d05b2892,2d3815d2c8..c1f13bcf1f --- 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 @@@ -154,11 -154,11 +154,11 @@@ public final class SingleOperationMarsh public void testConversionUnmarshalling() throws JAXBException { final DefaultConversion c = unmarshalFile(DefaultConversion.class, openTestFile(false)); assertEquals("World Mercator", c.getName().getCode(), "name"); - assertEquals("3395", getSingleton(c.getIdentifiers()).getCode(), "identifier"); - assertEquals("Very small scale mapping.", getScope(c), "scope"); + assertEquals("3395", assertSingletonAuthorityCode(c), "identifier"); + assertEquals("Very small scale mapping.", assertSingletonScope(c), "scope"); - assertTrue (c.getOperationVersion().isEmpty(), "operationVersion"); + assertNull(c.getOperationVersion(), "operationVersion"); - final GeographicBoundingBox e = getDomainOfValidity(c); + final GeographicBoundingBox e = assertSingletonDomainOfValidity(c); assertEquals(+180, e.getEastBoundLongitude(), "eastBoundLongitude"); assertEquals(-180, e.getWestBoundLongitude(), "westBoundLongitude"); assertEquals( 84, e.getNorthBoundLatitude(), "northBoundLatitude"); @@@ -219,9 -219,9 +219,9 @@@ public void testTransformationUnmarshalling() throws JAXBException { final DefaultTransformation c = unmarshalFile(DefaultTransformation.class, openTestFile(true)); assertEquals("NTF (Paris) to NTF (1)", c.getName().getCode(), "name"); - assertEquals("1763", getSingleton(c.getIdentifiers()).getCode(), "identifier"); - assertEquals("Change of prime meridian.", getScope(c), "scope"); + assertEquals("1763", assertSingletonAuthorityCode(c), "identifier"); + assertEquals("Change of prime meridian.", assertSingletonScope(c), "scope"); - assertEquals("IGN-Fra", c.getOperationVersion().get(), "operationVersion"); + assertEquals("IGN-Fra", c.getOperationVersion(), "operationVersion"); final OperationMethod method = c.getMethod(); assertNotNull(method, "method"); diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/test/integration/CoordinateOperationTest.java index 89a7682d5d,0c80944935..a8c812dfba --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/test/integration/CoordinateOperationTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/test/integration/CoordinateOperationTest.java @@@ -41,11 -41,8 +41,11 @@@ import org.junit.jupiter.api.Test import static org.junit.jupiter.api.Assertions.*; import org.apache.sis.referencing.operation.transform.MathTransformTestCase; import static org.apache.sis.test.Assertions.assertEqualsIgnoreMetadata; + import static org.apache.sis.test.TestCase.assumeConnectionToEPSG; +// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.referencing.operation.CoordinateOperationContext; + /** * Tests mixing use of EPSG dataset, change of axes convention, application of math transforms, diff --cc geoapi/snapshot index 4b998b7f66,7eff7cfcbd..352a974aca --- a/geoapi/snapshot +++ b/geoapi/snapshot @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 4b998b7f663fc2ec95e1a8533597dc42f886b094 -Subproject commit 7eff7cfcbd6ce7ac82b99a90b9ee465914e629c1 ++Subproject commit 352a974acadf2cd5471b51c5e98c866f386e0b5b
