sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Add execution of GeoAPI parameterized transform tests.
Date Tue, 05 May 2020 22:45:24 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit ed398597337484e417dbdb2a974290fe3463077b
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue May 5 18:04:49 2020 +0200

    Add execution of GeoAPI parameterized transform tests.
---
 .../referencing/geoapi/AuthorityFactoryTest.java   | 72 ++++++++++++++++++
 .../geoapi/ParameterizedTransformTest.java         | 87 ++++++++++++++++++++++
 .../sis/test/suite/ReferencingTestSuite.java       |  4 +
 .../org/apache/sis/storage/gdal/TransformTest.java |  1 -
 4 files changed, 163 insertions(+), 1 deletion(-)

diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/geoapi/AuthorityFactoryTest.java
b/core/sis-referencing/src/test/java/org/apache/sis/referencing/geoapi/AuthorityFactoryTest.java
new file mode 100644
index 0000000..25ab407
--- /dev/null
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/geoapi/AuthorityFactoryTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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.referencing.geoapi;
+
+import org.opengis.util.FactoryException;
+import org.apache.sis.referencing.CRS;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+import org.junit.Ignore;
+
+
+/**
+ * Runs the suite of transformation tests provided in the GeoAPI project.
+ * The test suite uses the authority factory instance registered in {@link CRS}.
+ * Some (not all) of those tests require the EPSG geodetic database to be installed.
+ * If that database is not available, tests that can not be executed will be automatically
skipped.
+ *
+ * @author  Cédric Briançon (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 1.1
+ * @since   1.1
+ */
+@RunWith(JUnit4.class)
+public final strictfp class AuthorityFactoryTest extends org.opengis.test.referencing.AuthorityFactoryTest
{
+    /**
+     * Creates a new test suite using the singleton factory instance.
+     *
+     * @throws FactoryException if no factory can be returned for the given authority.
+     */
+    public AuthorityFactoryTest() throws FactoryException {
+        super(CRS.getAuthorityFactory(null), null, null);
+    }
+
+    /**
+     * Skips for now the <cite>Krovak</cite> projection.
+     */
+    @Override
+    @Ignore("Projection not yet implemented")
+    public void testEPSG_2065() {
+    }
+
+    /**
+     * Skips for now the <cite>Lambert Azimuthal Equal Area</cite> projection.
+     */
+    @Override
+    @Ignore("Projection not yet implemented")
+    public void testEPSG_3035() {
+    }
+
+    /**
+     * Skips for now the <cite>Hyperbolic Cassini-Soldner</cite> projection
+     * because projection derivative (Jacobian matrix) is not yet implemented.
+     */
+    @Override
+    @Ignore("Derivative (Jacobian) not yet implemented")
+    public void testEPSG_3139() {
+    }
+}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/geoapi/ParameterizedTransformTest.java
b/core/sis-referencing/src/test/java/org/apache/sis/referencing/geoapi/ParameterizedTransformTest.java
new file mode 100644
index 0000000..8b7016a
--- /dev/null
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/geoapi/ParameterizedTransformTest.java
@@ -0,0 +1,87 @@
+/*
+ * 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.referencing.geoapi;
+
+import org.opengis.util.FactoryException;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransform2D;
+import org.opengis.referencing.operation.MathTransformFactory;
+import org.opengis.referencing.operation.TransformException;
+import org.apache.sis.internal.system.DefaultFactories;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+import org.junit.After;
+import org.junit.Test;
+
+import static org.opengis.test.Assert.*;
+
+
+/**
+ * Runs a suite of tests provided in the GeoAPI project.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 1.1
+ * @since   1.1
+ */
+@RunWith(JUnit4.class)
+public final strictfp class ParameterizedTransformTest extends org.opengis.test.referencing.ParameterizedTransformTest
{
+    /**
+     * Creates a new test suite using the singleton factory instance.
+     */
+    public ParameterizedTransformTest() {
+        super(DefaultFactories.forBuildin(MathTransformFactory.class));
+    }
+
+    /**
+     * Every map projections shall be instances of {@link MathTransform2D}.
+     * Note that some tests inherited from the parent class are not about
+     * map projections.
+     */
+    @After
+    public void ensureMathTransform2D() {
+        final MathTransform tr = transform;
+        if (tr != null && tr.getSourceDimensions() == 2 && tr.getTargetDimensions()
== 2) {
+            assertInstanceOf("Unexpected implementation.", MathTransform2D.class, tr);
+        }
+    }
+
+    /**
+     * Disables the derivative (Jacobian) tests because not yet implemented.
+     *
+     * @throws FactoryException if the math transform can not be created.
+     * @throws TransformException if the example point can not be transformed.
+     */
+    @Test
+    @Override
+    public void testModifiedAzimuthalEquidistant() throws FactoryException, TransformException
{
+        isDerivativeSupported = false;
+        super.testModifiedAzimuthalEquidistant();
+    }
+
+    /**
+     * Disables the derivative (Jacobian) tests because not yet implemented.
+     *
+     * @throws FactoryException if the math transform can not be created.
+     * @throws TransformException if the example point can not be transformed.
+     */
+    @Test
+    @Override
+    public void testHyperbolicCassiniSoldner() throws FactoryException, TransformException
{
+        isDerivativeSupported = false;
+        super.testHyperbolicCassiniSoldner();
+    }
+}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
b/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
index eb5fe25..0040a49 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
@@ -263,6 +263,10 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.operation.builder.LinearTransformBuilderTest.class,
     org.apache.sis.referencing.operation.builder.LocalizationGridBuilderTest.class,
 
+    // GeoAPI conformance test suite.
+    org.apache.sis.referencing.geoapi.AuthorityFactoryTest.class,
+    org.apache.sis.referencing.geoapi.ParameterizedTransformTest.class,
+
     // Geometry and miscellaneous
     org.apache.sis.geometry.AbstractDirectPositionTest.class,
     org.apache.sis.geometry.GeneralDirectPositionTest.class,
diff --git a/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/TransformTest.java
b/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/TransformTest.java
index 703b5a6..051569a 100644
--- a/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/TransformTest.java
+++ b/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/TransformTest.java
@@ -88,7 +88,6 @@ public class TransformTest extends ParameterizedTransformTest {
         if (!FAILURES.isEmpty()) {
             assertSetEquals(Arrays.asList(
                     "Abridged Molodensky",
-                    "Cassini-Soldner",                          // No OperationMethod in
SIS yet.
                     "Krovak",                                   // No OperationMethod in
SIS yet.
                     "Lambert Azimuthal Equal Area",             // No OperationMethod in
SIS yet.
                     "Lambert Conic Conformal (2SP Belgium)",


Mime
View raw message