sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1672278 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/ sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/...
Date Thu, 09 Apr 2015 10:05:39 GMT
Author: desruisseaux
Date: Thu Apr  9 10:05:39 2015
New Revision: 1672278

URL: http://svn.apache.org/r1672278
Log:
Referencing: defines a constant for the "IOGP" string (internal usage only).

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -100,7 +100,7 @@ public final class Citations extends Sta
      *
      * @since 0.4
      */
-    public static final IdentifierSpace<Integer> EPSG = new Authority<>("IOGP",
Constants.EPSG);
+    public static final IdentifierSpace<Integer> EPSG = new Authority<>(Constants.IOGP,
Constants.EPSG);
 
     /**
      * The <a href="http://sis.apache.org">Apache SIS</a> project.

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -41,8 +41,8 @@ public final strictfp class CitationsTes
         assertSame(ISO,      fromName("ISO"));
         assertSame(OGC,      fromName(Constants.OGC));
         assertSame(EPSG,     fromName(Constants.EPSG));  // This one is important.
-        assertSame(EPSG,     fromName("IOGP"));          // This one is not really needed
(and maybe not strictly correct).
-        assertSame(SIS,      fromName("SIS"));
+        assertSame(EPSG,     fromName(Constants.IOGP));  // This one is not really needed
(and maybe not strictly correct).
+        assertSame(SIS,      fromName(Constants.SIS));
         assertSame(ESRI,     fromName("ESRI"));
         assertSame(ORACLE,   fromName("Oracle"));
         assertSame(NETCDF,   fromName("NetCDF"));

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -51,7 +51,7 @@ public final strictfp class HardCodedCit
     public static final DefaultCitation OGC;
     static {
         final DefaultCitation c = new DefaultCitation("Open Geospatial consortium");
-        c.setAlternateTitles(singleton(new SimpleInternationalString("OGC")));
+        c.setAlternateTitles(singleton(new SimpleInternationalString(Constants.OGC)));
         c.setPresentationForms(singleton(PresentationForm.DOCUMENT_DIGITAL));
         c.setIdentifiers(singleton(new DefaultIdentifier(Constants.OGC)));
         c.freeze();
@@ -93,8 +93,8 @@ public final strictfp class HardCodedCit
     public static final DefaultCitation IOGP;
     static {
         final DefaultCitation c = new DefaultCitation("International Association of Oil &
Gas Producers");
-        c.setAlternateTitles(singleton(new SimpleInternationalString("IOGP")));
-        c.setIdentifiers(singleton(new DefaultIdentifier("IOGP")));
+        c.setAlternateTitles(singleton(new SimpleInternationalString(Constants.IOGP)));
+        c.setIdentifiers(singleton(new DefaultIdentifier(Constants.IOGP)));
         c.freeze();
         IOGP = c;
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -19,6 +19,7 @@ package org.apache.sis.internal.jaxb.ref
 import java.util.Collections;
 import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.metadata.Identifier;
+import org.apache.sis.internal.util.Constants;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
@@ -88,7 +89,7 @@ public final strictfp class CodeTest ext
         final Identifier id = new ImmutableIdentifier(HardCodedCitations.IOGP, "EPSG", "4326",
"8.2", null);
         final Code value = Code.forIdentifiedObject(GeographicCRS.class, Collections.singleton(id));
         assertNotNull(value);
-        assertEquals("codeSpace", "IOGP", value.codeSpace);
+        assertEquals("codeSpace", Constants.IOGP, value.codeSpace);
         assertEquals("code", "urn:ogc:def:crs:EPSG:8.2:4326", value.code);
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -56,7 +56,7 @@ public final strictfp class NamedIdentif
         // ImmutableIdentifier properties
         assertEquals("code",      "4326", identifier.getCode());
         assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
-        assertSame  ("authority",  IOGP,   identifier.getAuthority());
+        assertSame  ("authority",  IOGP,  identifier.getAuthority());
         assertEquals("version",   "8.3",  identifier.getVersion());
         assertNull  ("remarks",           identifier.getRemarks());
         assertFalse ("isDeprecated",      identifier.isDeprecated());

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -132,20 +132,11 @@ public final strictfp class DefaultMathT
      * @throws NoSuchIdentifierException Should never happen.
      */
     @Test
