sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1727581 [5/5] - in /sis/trunk: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metad...
Date Fri, 29 Jan 2016 13:35:44 GMT
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
[UTF-8] Fri Jan 29 13:35:42 2016
@@ -29,31 +29,49 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
 public final strictfp class DefinitionURITest extends TestCase {
     /**
-     * Tests {@link DefinitionURI#parse(String)} on {@code "urn:ogc:def:crs:EPSG:8.2:4326"}.
-     * This is a URN without parameters defined by EPSG.
+     * Tests {@link DefinitionURI#parse(String)} on strings that should not be recognized
as URN.
      */
     @Test
-    public void testParse() {
+    public void testParseInvalid() {
         assertNull(DefinitionURI.parse("EPSG:4326"));
+        assertNull(DefinitionURI.parse("EPSG::4326"));
+        assertNull(DefinitionURI.parse("urn:ogcx:def:CRS:EPSG:8.2:4326"));
+    }
 
-        DefinitionURI parsed = DefinitionURI.parse(" urn:ogc:def: crs : EPSG: 8.2 :4326 ");
+    /**
+     * Tests {@link DefinitionURI#parse(String)} on {@code "urn:ogc:def:crs:EPSG:8.2:4326"}.
+     * This is a URN without parameters defined by EPSG. This test also puts some spaces
for
+     * testing the parser capability to ignore them.
+     */
+    @Test
+    public void testParse() {
+        final DefinitionURI parsed = DefinitionURI.parse(" urn:ogc:def: crs : EPSG: 8.2 :4326
");
         assertNotNull("DefinitionURI", parsed);
         assertEquals ("isHTTP",    false,   parsed.isHTTP);
+        assertEquals ("isGML",     false,   parsed.isGML);
         assertEquals ("type",      "crs",   parsed.type);
         assertEquals ("authority", "EPSG",  parsed.authority);
         assertEquals ("version",   "8.2",   parsed.version);
         assertEquals ("code",      "4326",  parsed.code);
         assertNull   ("parameters",         parsed.parameters);
         assertEquals ("toString()", "urn:ogc:def:crs:EPSG:8.2:4326", parsed.toString());
+    }
 
-        parsed = DefinitionURI.parse("URN :X-OGC: Def:crs:EPSG::4326");
+    /**
+     * Tests {@link DefinitionURI#parse(String)} on {@code "urn:ogc:def:crs:EPSG::4326"}.
+     * This is a URN without version. This test also mixes lower and upper cases.
+     */
+    @Test
+    public void testParseWithoutVersion() {
+        final DefinitionURI parsed = DefinitionURI.parse("URN :X-OGC: Def:crs:EPSG::4326");
         assertNotNull("DefinitionURI", parsed);
         assertEquals ("isHTTP",    false,   parsed.isHTTP);
+        assertEquals ("isGML",     false,   parsed.isGML);
         assertEquals ("type",      "crs",   parsed.type);
         assertEquals ("authority", "EPSG",  parsed.authority);
         assertNull   ("version",            parsed.version);
@@ -72,6 +90,7 @@ public final strictfp class DefinitionUR
         final DefinitionURI parsed = DefinitionURI.parse("urn:ogc:def:crs:OGC:1.3:AUTO42003:1:-100:45");
         assertNotNull("DefinitionURI", parsed);
         assertEquals ("isHTTP",    false,       parsed.isHTTP);
+        assertEquals ("isGML",     false,       parsed.isGML);
         assertEquals ("type",      "crs",       parsed.type);
         assertEquals ("authority", "OGC",       parsed.authority);
         assertEquals ("version",   "1.3",       parsed.version);
@@ -82,20 +101,46 @@ public final strictfp class DefinitionUR
     }
 
     /**
-     * Tests {@link DefinitionURI#parse(String)} on {@code "http://www.opengis.net/gml/srs/epsg.xml#4326"}.
+     * Tests {@link DefinitionURI#parse(String)} on {@code "http://www.opengis.net/def/crs/epsg/0/4326"}.
      */
     @Test
     @DependsOnMethod("testParse")
     public void testParseHTTP() {
+        final DefinitionURI parsed = DefinitionURI.parse("http://www.opengis.net/def/crs/epsg/0/4326");
+        assertNotNull("DefinitionURI", parsed);
+        assertEquals ("isHTTP",    true,   parsed.isHTTP);
+        assertEquals ("isGML",     false,  parsed.isGML);
+        assertEquals ("type",      "crs",  parsed.type);
+        assertEquals ("authority", "epsg", parsed.authority);
+        assertNull   ("version",           parsed.version);
+        assertEquals ("code",      "4326", parsed.code);
+        assertNull   ("parameters",        parsed.parameters);
+        assertEquals ("toString()", "http://www.opengis.net/def/crs/epsg/0/4326", parsed.toString());
+    }
+
+    /**
+     * Tests {@link DefinitionURI#parse(String)} on {@code "http://www.opengis.net/gml/srs/epsg.xml#4326"}.
+     */
+    @Test
+    @DependsOnMethod("testParse")
+    public void testParseGML() {
         final DefinitionURI parsed = DefinitionURI.parse("http://www.opengis.net/gml/srs/epsg.xml#4326");
         assertNotNull("DefinitionURI", parsed);
         assertEquals ("isHTTP",    true,   parsed.isHTTP);
+        assertEquals ("isGML",     true,   parsed.isGML);
         assertEquals ("type",      "crs",  parsed.type);
         assertEquals ("authority", "epsg", parsed.authority);
         assertNull   ("version",           parsed.version);
         assertEquals ("code",      "4326", parsed.code);
         assertNull   ("parameters",        parsed.parameters);
         assertEquals ("toString()", "http://www.opengis.net/gml/srs/epsg.xml#4326", parsed.toString());
+
+        final DefinitionURI withoutExtension = DefinitionURI.parse("http://www.opengis.net/gml/srs/epsg#4326");
+        assertNotNull("Should parse even if the .xml extension is missig.", withoutExtension);
+        assertEquals(parsed.toString(), withoutExtension.toString());
+
+        assertNull("Should not parse if no '#' character.",
+                DefinitionURI.parse("http://www.opengis.net/gml/srs/epsg?4326"));
     }
 
     /**
@@ -137,7 +182,7 @@ public final strictfp class DefinitionUR
      * {@code "http://www.opengis.net/gml/srs/epsg.xml#4326"}.
      */
     @Test
-    public void testCodeOfHTTP() {
+    public void testCodeOfGML() {
         assertEquals("4326", DefinitionURI.codeOf("crs", "EPSG", "http://www.opengis.net/gml/srs/epsg.xml#4326"));
         assertNull  (        DefinitionURI.codeOf("crs", "OGC",  "http://www.opengis.net/gml/srs/epsg.xml#4326"));
         assertNull  (        DefinitionURI.codeOf("uom", "EPSG", "http://www.opengis.net/gml/srs/epsg.xml#4326"));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
[UTF-8] Fri Jan 29 13:35:42 2016
@@ -56,7 +56,7 @@ public strictfp class CoordinateSystemAx
      * {@inheritDoc}
      */
     @Override
-    Object[] properties() {
+    protected Object[] properties() {
         return new Object[] {getCode(), alias, abbreviation};
     }
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java
[UTF-8] Fri Jan 29 13:35:42 2016
@@ -39,7 +39,7 @@ import org.apache.sis.internal.jaxb.gco.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.7
  * @module
  */
 @SuppressWarnings("serial")
@@ -60,8 +60,10 @@ public strictfp class IdentifiedObjectMo
     /**
      * Returns all properties defined in this object,
      * for the convenience of {@link #equals(Object)} and {@link #hashCode()}.
+     *
+     * @return The properties to use in hash code computations and in comparisons.
      */
-    Object[] properties() {
+    protected Object[] properties() {
         return new Object[] {code, alias};
     }
 
@@ -125,9 +127,9 @@ public strictfp class IdentifiedObjectMo
     }
 
     /**
-     * Returns the identifier version ({@code null} for now).
+     * Returns the namespace version ({@code null} for now).
      *
-     * @return The identifier version.
+     * @return The namespace version.
      */
     @Override
     public final String getVersion() {

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
[UTF-8] Fri Jan 29 13:35:42 2016
@@ -117,7 +117,7 @@ public final strictfp class VerticalCRSM
      * {@inheritDoc}
      */
     @Override
-    Object[] properties() {
+    protected Object[] properties() {
         return new Object[] {getCode(), alias, minimumValue, maximumValue, unit, up};
     }
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/package-info.java?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/package-info.java [UTF-8]
(original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/package-info.java [UTF-8]
Fri Jan 29 13:35:42 2016
@@ -19,6 +19,10 @@
  * Provides objects that simulate the behavior of complex or unavailable real objects.
  * Mocks are often used as a replacement for objects to be defined only in dependant modules.
  *
+ * <p>This package does not provide all mocks defined by SIS, but only the mocks that
could not be put in
+ * the right package for the interface that they implement. To get a list of all mocks used
in SIS tests,
+ * we need to search for classes ending in {@code *Mock}.</p>
+ *
  * <p>Objects defined in this package are only for SIS testing purpose any many change
  * in any future version without notice.</p>
  *

Modified: sis/trunk/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/build.xml?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/build.xml (original)
+++ sis/trunk/ide-project/NetBeans/build.xml Fri Jan 29 13:35:42 2016
@@ -82,6 +82,13 @@
       </fileset>
     </concat>
 
+    <!-- CRSAuthorityFactory implementations to be loaded by ServiceLoader. -->
+    <concat destfile="${build.classes.dir}/META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory"
encoding="UTF-8" fixlastline="yes">
+      <fileset dir="${project.root}">
+        <include name="*/*/src/main/resources/META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory"/>
+      </fileset>
+    </concat>
+
     <!-- CRSFactory implementations to be loaded by ServiceLoader. -->
     <concat destfile="${build.classes.dir}/META-INF/services/org.opengis.referencing.crs.CRSFactory"
encoding="UTF-8" fixlastline="yes">
       <fileset dir="${project.root}">

Modified: sis/trunk/src/main/javadoc/stylesheet.css
URL: http://svn.apache.org/viewvc/sis/trunk/src/main/javadoc/stylesheet.css?rev=1727581&r1=1727580&r2=1727581&view=diff
==============================================================================
--- sis/trunk/src/main/javadoc/stylesheet.css (original)
+++ sis/trunk/src/main/javadoc/stylesheet.css Fri Jan 29 13:35:42 2016
@@ -180,7 +180,7 @@ div.block ol {
 div.block ul > li,
 div.block ol > li {
   margin-top:    0;
-  margin-bottom: 3px;
+  margin-bottom: 0;
 }
 
 div.block ul.verbose > li,



Mime
View raw message