sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/04: Add a test for the Japan profile module. This is mostly as a matter of principle, for avoiding issues with build tools expecting tests to exist in all modules.
Date Tue, 04 Jun 2019 13:18:41 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 5fc63a3d2b25ed03a10de6a80630a8a20f334c29
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue Jun 4 14:36:24 2019 +0200

    Add a test for the Japan profile module.
    This is mostly as a matter of principle, for avoiding issues with build tools expecting
tests to exist in all modules.
---
 .../apache/sis/profile/france/package-info.java    |  2 +-
 .../org/apache/sis/profile/japan/package-info.java | 32 +++++++++++++
 .../apache/sis/profile/japan/JapanProfileTest.java | 52 ++++++++++++++++++++++
 .../sis/test/suite/JapanProfileTestSuite.java      | 45 +++++++++++++++++++
 .../org/apache/sis/test/suite/package-info.txt     |  3 ++
 5 files changed, 133 insertions(+), 1 deletion(-)

diff --git a/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/package-info.java
b/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/package-info.java
index a114f67..75bdd84 100644
--- a/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/package-info.java
+++ b/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/package-info.java
@@ -22,7 +22,7 @@
  * The French profile also added two properties to the ISO 19115:2003 standard.
  * Equivalent properties have been added to the 2013 revision of ISO 19115,
  * so the French profile should not be needed anymore except for compatibility with oldest
specifications.
- * The following table lists the French extentions and their replacement in the newer ISO
standard:
+ * The following table lists the French extensions and their replacement in the newer ISO
standard:
  *
  * <table class="sis">
  *   <caption>AFNOR to ISO mapping</caption>
diff --git a/profiles/sis-japan-profile/src/main/java/org/apache/sis/profile/japan/package-info.java
b/profiles/sis-japan-profile/src/main/java/org/apache/sis/profile/japan/package-info.java
new file mode 100644
index 0000000..8f34531
--- /dev/null
+++ b/profiles/sis-japan-profile/src/main/java/org/apache/sis/profile/japan/package-info.java
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+/**
+ * Japanese extensions to netCDF reader.
+ * This module enables reading of following data:
+ *
+ * <ul>
+ *   <li>Global Change Observation Mission - Climate (GCOM-C), a.k.a. "Shikisai".</li>
+ *   <li>Global Change Observation Mission - Water (GCOM-W), a.k.a. "Shizuku".</li>
+ * </ul>
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 1.0
+ * @since   1.0
+ * @module
+ */
+package org.apache.sis.profile.japan;
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
new file mode 100644
index 0000000..2cb87f7
--- /dev/null
+++ b/profiles/sis-japan-profile/src/test/java/org/apache/sis/profile/japan/JapanProfileTest.java
@@ -0,0 +1,52 @@
+/*
+ * 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.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;
+
+
+/**
+ * Tests the Japanese profile.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 1.0
+ * @since   1.0
+ * @module
+ */
+public final strictfp class JapanProfileTest extends TestCase {
+    /**
+     * Verifies that GCOM-C and GCOM-W conventions are registered.
+     */
+    @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);
+    }
+}
diff --git a/profiles/sis-japan-profile/src/test/java/org/apache/sis/test/suite/JapanProfileTestSuite.java
b/profiles/sis-japan-profile/src/test/java/org/apache/sis/test/suite/JapanProfileTestSuite.java
new file mode 100644
index 0000000..d5acbd3
--- /dev/null
+++ b/profiles/sis-japan-profile/src/test/java/org/apache/sis/test/suite/JapanProfileTestSuite.java
@@ -0,0 +1,45 @@
+/*
+ * 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.suite;
+
+import org.apache.sis.test.TestSuite;
+import org.junit.runners.Suite;
+import org.junit.BeforeClass;
+
+
+/**
+ * All tests from the {@code sis-french-profile} module, in rough dependency order.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.4
+ * @since   0.4
+ * @module
+ */
+@Suite.SuiteClasses({
+    org.apache.sis.profile.japan.JapanProfileTest.class
+})
+public final strictfp class JapanProfileTestSuite extends TestSuite {
+    /**
+     * Verifies the list of tests before to run the suite.
+     * See {@link #verifyTestList(Class, Class[])} for more information.
+     */
+    @BeforeClass
+    public static void verifyTestList() {
+        assertNoMissingTest(JapanProfileTestSuite.class);
+        verifyTestList(JapanProfileTestSuite.class);
+    }
+}
diff --git a/profiles/sis-japan-profile/src/test/java/org/apache/sis/test/suite/package-info.txt
b/profiles/sis-japan-profile/src/test/java/org/apache/sis/test/suite/package-info.txt
new file mode 100644
index 0000000..ac895b5
--- /dev/null
+++ b/profiles/sis-japan-profile/src/test/java/org/apache/sis/test/suite/package-info.txt
@@ -0,0 +1,3 @@
+Different modules provide classes in this package - be careful about collisions.
+This package is initially defined by the sis-utility module, which also provides
+the package-info.java file.


Mime
View raw message