sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626812 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/datum/ test/java/org/apache/sis/referencing/crs/ test/java/org/apache/sis/referencing/datum/
Date Mon, 22 Sep 2014 15:43:05 GMT
Author: desruisseaux
Date: Mon Sep 22 15:43:05 2014
New Revision: 1626812

URL: http://svn.apache.org/r1626812
Log:
Added a test case for pseudo-WKT 1 temporal CRS formatting.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1626812&r1=1626811&r2=1626812&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
(original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
Mon Sep 22 15:43:05 2014
@@ -29,7 +29,6 @@ import org.opengis.referencing.datum.Tem
 import org.apache.sis.internal.jaxb.gml.UniversalTimeAdapter;
 import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.util.ComparisonMode;
-import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.FormattableObject;
 
@@ -288,9 +287,8 @@ public class DefaultTemporalDatum extend
     @Override
     protected String formatTo(final Formatter formatter) {
         super.formatTo(formatter);
-        final Convention convention = formatter.getConvention();
         formatter.append(new Origin(MetadataUtilities.toDate(origin)));
-        if (convention.majorVersion() == 1) {
+        if (formatter.getConvention().majorVersion() == 1) {
             formatter.setInvalidWKT(this, null);
         }
         return "TimeDatum";

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java?rev=1626812&r1=1626811&r2=1626812&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java
[UTF-8] Mon Sep 22 15:43:05 2014
@@ -33,6 +33,20 @@ import static org.apache.sis.test.Metada
  */
 public final strictfp class DefaultTemporalCRSTest extends TestCase {
     /**
+     * Tests WKT 1 pseudo-formatting.
+     * This is not part of OGC 01-009 standard.
+     */
+    @Test
+    public void testWKT1() {
+        assertWktEquals(Convention.WKT1,
+                "TIMECRS[“Time”,\n" +
+                "  TIMEDATUM[“Modified Julian”, TIMEORIGIN[1858-11-17T00:00:00.0Z]],\n"
+
+                "  UNIT[“day”, 86400],\n" +
+                "  AXIS[“Time”, FUTURE]]",
+                HardCodedCRS.TIME);
+    }
+
+    /**
      * Tests WKT 2 formatting.
      */
     @Test

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java?rev=1626812&r1=1626811&r2=1626812&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] Mon Sep 22 15:43:05 2014
@@ -81,6 +81,7 @@ public final strictfp class DefaultTempo
     @Test
     public void testToWKT() {
         final DefaultTemporalDatum datum = create();
+        assertWktEquals(Convention.WKT1, "TIMEDATUM[“Modified Julian”, TIMEORIGIN[1858-11-17T00:00:00.0Z],
AUTHORITY[“SIS”, “MJ”]]", datum);
         assertWktEquals(Convention.WKT2, "TimeDatum[“Modified Julian”, TimeOrigin[1858-11-17T00:00:00.0Z],
Id[“SIS”, “MJ”]]", datum);
     }
 



Mime
View raw message