sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1811251 - in /sis/data/non-free: ./ sis-embedded-data/ sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/ sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/
Date Thu, 05 Oct 2017 20:15:17 GMT
Author: desruisseaux
Date: Thu Oct  5 20:15:17 2017
New Revision: 1811251

URL: http://svn.apache.org/viewvc?rev=1811251&view=rev
Log:
Enable the tests.

Added:
    sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java
  (with props)
    sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java
  (with props)
Modified:
    sis/data/non-free/pom.xml
    sis/data/non-free/sis-embedded-data/pom.xml
    sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedResourcesTest.java
    sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/ScriptProviderTest.java

Modified: sis/data/non-free/pom.xml
URL: http://svn.apache.org/viewvc/sis/data/non-free/pom.xml?rev=1811251&r1=1811250&r2=1811251&view=diff
==============================================================================
--- sis/data/non-free/pom.xml (original)
+++ sis/data/non-free/pom.xml Thu Oct  5 20:15:17 2017
@@ -92,6 +92,17 @@ The "non-free" modules contain data that
       <artifactId>sis-referencing</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opengis</groupId>
+      <artifactId>geoapi-conformance</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sis.core</groupId>
+      <artifactId>sis-utility</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 

Modified: sis/data/non-free/sis-embedded-data/pom.xml
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/pom.xml?rev=1811251&r1=1811250&r2=1811251&view=diff
==============================================================================
--- sis/data/non-free/sis-embedded-data/pom.xml (original)
+++ sis/data/non-free/sis-embedded-data/pom.xml Thu Oct  5 20:15:17 2017
@@ -140,6 +140,16 @@ Provides non-free data, including the EP
           </excludes>
         </configuration>
       </plugin>
+
+      <!-- Unset the SIS_DATA environment variable. -->
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <environmentVariables>
+            <SIS_DATA></SIS_DATA>
+          </environmentVariables>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 

Added: sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java?rev=1811251&view=auto
==============================================================================
--- sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java
(added)
+++ sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java
[UTF-8] Thu Oct  5 20:15:17 2017
@@ -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.resources.embedded;
+
+import org.apache.sis.test.TestSuite;
+import org.junit.BeforeClass;
+import org.junit.runners.Suite;
+
+
+/**
+ * All tests from the {@code sis-embedded-data} module, in approximative dependency order.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since   0.8
+ * @module
+ */
+@Suite.SuiteClasses({
+    EmbeddedResourcesTest.class
+})
+public final strictfp class EmbeddedDataTestSuite 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(EmbeddedDataTestSuite.class);
+        verifyTestList(EmbeddedDataTestSuite.class);
+    }
+}

Propchange: sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedDataTestSuite.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedResourcesTest.java
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedResourcesTest.java?rev=1811251&r1=1811250&r2=1811251&view=diff
==============================================================================
--- sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedResourcesTest.java
[UTF-8] (original)
+++ sis/data/non-free/sis-embedded-data/src/test/java/org/apache/sis/resources/embedded/EmbeddedResourcesTest.java
[UTF-8] Thu Oct  5 20:15:17 2017
@@ -26,6 +26,10 @@ import javax.sql.DataSource;
 import org.apache.sis.setup.InstallationResources;
 import org.apache.sis.internal.metadata.sql.Initializer;
 import org.apache.sis.internal.system.DataDirectory;
+import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.test.LoggingWatcher;
+import org.apache.sis.test.TestCase;
+import org.junit.Rule;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -38,7 +42,14 @@ import static org.junit.Assert.*;
  * @version 0.8
  * @since   0.8
  */
-public final strictfp class EmbeddedResourcesTest {
+public final strictfp class EmbeddedResourcesTest extends TestCase {
+    /**
+     * A JUnit {@link Rule} for listening to log events. This field is public because JUnit
requires us to
+     * do so, but should be considered as an implementation details (it should have been
a private field).
+     */
+    @Rule
+    public final LoggingWatcher loggings = new LoggingWatcher(Loggers.SYSTEM);
+
     /**
      * Returns the {@link ScriptProvider} instance declared in the {@code META-INF/services/}
directory.
      */
@@ -59,6 +70,7 @@ public final strictfp class EmbeddedReso
         final InstallationResources provider = getInstance();
         assertTrue(provider.getLicense("Embedded", null, "text/plain").contains("IOGP"));
         assertTrue(provider.getLicense("Embedded", null, "text/html" ).contains("IOGP"));
+        loggings.assertNoUnexpectedLog();
     }
 
     /**
@@ -68,7 +80,8 @@ public final strictfp class EmbeddedReso
      */
     @Test
     public void testConnection() throws Exception {
-        assertTrue("The SIS_DATA environment variable must be unset for enabling this test.",
DataDirectory.isEnvClear());
+        final String dir = DataDirectory.getenv();
+        assertTrue("The SIS_DATA environment variable must be unset for enabling this test.",
(dir == null) || dir.isEmpty());
         final DataSource ds = Initializer.getDataSource();
         assertNotNull("Can not find the data source.", ds);
         try (Connection c = ds.getConnection()) {
@@ -80,5 +93,15 @@ public final strictfp class EmbeddedReso
                 }
             }
         }
+        /*
+         * Ignore the warning message about SIS_DATA environment variable not being defined.
+         * This warning occurs because we can not unset SIS_DATA with maven-surefire-plugin;
+         * we can only override it with an empty value. So Apache SIS assumes that the user
+         * wanted to provide a SIS_DATA value but the actual value is missing.
+         */
+        if (dir != null) {
+            loggings.assertNextLogContains(DataDirectory.ENV);
+        }
+        loggings.assertNoUnexpectedLog();
     }
 }

Added: sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java?rev=1811251&view=auto
==============================================================================
--- sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java
(added)
+++ sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java
[UTF-8] Thu Oct  5 20:15:17 2017
@@ -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.referencing.factory.sql.epsg;
+
+import org.apache.sis.test.TestSuite;
+import org.junit.BeforeClass;
+import org.junit.runners.Suite;
+
+
+/**
+ * All tests from the {@code sis-epsg} module, in approximative dependency order.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since   0.8
+ * @module
+ */
+@Suite.SuiteClasses({
+    ScriptProviderTest.class
+})
+public final strictfp class EpsgTestSuite 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(EpsgTestSuite.class);
+        verifyTestList(EpsgTestSuite.class);
+    }
+}

Propchange: sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/EpsgTestSuite.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/ScriptProviderTest.java
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/ScriptProviderTest.java?rev=1811251&r1=1811250&r2=1811251&view=diff
==============================================================================
--- sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/ScriptProviderTest.java
[UTF-8] (original)
+++ sis/data/non-free/sis-epsg/src/test/java/org/apache/sis/referencing/factory/sql/epsg/ScriptProviderTest.java
[UTF-8] Thu Oct  5 20:15:17 2017
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.BufferedReader;
 import java.util.ServiceLoader;
 import org.apache.sis.setup.InstallationResources;
+import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -33,7 +34,7 @@ import static org.junit.Assert.*;
  * @version 0.7
  * @since   0.7
  */
-public final strictfp class ScriptProviderTest {
+public final strictfp class ScriptProviderTest extends TestCase {
     /**
      * Returns the {@link ScriptProvider} instance declared in the {@code META-INF/services/}
directory.
      */



Mime
View raw message