sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1771167 - in /sis/branches/JDK8: core/sis-referencing/pom.xml core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java ide-project/NetBeans/nbproject/project.properties pom.xml
Date Thu, 24 Nov 2016 15:54:03 GMT
Author: desruisseaux
Date: Thu Nov 24 15:54:03 2016
New Revision: 1771167

URL: http://svn.apache.org/viewvc?rev=1771167&view=rev
Log:
Enable the test of EPSG dataset on HSQLDB and add a test (to be run manually for now) on PostgreSQL.

Modified:
    sis/branches/JDK8/core/sis-referencing/pom.xml
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java
    sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties
    sis/branches/JDK8/pom.xml

Modified: sis/branches/JDK8/core/sis-referencing/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/pom.xml?rev=1771167&r1=1771166&r2=1771167&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/pom.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/pom.xml Thu Nov 24 15:54:03 2016
@@ -144,6 +144,16 @@ Implementations of Coordinate Reference
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.postgresql</groupId>
+      <artifactId>postgresql</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java?rev=1771167&r1=1771166&r2=1771167&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java
[UTF-8] Thu Nov 24 15:54:03 2016
@@ -60,7 +60,7 @@ import static org.junit.Assume.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn(EPSGFactoryTest.class)
@@ -143,14 +143,9 @@ public final strictfp class EPSGInstalle
      * Tests the creation of an EPSG database on HSQLDB.
      * This test is skipped if the SQL scripts are not found.
      *
-     * <p>This test is skipped by default because HSQLDB changes the {@code java.util.logging}
configuration,
-     * which causes failures in all Apache SIS tests that verify the logging messages after
execution of this
-     * test. This impact this {@code EPSGInstallerTest} class, but also other test classes.</p>
-     *
      * @throws Exception if an error occurred while creating the database.
      */
     @Test
-    @Ignore("Skipped for protecting java.util.logging configuration against changes.")
     public void testCreationOnHSQLDB() throws Exception {
         final InstallationScriptProvider scripts = getScripts();            // Needs to be
invoked first.
         final DataSource ds = (DataSource) Class.forName("org.hsqldb.jdbc.JDBCDataSource").newInstance();
@@ -166,6 +161,30 @@ public final strictfp class EPSGInstalle
         loggings.assertNoUnexpectedLog();
     }
 
+    /**
+     * Tests the creation of an EPSG database on PostgreSQL. This test is disabled by default.
+     * To run this test, the tester needs to launch on {@code "localhost"} a PostgreSQL server
+     * having an empty database named {@code "SpatialMetadataTest"}. After the test completion,
+     * one can verify the {@code "EPSG"} schema created by the test, then delete that schema
for future test executions
+     * (this test does <strong>not</strong> delete by itself the schema that
it created).
+     *
+     * @throws Exception if an error occurred while creating the database.
+     *
+     * @since 0.8
+     */
+    @Test
+    @Ignore("This test need to be run manually on a machine having a local PostgreSQL database.")
+    public void testCreationOnPostgreSQL() throws Exception {
+        final InstallationScriptProvider scripts = getScripts();            // Needs to be
invoked first.
+        final DataSource ds = (DataSource) Class.forName("org.postgresql.ds.PGSimpleDataSource").newInstance();
+        final Class<?> dsc = ds.getClass();
+        dsc.getMethod("setServerName",   String.class).invoke(ds, "localhost");
+        dsc.getMethod("setDatabaseName", String.class).invoke(ds, "SpatialMetadataTest");
+        createAndTest(ds, scripts);
+        loggings.assertNextLogContains("EPSG", "jdbc:postgresql://localhost/SpatialMetadataTest");
+        loggings.assertNoUnexpectedLog();
+    }
+
     /**
      * Requests the "WGS84" and the "WGS72 / UTM zone 15N" coordinate reference systems from
the EPSG database
      * at the given {@code DataSource}. Those requests should trig the creation of the EPSG
database.

Modified: sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties?rev=1771167&r1=1771166&r2=1771167&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Thu Nov
24 15:54:03 2016
@@ -100,6 +100,8 @@ slf4j.version        = 1.7.7
 junit.version        = 4.12
 hamcrest.version     = 1.3
 jaxb-ns-mapper       = 2.2.4
+hsqldb.version       = 2.3.4
+postgresql.version   = 9.4.1212.jre7
 
 #
 # Classpaths for compilation, execution and tests.
@@ -135,6 +137,8 @@ run.classpath=\
 run.test.classpath=\
     ${javac.test.classpath}:\
     ${build.test.classes.dir}:\
+    ${maven.repository}/org/hsqldb/hsqldb/${hsqldb.version}/hsqldb-${hsqldb.version}.jar:\
+    ${maven.repository}/org/postgresql/postgresql/${postgresql.version}/postgresql-${postgresql.version}.jar:\
     ${maven.repository}/org/jdom/jdom2/${jdom2.version}/jdom2-${jdom2.version}.jar:\
     ${maven.repository}/edu/ucar/udunits/${netcdf.version}/udunits-${netcdf.version}.jar:\
     ${maven.repository}/edu/ucar/httpservices/${netcdf.version}/httpservices-${netcdf.version}.jar:\

Modified: sis/branches/JDK8/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/pom.xml?rev=1771167&r1=1771166&r2=1771167&view=diff
==============================================================================
--- sis/branches/JDK8/pom.xml (original)
+++ sis/branches/JDK8/pom.xml Thu Nov 24 15:54:03 2016
@@ -432,6 +432,20 @@ Apache SIS is a free software, Java lang
         <version>1.12</version>
       </dependency>
 
+      <!-- Databases -->
+      <dependency>
+        <groupId>org.hsqldb</groupId>
+        <artifactId>hsqldb</artifactId>
+        <version>2.3.4</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.postgresql</groupId>
+        <artifactId>postgresql</artifactId>
+        <version>9.4.1212.jre7</version>
+        <scope>test</scope>
+      </dependency>
+
       <!-- Optional dependencies -->
       <dependency>
         <groupId>org.osgi</groupId>



Mime
View raw message