-    @org.junit.Ignore("Pending port of Equidistant Cylindrical")
     public void testDuplicatedNames() throws NoSuchIdentifierException {
         final DefaultMathTransformFactory factory = factory();
-        final OperationMethod ellipsoidal = factory.getOperationMethod("EPSG:1028");
-        final OperationMethod spherical   = factory.getOperationMethod("EPSG:1029");
-        final OperationMethod deprecated  = factory.getOperationMethod("EPSG:9823");
-        assertSame(spherical, factory.getOperationMethod("Equidistant Cylindrical (Spherical)"));
-        assertSame("EPSG:1028 and 1029 are implemented by the same class.", ellipsoidal,
spherical);
-        assertSame("Should share the non-deprecated implementation.", ellipsoidal, deprecated);
-
-//      assertFalse(isDeprecated(ellipsoidal, "Equidistant Cylindrical"));
-//      assertFalse(isDeprecated(spherical,   "Equidistant Cylindrical (Spherical)"));
-
-        assertSame(spherical,   factory.getOperationMethod("Equidistant Cylindrical (Spherical)"));
-        assertSame(ellipsoidal, factory.getOperationMethod("Equidistant Cylindrical"));
+        final OperationMethod current    = factory.getOperationMethod("EPSG:1029");
+        final OperationMethod deprecated = factory.getOperationMethod("EPSG:9823");
+        assertSame(current, factory.getOperationMethod("Equidistant Cylindrical (Spherical)"));
+        assertSame("Should share the non-deprecated implementation.", current, deprecated);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -42,7 +42,7 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.util.iso.DefaultNameSpace;
 
 import static java.lang.StrictMath.*;
-import static org.apache.sis.internal.util.Constants.EPSG;
+import static org.apache.sis.internal.util.Constants.*;
 
 
 /**
@@ -79,7 +79,7 @@ public strictfp class ReferencingAssert
     public static void assertOgcIdentifierEquals(final String expected, final Identifier
actual) {
         assertNotNull(actual);
         assertSame("Authority", Citations.OGC, actual.getAuthority());
-        assertIdentifierEquals(null, "OGC", "OGC", null, expected, actual);
+        assertIdentifierEquals(null, OGC, OGC, null, expected, actual);
     }
 
     /**
@@ -95,7 +95,7 @@ public strictfp class ReferencingAssert
         assertNotNull(actual);
         assertEquals("code",       expected, actual.getCode());
         assertEquals("codeSpace",  EPSG,  actual.getCodeSpace());
-        assertEquals("authority", "IOGP", Citations.getIdentifier(actual.getAuthority()));
+        assertEquals("authority",  IOGP,  Citations.getIdentifier(actual.getAuthority()));
         assertEquals("identifier", EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + expected,
                 IdentifiedObjects.toString(actual));
     }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java?rev=1672278&r1=1672277&r2=1672278&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
[UTF-8] Thu Apr  9 10:05:39 2015
@@ -28,7 +28,7 @@ import org.apache.sis.util.Static;
  * not be used for abbreviations for instance, even if the abbreviation result in the same
string.
  *
  * Those constants do not need to be used systematically in tests neither, especially when
the test
- * builds its tested object itself.
+ * creates itself the instance to be tested.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
@@ -42,7 +42,13 @@ public final class Constants extends Sta
     public static final String EPSG = "EPSG";
 
     /**
-     * The {@value} code space.
+     * The {@value} authority, which is the maintainer of the {@link #EPSG} database.
+     * Used as the EPSG authority, while EPSG is used as the code space.
+     */
+    public static final String IOGP = "IOGP";
+
+    /**
+     * The {@value} authority and code space.
      */
     public static final String OGC = "OGC";
 



Mime
View raw message