You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2017/07/13 11:18:34 UTC
svn commit: r1801828 - in /sis/branches/JDK8: ide-project/NetBeans/
storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/
storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/
storage/sis-gdal/src/test/java/org/apache/sis/test/suite/
Author: desruisseaux
Date: Thu Jul 13 11:18:33 2017
New Revision: 1801828
URL: http://svn.apache.org/viewvc?rev=1801828&view=rev
Log:
Add test for EPSGFactory.
Added:
sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java (with props)
Modified:
sis/branches/JDK8/ide-project/NetBeans/build.xml
sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java
sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java
sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java
Modified: sis/branches/JDK8/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/build.xml?rev=1801828&r1=1801827&r2=1801828&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK8/ide-project/NetBeans/build.xml Thu Jul 13 11:18:33 2017
@@ -74,8 +74,9 @@
<include name="**/*.properties"/>
</fileset>
<fileset dir="${project.root}/storage/sis-gdal/src/main/resources">
- <include name="**/*.so"/>
+ <include name="**/*.txt"/>
<include name="**/*.dll"/>
+ <include name="**/*.so"/>
</fileset>
<fileset dir="${project.root}/application/sis-console/src/main/resources">
<include name="**/*.properties"/>
Modified: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java?rev=1801828&r1=1801827&r2=1801828&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java [UTF-8] Thu Jul 13 11:18:33 2017
@@ -80,7 +80,7 @@ final class EPSGFactory extends Abstract
* use the axis order declared by the EPSG database, or {@code false} for
* the Proj.4 axis order. The default value is {@code true}.
*/
- private EPSGFactory(final boolean useEpsgAxisOrder) {
+ EPSGFactory(final boolean useEpsgAxisOrder) {
this.useEpsgAxisOrder = useEpsgAxisOrder;
}
Modified: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java?rev=1801828&r1=1801827&r2=1801828&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java [UTF-8] Thu Jul 13 11:18:33 2017
@@ -109,7 +109,7 @@ public final class Proj4 extends Static
if (beginParam >= 0) {
beginParam += AXIS_ORDER_PARAM.length();
final int length = definition.length();
- while (beginParam < length) { // Skip whitespaces.
+ while (beginParam < length) { // Skip whitespaces.
final int c = definition.codePointAt(beginParam);
if (!Character.isWhitespace(c)) break;
beginParam += Character.charCount(c);
Added: sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java?rev=1801828&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java [UTF-8] Thu Jul 13 11:18:33 2017
@@ -0,0 +1,62 @@
+/*
+ * 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.storage.gdal;
+
+import org.opengis.util.FactoryException;
+import org.opengis.referencing.crs.GeographicCRS;
+import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestCase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+
+/**
+ * Tests the {@link EPSGFactory} class.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since 0.8
+ * @module
+ */
+@DependsOn(PJTest.class)
+public final strictfp class EPSGFactoryTest extends TestCase {
+ /**
+ * Verifies if the Proj4 library is available.
+ */
+ @BeforeClass
+ public static void verifyNativeLibraryAvailability() {
+ PJTest.verifyNativeLibraryAvailability();
+ }
+
+ /**
+ * Tests the creation of the EPSG:4326 geographic CRS. The interesting part of this test
+ * is the check for axis order. The result will depend on whether the axis orientations
+ * map has been properly created or not.
+ *
+ * @throws FactoryException if an error occurred while creating the CRS objects.
+ */
+ @Test
+ public void testEPSG_4326() throws FactoryException {
+ final EPSGFactory factory = new EPSGFactory(true);
+ final GeographicCRS crs = factory.createGeographicCRS("EPSG:4326");
+ // Use Proj.4 specific API to check axis order.
+ final PJ pj = (PJ) crs.getDatum();
+ assertArrayEquals(new char[] {'n', 'e', 'u'}, pj.getAxisDirections());
+ }
+}
Propchange: sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8
Modified: sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java?rev=1801828&r1=1801827&r2=1801828&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java [UTF-8] Thu Jul 13 11:18:33 2017
@@ -30,7 +30,8 @@ import org.junit.runners.Suite;
* @module
*/
@Suite.SuiteClasses({
- org.apache.sis.storage.gdal.PJTest.class
+ org.apache.sis.storage.gdal.PJTest.class,
+ org.apache.sis.storage.gdal.EPSGFactoryTest.class
})
public final strictfp class GDALTestSuite extends TestSuite {
/**