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 bb45c5eb60ea8f67484f348eb6a97fbf2c39926e
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Sat Jul 8 10:53:15 2023 +0200

    Avoid using `ServiceLoader` directly in the test, because it will not run 
in a JPMS context.
    Opportunistic warning resolution.
---
 .../operation/projection/InitializerTest.java      |  8 ++++++-
 .../apache/sis/profile/japan/JapanProfileTest.java | 26 ++++++++++------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git 
a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
 
b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
index ab0e420510..8c11bdfdc8 100644
--- 
a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
+++ 
b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
@@ -38,7 +38,13 @@ import static org.junit.Assert.*;
  * @version 0.7
  * @since   0.7
  */
-public final class InitializerTest extends TestCase{
+public final class InitializerTest extends TestCase {
+    /**
+     * Creates a new test case.
+     */
+    public InitializerTest() {
+    }
+
     /**
      * Tests the {@link Initializer#radiusOfConformalSphere(double)} method.
      * This test computes the Radius of Conformal Sphere using the values 
given by the
diff --git 
a/profiles/sis-japan-profile/src/test/java/org/apache/sis/profile/japan/JapanProfileTest.java
 
b/profiles/sis-japan-profile/src/test/java/org/apache/sis/profile/japan/JapanProfileTest.java
index 80ea473e88..41e1fa834f 100644
--- 
a/profiles/sis-japan-profile/src/test/java/org/apache/sis/profile/japan/JapanProfileTest.java
+++ 
b/profiles/sis-japan-profile/src/test/java/org/apache/sis/profile/japan/JapanProfileTest.java
@@ -16,36 +16,34 @@
  */
 package org.apache.sis.profile.japan;
 
-import java.util.ServiceLoader;
 import org.apache.sis.internal.earth.netcdf.GCOM_C;
-import org.apache.sis.internal.earth.netcdf.GCOM_W;
 import org.apache.sis.internal.netcdf.Convention;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 
 /**
  * Tests the Japanese profile.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.4
  * @since   1.0
  */
 public final class JapanProfileTest extends TestCase {
     /**
-     * Verifies that GCOM-C and GCOM-W conventions are registered.
+     * Tests {@link GCOM_C#mapAttributeName(String, int)}.
      */
     @Test
-    public void testRegistration() {
-        boolean foundGCOM_C = false;
-        boolean foundGCOM_W = false;
-        for (final Convention c : ServiceLoader.load(Convention.class)) {
-            foundGCOM_C |= (c instanceof GCOM_C);
-            foundGCOM_W |= (c instanceof GCOM_W);
-        }
-        assertTrue("GCOM C", foundGCOM_C);
-        assertTrue("GCOM W", foundGCOM_W);
+    public void testMapAttributeName() {
+        final Convention c = new GCOM_C();
+        assertEquals("title",               c.mapAttributeName("title", 0));
+        assertEquals("Product_name",        c.mapAttributeName("title", 1));
+        assertNull  (                       c.mapAttributeName("title", 2));
+        assertEquals("time_coverage_start", 
c.mapAttributeName("time_coverage_start", 0));
+        assertEquals("Scene_start_time",    
c.mapAttributeName("time_coverage_start", 1));
+        assertEquals("Image_start_time",    
c.mapAttributeName("time_coverage_start", 2));
+        assertNull  (                       
c.mapAttributeName("time_coverage_start", 3));
     }
 }

Reply via email to