sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1569926 [4/6] - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/io/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metadata/src/mai...
Date Wed, 19 Feb 2014 21:32:00 GMT
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -30,7 +30,7 @@ import static org.apache.sis.metadata.is
 
 
 /**
- * Tests {@link NamedIdentifier}.
+ * Tests the {@link NamedIdentifier} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -29,7 +29,7 @@ import static org.apache.sis.test.Assert
 
 
 /**
- * Tests {@link AbstractCRS}
+ * Tests the {@link AbstractCRS} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -22,17 +22,19 @@ import org.opengis.referencing.cs.Coordi
 import org.apache.sis.referencing.cs.DefaultCompoundCS;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.cs.HardCodedAxes;
+import org.apache.sis.io.wkt.Convention;
+import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
 import static org.opengis.referencing.cs.CoordinateSystem.NAME_KEY;
-import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 
 
 /**
- * Tests {@link DefaultCompoundCRS}
+ * Tests the {@link DefaultCompoundCRS} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
@@ -41,7 +43,8 @@ import static org.apache.sis.test.Assert
  */
 @DependsOn({
     SubTypesTest.class,
-    DefaultGeographicCRSTest.class
+    DefaultGeographicCRSTest.class,
+    DefaultVerticalCRSTest.class
 })
 public final strictfp class DefaultCompoundCRSTest extends TestCase {
     /**
@@ -139,4 +142,60 @@ public final strictfp class DefaultCompo
         assertSame("Expected a no-op.",         shifted, shifted.forConvention(AxesConvention.POSITIVE_RANGE));
         assertSame("Expected cached instance.", shifted, crs4   .forConvention(AxesConvention.POSITIVE_RANGE));
     }
+
+    /**
+     * Tests WKT 1 formatting.
+     */
+    @Test
+    public void testWKT1() {
+        assertWktEquals(Convention.WKT1,
+                "COMPD_CS[“WGS 84 + height + time”,\n" +
+                "  GEOGCS[“WGS 84”,\n" +
+                "    DATUM[“World Geodetic System 1984”,\n" +
+                "      SPHEROID[“WGS84”, 6378137.0, 298.257223563]],\n" +
+                "    PRIMEM[“Greenwich”, 0.0],\n" +
+                "    UNIT[“degree”, 0.017453292519943295],\n" +
+                "    AXIS[“Longitude”, EAST],\n" +
+                "    AXIS[“Latitude”, NORTH]],\n" +
+                "  VERT_CS[“Gravity-related height”,\n" +
+                "    VERT_DATUM[“Mean Sea Level”, 2005],\n" +
+                "    UNIT[“metre”, 1],\n" +
+                "    AXIS[“Gravity-related height”, UP]],\n" +
+                "  TIMECRS[“Time”,\n" +
+                "    TIMEDATUM[“UNIX”],\n" +
+                "    UNIT[“day”, 86400],\n" +
+                "    AXIS[“Time”, FUTURE]]]",
+                HardCodedCRS.GEOID_4D);
+    }
+
+    /**
+     * Tests WKT 2 formatting.
+     */
+    @Test
+    @DependsOnMethod("testWKT1")
+    public void testWKT2() {
+        assertWktEquals(Convention.WKT2,
+                "CompoundCRS[“WGS 84 + height + time”,\n" +
+                "  GeodeticCRS[“WGS 84”,\n" +
+                "    Datum[“World Geodetic System 1984”,\n" +
+                "      Ellipsoid[“WGS84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]]],\n" +
+                "      PrimeMeridian[“Greenwich”, 0.0, AngleUnit[“degree”, 0.017453292519943295]],\n" +
+                "    CS[“ellipsoidal”, 2],\n" +
+                "      Axis[“Longitude (λ)”, east],\n" +
+                "      Axis[“Latitude (φ)”, north],\n" +
+                "      AngleUnit[“degree”, 0.017453292519943295]],\n" +
+                "  VerticalCRS[“Gravity-related height”,\n" +
+                "    VerticalDatum[“Mean Sea Level”],\n" +
+                "    CS[“vertical”, 1],\n" +
+                "      Axis[“Gravity-related height (H)”, up],\n" +
+                "      LengthUnit[“metre”, 1]],\n" +
+                "  TimeCRS[“Time”,\n" +
+                "    TimeDatum[“UNIX”],\n" +
+                "    CS[“temporal”, 1],\n" +
+                "      Axis[“Time (t)”, future],\n" +
+                "      TimeUnit[“day”, 86400]],\n" +
+                "  Area[“World”],\n" +
+                "  BBox[-90.00, -180.00, 90.00, 180.00]]",
+                HardCodedCRS.GEOID_4D);
+    }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -27,7 +27,7 @@ import static org.apache.sis.test.Assert
 
 
 /**
- * Tests {@link DefaultGeodeticCRS}
+ * Tests the {@link DefaultGeodeticCRS} class.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Guilhem Legal (Geomatys)

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -21,15 +21,17 @@ import org.opengis.referencing.cs.Ellips
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.CommonCRS;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 
 
 /**
- * Tests {@link DefaultGeographicCRS}
+ * Tests the {@link DefaultGeographicCRS} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4 (derived from geotk-3.20)
@@ -83,4 +85,67 @@ public final strictfp class DefaultGeogr
         assertSame("latitude",  ref.getAxis(0), cs.getAxis(1));
         assertSame("height",    ref.getAxis(2), cs.getAxis(2));
     }
+
+    /**
+     * Tests WKT 1 formatting.
+     */
+    @Test
+    public void testWKT1() {
+        assertWktEquals(Convention.WKT1,
+                "GEOGCS[“WGS 84”,\n" +
+                "  DATUM[“World Geodetic System 1984”,\n" +
+                "    SPHEROID[“WGS84”, 6378137.0, 298.257223563]],\n" +
+                "  PRIMEM[“Greenwich”, 0.0],\n" +
+                "  UNIT[“degree”, 0.017453292519943295],\n" +
+                "  AXIS[“Longitude”, EAST],\n" +
+                "  AXIS[“Latitude”, NORTH]]",
+                HardCodedCRS.WGS84);
+    }
+
+    /**
+     * Tests WKT 2 formatting.
+     */
+    @Test
+    @DependsOnMethod("testWKT1")
+    public void testWKT2() {
+        assertWktEquals(Convention.WKT2,
+                "GeodeticCRS[“WGS 84”,\n" +
+                "  Datum[“World Geodetic System 1984”,\n" +
+                "    Ellipsoid[“WGS84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]]],\n" +
+                "    PrimeMeridian[“Greenwich”, 0.0, AngleUnit[“degree”, 0.017453292519943295]],\n" +
+                "  CS[“ellipsoidal”, 2],\n" +
+                "    Axis[“Longitude (λ)”, east],\n" +
+                "    Axis[“Latitude (φ)”, north],\n" +
+                "    AngleUnit[“degree”, 0.017453292519943295],\n" +
+                "  Area[“World”],\n" +
+                "  BBox[-90.00, -180.00, 90.00, 180.00]]",
+                HardCodedCRS.WGS84);
+
+        assertWktEquals(Convention.WKT2_SIMPLIFIED,
+                "GeodeticCRS[“WGS 84”,\n" +
+                "  Datum[“World Geodetic System 1984”,\n" +
+                "    Ellipsoid[“WGS84”, 6378137.0, 298.257223563]],\n" +
+                "    PrimeMeridian[“Greenwich”, 0.0],\n" +
+                "  CS[“ellipsoidal”, 2],\n" +
+                "    Axis[“Longitude (λ)”, east],\n" +
+                "    Axis[“Latitude (φ)”, north],\n" +
+                "    Unit[“degree”, 0.017453292519943295],\n" +
+                "  Area[“World”],\n" +
+                "  BBox[-90.00, -180.00, 90.00, 180.00]]",
+                HardCodedCRS.WGS84);
+
+        assertWktEquals(Convention.INTERNAL,
+                "GeodeticCRS[“WGS 84”,\n" +
+                "  Datum[“World Geodetic System 1984”,\n" +
+                "    Ellipsoid[“WGS84”, 6378137.0, 298.257223563],\n" +
+                "    Id[“EPSG”, 6326]],\n" +
+                "    PrimeMeridian[“Greenwich”, 0.0, Id[“EPSG”, 8901]],\n" +
+                "  CS[“ellipsoidal”, 2],\n" +
+                "    Axis[“Geodetic longitude (λ)”, east],\n" +
+                "    Axis[“Geodetic latitude (φ)”, north],\n" +
+                "    Unit[“degree”, 0.017453292519943295],\n" +
+                "  Area[“World”],\n" +
+                "  BBox[-90.00, -180.00, 90.00, 180.00]]",
+                HardCodedCRS.WGS84);
+    }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -131,6 +131,12 @@ public final strictfp class HardCodedCRS
             getProperties(HardCodedCS.GRAVITY_RELATED_HEIGHT), HardCodedDatum.MEAN_SEA_LEVEL, HardCodedCS.GRAVITY_RELATED_HEIGHT);
 
     /**
+     * A vertical coordinate reference system using Mean Sea Level datum.
+     */
+    public static final DefaultVerticalCRS DEPTH = new DefaultVerticalCRS(
+            getProperties(HardCodedCS.DEPTH), HardCodedDatum.MEAN_SEA_LEVEL, HardCodedCS.DEPTH);
+
+    /**
      * A temporal coordinate reference system for time in days elapsed since the Unix epoch.
      */
     public static final DefaultTemporalCRS TIME = new DefaultTemporalCRS(
@@ -141,7 +147,7 @@ public final strictfp class HardCodedCRS
      * This constant uses the "geoid" term as an approximation for the gravity related height.
      */
     public static final DefaultCompoundCRS GEOID_4D = new DefaultCompoundCRS(
-            properties("WGS 84 + height + time"), GRAVITY_RELATED_HEIGHT, TIME);
+            properties("WGS 84 + height + time"), WGS84, GRAVITY_RELATED_HEIGHT, TIME);
 
     /**
      * A two-dimensional Cartesian coordinate reference system with (column, row) axes.

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -21,7 +21,7 @@ import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.referencing.crs.HardCodedCRS.*;
 
 
@@ -63,25 +63,16 @@ public final strictfp class HardCodedCRS
      */
     @Test
     public void testDimensions() {
-        assertEquals("WGS84 2D", 2, WGS84   .getCoordinateSystem().getDimension());
-        assertEquals("WGS84 3D", 3, WGS84_3D.getCoordinateSystem().getDimension());
-    }
-
-    /**
-     * Tests WKT formatting.
-     */
-    @Test
-    public void testWKT() {
-        assertWktEquals(
-                "GEOGCS[“WGS 84”,\n" +
-                "  DATUM[“World Geodetic System 1984”,\n" +
-                "    SPHEROID[“WGS84”, 6378137.0, 298.257223563],\n" +
-                "    AUTHORITY[“EPSG”, “6326”]],\n" +
-                "  PRIMEM[“Greenwich”, 0.0, AUTHORITY[“EPSG”, “8901”]],\n" +
-                "  UNIT[“degree”, 0.017453292519943295],\n" +
-                "  AXIS[“Geodetic longitude”, EAST],\n" +
-                "  AXIS[“Geodetic latitude”, NORTH]]",
-                WGS84);
+        assertEquals("TIME",         1, TIME        .getCoordinateSystem().getDimension());
+        assertEquals("DEPTH",        1, DEPTH       .getCoordinateSystem().getDimension());
+        assertEquals("WGS84",        2, WGS84       .getCoordinateSystem().getDimension());
+        assertEquals("WGS84_φλ",     2, WGS84_φλ   .getCoordinateSystem().getDimension());
+        assertEquals("WGS84_3D",     3, WGS84_3D    .getCoordinateSystem().getDimension());
+        assertEquals("CARTESIAN_2D", 2, CARTESIAN_2D.getCoordinateSystem().getDimension());
+        assertEquals("CARTESIAN_3D", 3, CARTESIAN_3D.getCoordinateSystem().getDimension());
+        assertEquals("GEOCENTRIC",   3, GEOCENTRIC  .getCoordinateSystem().getDimension());
+        assertEquals("SPHERICAL",    3, SPHERICAL   .getCoordinateSystem().getDimension());
+        assertEquals("GEOID_4D",     4, GEOID_4D     .getCoordinateSystem().getDimension());
     }
 
     /**
@@ -91,5 +82,6 @@ public final strictfp class HardCodedCRS
     public void testSerialization() {
         assertSerializedEquals(WGS84);
         assertSerializedEquals(WGS84_3D);
+        assertSerializedEquals(GEOID_4D);
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/SubTypesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/SubTypesTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/SubTypesTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/SubTypesTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -25,7 +25,7 @@ import static org.junit.Assert.*;
 
 
 /**
- * Tests {@link SubTypes}
+ * Tests the {@link SubTypes} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -27,11 +27,12 @@ import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
 import static org.opengis.referencing.cs.CoordinateSystem.NAME_KEY;
+import static org.apache.sis.referencing.cs.CoordinateSystemsTest.STRICT;
 import static org.apache.sis.test.Assert.*;
 
 
 /**
- * Tests {@link AbstractCS}.
+ * Tests the {@link AbstractCS} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
@@ -90,11 +91,18 @@ public final strictfp class AbstractCSTe
          * Some expected axes, identical to the ones in HardCodedAxes except for name or units.
          */
         final DefaultCoordinateSystemAxis EASTING = new DefaultCoordinateSystemAxis(
-                singletonMap(NAME_KEY, Vocabulary.format(Vocabulary.Keys.Unnamed)), "E",
-                AxisDirection.EAST, SI.METRE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+                singletonMap(NAME_KEY, Vocabulary.format(Vocabulary.Keys.Unnamed)), "E", AxisDirection.EAST, SI.METRE);
         final DefaultCoordinateSystemAxis HEIGHT = new DefaultCoordinateSystemAxis(
-                singletonMap(NAME_KEY, "Height"), "h",
-            AxisDirection.UP, SI.METRE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+                singletonMap(NAME_KEY, "Height"), "h", AxisDirection.UP, SI.METRE);
+        /*
+         * Verifies the properties inferred by the constructor.
+         */
+        assertEquals("minimumValue", Double.NEGATIVE_INFINITY, EASTING.getMinimumValue(), STRICT);
+        assertEquals("maximumValue", Double.POSITIVE_INFINITY, EASTING.getMaximumValue(), STRICT);
+        assertNull  ("rangeMeaning", EASTING.getRangeMeaning());
+        assertEquals("minimumValue", Double.NEGATIVE_INFINITY, HEIGHT.getMinimumValue(), STRICT);
+        assertEquals("maximumValue", Double.POSITIVE_INFINITY, HEIGHT.getMaximumValue(), STRICT);
+        assertNull  ("rangeMeaning", HEIGHT.getRangeMeaning());
         /*
          * Test RIGHT_HANDED as a matter of principle before to test NORMALIZED.
          */

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -53,7 +53,7 @@ public final strictfp class CoordinateSy
     /**
      * Tolerance threshold for strict floating point comparisons.
      */
-    private static final double STRICT = 0;
+    static final double STRICT = 0;
 
     /**
      * Tests {@link CoordinateSystems#parseAxisDirection(String)}.

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -24,7 +24,7 @@ import static org.junit.Assert.*;
 
 
 /**
- * Tests {@link DefaultCompoundCS}.
+ * Tests the {@link DefaultCompoundCS} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -16,23 +16,27 @@
  */
 package org.apache.sis.referencing.cs;
 
+import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.RangeMeaning;
 import org.opengis.test.Validators;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.apache.sis.referencing.Assert.*;
+import static java.util.Collections.singletonMap;
+import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.referencing.cs.HardCodedAxes.*;
 import static org.apache.sis.referencing.IdentifiedObjects.getProperties;
+import static org.apache.sis.referencing.cs.CoordinateSystemsTest.STRICT;
 
 
 /**
- * Tests {@link DefaultCoordinateSystemAxis}.
+ * Tests the {@link DefaultCoordinateSystemAxis} class.
  *
  * @author  Martin Desruisseaux (IRD)
  * @since   0.4 (derived from geotk-2.2)
@@ -82,17 +86,36 @@ public final strictfp class DefaultCoord
      */
     @Test
     public void testWKT() {
-        assertWktEquals("AXIS[“x”, EAST]",                   X);
-        assertWktEquals("AXIS[“y”, NORTH]",                  Y);
-        assertWktEquals("AXIS[“z”, UP]",                     Z);
-        assertWktEquals("AXIS[“Longitude”, EAST]",           LONGITUDE_gon);
-        assertWktEquals("AXIS[“Latitude”, NORTH]",           LATITUDE_gon);
-        assertWktEquals("AXIS[“Altitude”, UP]",              ALTITUDE);
-        assertWktEquals("AXIS[“Time”, FUTURE]",              TIME);
-        assertWktEquals("AXIS[“Geodetic longitude”, EAST]",  GEODETIC_LONGITUDE);
-        assertWktEquals("AXIS[“Spherical longitude”, EAST]", SPHERICAL_LONGITUDE);
-        assertWktEquals("AXIS[“Geodetic latitude”, NORTH]",  GEODETIC_LATITUDE);
-        assertWktEquals("AXIS[“Spherical latitude”, NORTH]", SPHERICAL_LATITUDE);
+        assertWktEquals("Axis[“x”, east, LengthUnit[“metre”, 1]]",  X);
+        assertWktEquals("Axis[“y”, north, LengthUnit[“metre”, 1]]", Y);
+        assertWktEquals("Axis[“z”, up, LengthUnit[“metre”, 1]]",    Z);
+        assertWktEquals("Axis[“Longitude (λ)”, east, AngleUnit[“grade”, 0.015707963267948967]]",            LONGITUDE_gon);
+        assertWktEquals("Axis[“Latitude (φ)”, north, AngleUnit[“grade”, 0.015707963267948967]]",            LATITUDE_gon);
+        assertWktEquals("Axis[“Altitude (h)”, up, LengthUnit[“metre”, 1]]",                                 ALTITUDE);
+        assertWktEquals("Axis[“Time (t)”, future, TimeUnit[“day”, 86400]]",                                 TIME);
+        assertWktEquals("Axis[“Longitude (λ)”, east, AngleUnit[“degree”, 0.017453292519943295]]",           GEODETIC_LONGITUDE);
+        assertWktEquals("Axis[“Spherical longitude (Ω)”, east, AngleUnit[“degree”, 0.017453292519943295]]", SPHERICAL_LONGITUDE);
+        assertWktEquals("Axis[“Latitude (φ)”, north, AngleUnit[“degree”, 0.017453292519943295]]",           GEODETIC_LATITUDE);
+        assertWktEquals("Axis[“Spherical latitude (Θ)”, north, AngleUnit[“degree”, 0.017453292519943295]]", SPHERICAL_LATITUDE);
+
+        assertWktEquals(Convention.WKT1,     "AXIS[“x”, EAST]",  X);
+        assertWktEquals(Convention.WKT1,     "AXIS[“y”, NORTH]", Y);
+        assertWktEquals(Convention.WKT1,     "AXIS[“z”, UP]",    Z);
+        assertWktEquals(Convention.INTERNAL, "Axis[“Geodetic longitude (λ)”, east, Unit[“degree”, 0.017453292519943295]]",  GEODETIC_LONGITUDE);
+        assertWktEquals(Convention.INTERNAL, "Axis[“Spherical longitude (Ω)”, east, Unit[“degree”, 0.017453292519943295]]", SPHERICAL_LONGITUDE);
+        assertWktEquals(Convention.INTERNAL, "Axis[“Geodetic latitude (φ)”, north, Unit[“degree”, 0.017453292519943295]]",  GEODETIC_LATITUDE);
+        assertWktEquals(Convention.INTERNAL, "Axis[“Spherical latitude (Θ)”, north, Unit[“degree”, 0.017453292519943295]]", SPHERICAL_LATITUDE);
+    }
+
+    /**
+     * Tests the WKT of axis of the kind "South along 90°W".
+     */
+    @Test
+    @DependsOnMethod("testWKT")
+    public void testMeridianWKT() {
+        assertWktEquals("Axis[“South along 90°W (x)”, south, Meridian[-90.0, AngleUnit[“degree”, 0.017453292519943295]], LengthUnit[“metre”, 1]]",
+                new DefaultCoordinateSystemAxis(singletonMap(DefaultCoordinateSystemAxis.NAME_KEY, "South along 90°W"),
+                        "x", DirectionAlongMeridian.parse("South along 90°W").getDirection(), SI.METRE));
     }
 
     /**
@@ -120,10 +143,21 @@ public final strictfp class DefaultCoord
          * (GEODETIC_LONGITUDE, GEODETIC_LATITUDE) except for the name.
          */
         final DefaultCoordinateSystemAxis LONGITUDE = new DefaultCoordinateSystemAxis(getProperties(LONGITUDE_gon),
-                "λ", AxisDirection.EAST, NonSI.DEGREE_ANGLE, -180, 180, RangeMeaning.WRAPAROUND);
+                "λ", AxisDirection.EAST, NonSI.DEGREE_ANGLE);
         final DefaultCoordinateSystemAxis LATITUDE = new DefaultCoordinateSystemAxis(getProperties(LATITUDE_gon),
-                "φ", AxisDirection.NORTH, NonSI.DEGREE_ANGLE, -90, 90, RangeMeaning.EXACT);
-
+                "φ", AxisDirection.NORTH, NonSI.DEGREE_ANGLE);
+        /*
+         * Verifies the properties inferred by the constructor.
+         */
+        assertEquals("minimumValue", -180, LONGITUDE.getMinimumValue(), STRICT);
+        assertEquals("maximumValue", +180, LONGITUDE.getMaximumValue(), STRICT);
+        assertEquals("rangeMeaning", RangeMeaning.WRAPAROUND, LONGITUDE.getRangeMeaning());
+        assertEquals("minimumValue", -90, LATITUDE.getMinimumValue(), STRICT);
+        assertEquals("maximumValue", +90, LATITUDE.getMaximumValue(), STRICT);
+        assertEquals("rangeMeaning", RangeMeaning.EXACT, LATITUDE.getRangeMeaning());
+        /*
+         * Those axes shall be considered different.
+         */
         assertFalse("X",         X        .equals(GEOCENTRIC_X,        ComparisonMode.IGNORE_METADATA));
         assertFalse("Longitude", LONGITUDE.equals(GEODETIC_LONGITUDE,  ComparisonMode.STRICT));
         assertFalse("Longitude", LONGITUDE.equals(SPHERICAL_LONGITUDE, ComparisonMode.STRICT));

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -21,7 +21,7 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 
 
 /**
@@ -105,4 +105,13 @@ public final strictfp class DirectionAlo
         assertEquals( +1, m2.compareTo(m1));
         assertFalse (m1.equals(m2));
     }
+
+    /**
+     * Test Well Known Text formatting.
+     */
+    @Test
+    public void testWKT() {
+        assertWktEquals("Meridian[-90.0, AngleUnit[“degree”, 0.017453292519943295]]",
+                DirectionAlongMeridian.parse("South along 90°W"));
+    }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -16,14 +16,14 @@
  */
 package org.apache.sis.referencing.cs;
 
+import java.util.Map;
+import java.util.HashMap;
 import javax.measure.unit.Unit;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.RangeMeaning;
 
-import static java.util.Collections.singletonMap;
-
 
 /**
  * Collection of axes for testing purpose.
@@ -43,7 +43,6 @@ public final strictfp class HardCodedAxe
      * <p>This axis is usually part of a {@link #GEODETIC_LONGITUDE}, {@link #GEODETIC_LATITUDE},
      * {@link #ELLIPSOIDAL_HEIGHT} set.</p>
      *
-     * @see #LONGITUDE
      * @see #SPHERICAL_LONGITUDE
      * @see #GEODETIC_LATITUDE
      */
@@ -59,7 +58,6 @@ public final strictfp class HardCodedAxe
      * <p>This axis is usually part of a {@link #GEODETIC_LONGITUDE}, {@link #GEODETIC_LATITUDE},
      * {@link #ELLIPSOIDAL_HEIGHT} set.</p>
      *
-     * @see #LATITUDE
      * @see #SPHERICAL_LATITUDE
      * @see #GEODETIC_LONGITUDE
      */
@@ -80,7 +78,6 @@ public final strictfp class HardCodedAxe
      *
      * @see #GEODETIC_LONGITUDE
      * @see #SPHERICAL_LONGITUDE
-     * @see #LATITUDE
      */
     public static final DefaultCoordinateSystemAxis LONGITUDE_gon = create("Longitude", "λ",
             AxisDirection.EAST, NonSI.GRADE, -200, 200, RangeMeaning.WRAPAROUND);
@@ -93,7 +90,6 @@ public final strictfp class HardCodedAxe
      *
      * @see #GEODETIC_LATITUDE
      * @see #SPHERICAL_LATITUDE
-     * @see #LONGITUDE
      */
     public static final DefaultCoordinateSystemAxis LATITUDE_gon = create("Latitude", "φ",
             AxisDirection.NORTH, NonSI.GRADE, -100, 100, RangeMeaning.EXACT);
@@ -139,7 +135,8 @@ public final strictfp class HardCodedAxe
      * Increasing ordinates values go {@linkplain AxisDirection#UP up} and units are {@linkplain SI#METRE metres}.
      * The abbreviation is lower case "<var>h</var>".
      *
-     * <p>This axis is usually part of a {@link #LONGITUDE}, {@link #LATITUDE}, {@link #ALTITUDE} set.</p>
+     * <p>This axis is usually part of a {@link #GEODETIC_LONGITUDE}, {@link #GEODETIC_LATITUDE},
+     * {@link #ALTITUDE} tuple.</p>
      *
      * @see #ELLIPSOIDAL_HEIGHT
      * @see #GEOCENTRIC_RADIUS
@@ -189,7 +186,6 @@ public final strictfp class HardCodedAxe
      * <p>This axis is usually part of a {@link #SPHERICAL_LONGITUDE}, {@link #SPHERICAL_LATITUDE},
      * {@link #GEOCENTRIC_RADIUS} set.</p>
      *
-     * @see #LONGITUDE
      * @see #GEODETIC_LONGITUDE
      * @see #SPHERICAL_LATITUDE
      */
@@ -206,7 +202,6 @@ public final strictfp class HardCodedAxe
      * <p>This axis is usually part of a {@link #SPHERICAL_LONGITUDE}, {@link #SPHERICAL_LATITUDE},
      * {@link #GEOCENTRIC_RADIUS} set.</p>
      *
-     * @see #LATITUDE
      * @see #GEODETIC_LATITUDE
      * @see #SPHERICAL_LONGITUDE
      */
@@ -419,8 +414,12 @@ public final strictfp class HardCodedAxe
             final AxisDirection direction, final Unit<?> unit, final double minimum, final double maximum,
             final RangeMeaning meaning)
     {
-        return new DefaultCoordinateSystemAxis(singletonMap(DefaultCoordinateSystemAxis.NAME_KEY, name),
-                abbreviation, direction, unit, minimum, maximum, meaning);
+        final Map<String,Object> properties = new HashMap<String,Object>(8);
+        properties.put(DefaultCoordinateSystemAxis.NAME_KEY, name);
+        properties.put(DefaultCoordinateSystemAxis.MINIMUM_VALUE_KEY, minimum);
+        properties.put(DefaultCoordinateSystemAxis.MAXIMUM_VALUE_KEY, maximum);
+        properties.put(DefaultCoordinateSystemAxis.RANGE_MEANING_KEY, meaning);
+        return new DefaultCoordinateSystemAxis(properties, abbreviation, direction, unit);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -83,15 +83,17 @@ public final strictfp class HardCodedCS 
 
     /**
      * A three-dimensional spherical CS with
-     * <var>{@linkplain HardCodedAxes#SPHERICAL_LONGITUDE longitude}</var>,
      * <var>{@linkplain HardCodedAxes#SPHERICAL_LATITUDE latitude}</var>,
+     * <var>{@linkplain HardCodedAxes#SPHERICAL_LONGITUDE longitude}</var>,
      * <var>{@linkplain HardCodedAxes#GEOCENTRIC_RADIUS radius}</var>
      * axes.
+     * This axis order is the one of EPSG:6404.
+     * Note that this is not a right-handed system.
      */
     public static final DefaultSphericalCS SPHERICAL = new DefaultSphericalCS(
             singletonMap(NAME_KEY, "Spherical"),
-            HardCodedAxes.SPHERICAL_LONGITUDE,
             HardCodedAxes.SPHERICAL_LATITUDE,
+            HardCodedAxes.SPHERICAL_LONGITUDE,
             HardCodedAxes.GEOCENTRIC_RADIUS);
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCSTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCSTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -91,7 +91,6 @@ public final strictfp class HardCodedCST
     public void testNormalized() {
         AbstractCS cs;
         cs = GRID;               assertSame(cs, cs.forConvention(AxesConvention.NORMALIZED));
-        cs = SPHERICAL;          assertSame(cs, cs.forConvention(AxesConvention.NORMALIZED));
         cs = GEOCENTRIC;         assertSame(cs, cs.forConvention(AxesConvention.NORMALIZED));
         cs = CARTESIAN_2D;       assertSame(cs, cs.forConvention(AxesConvention.NORMALIZED));
         cs = CARTESIAN_3D;       assertSame(cs, cs.forConvention(AxesConvention.NORMALIZED));

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/NormalizerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/NormalizerTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/NormalizerTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/NormalizerTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -28,7 +28,7 @@ import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
 import static org.opengis.referencing.cs.CoordinateSystem.NAME_KEY;
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.ReferencingAssert.*;
 
 
 /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -34,7 +34,7 @@ import static org.apache.sis.test.mock.G
 
 
 /**
- * Tests {@link BursaWolfParameters}.
+ * Tests the {@link BursaWolfParameters} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4 (derived from geotk-2.2)
@@ -196,7 +196,7 @@ public final strictfp class BursaWolfPar
     @Test
     public void testToString() {
         final BursaWolfParameters bursaWolf = createED87_to_WGS84();
-        assertEquals("TOWGS84[-82.981, -99.719, -110.709, -0.5076, 0.1503, 0.3898, -0.3143]", bursaWolf.toString());
+        assertEquals("ToWGS84[-82.981, -99.719, -110.709, -0.5076, 0.1503, 0.3898, -0.3143]", bursaWolf.toString());
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -30,7 +30,7 @@ import org.apache.sis.test.DependsOnMeth
 import org.junit.Test;
 
 import static java.lang.StrictMath.*;
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 
 
 /**
@@ -166,7 +166,7 @@ public final strictfp class DefaultEllip
     @Test
     public void testToWKT() {
         final DefaultEllipsoid e = new DefaultEllipsoid(GeodeticDatumMock.WGS84.getEllipsoid());
-        assertWktEquals("SPHEROID[“WGS84”, 6378137.0, 298.257223563]", e);
+        assertWktEquals("Ellipsoid[“WGS84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]]", e);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -27,14 +27,16 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.test.Validators;
 import org.apache.sis.xml.Namespaces;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.metadata.iso.extent.DefaultExtent;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestStep;
 import org.junit.Test;
 
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.test.mock.GeodeticDatumMock.*;
 import static org.apache.sis.referencing.GeodeticObjectVerifier.*;
 
@@ -176,14 +178,14 @@ public final strictfp class DefaultGeode
     }
 
     /**
-     * Tests {@link DefaultEllipsoid#toWKT()}.
+     * Tests {@link DefaultGeodeticDatum#toWKT()}.
      */
     @Test
     public void testToWKT() {
         final DefaultGeodeticDatum datum = new DefaultGeodeticDatum(WGS84);
         assertWktEquals(
-                "DATUM[“WGS84”,\n" +
-                "  SPHEROID[“WGS84”, 6378137.0, 298.257223563]]",
+                "Datum[“WGS84”,\n" +
+                "  Ellipsoid[“WGS84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]]]",
                 datum);
     }
 
@@ -221,10 +223,14 @@ public final strictfp class DefaultGeode
     /**
      * Tests unmarshalling.
      *
+     * <p>This method is part of a chain.
+     * The next method is {@link #testUnmarshalledWKT()}.</p>
+     *
+     * @return The unmarshalled datum.
      * @throws JAXBException If an error occurred during unmarshalling.
      */
-    @Test
-    public void testUnmarshalling() throws JAXBException {
+    @TestStep
+    public DefaultGeodeticDatum testUnmarshalling() throws JAXBException {
         final DefaultGeodeticDatum datum = unmarshalFile(DefaultGeodeticDatum.class, XML_FILE);
         assertIsWGS84(datum, true);
         /*
@@ -241,5 +247,40 @@ public final strictfp class DefaultGeode
                 datum.getRealizationEpoch());
         assertEquals("remarks", "Defining parameters cited in EPSG database.",
                 datum.getEllipsoid().getRemarks().toString());
+        return datum;
+    }
+
+    /**
+     * Tests the WKT formatting of the datum created by {@link #testUnmarshalling()}.
+     *
+     * @throws JAXBException If an error occurred during unmarshalling.
+     */
+    @Test
+    @DependsOnMethod("testToWKT")
+    public void testUnmarshalledWKT() throws JAXBException {
+        final DefaultGeodeticDatum datum = testUnmarshalling();
+        assertWktEquals(Convention.WKT1,
+                "DATUM[“World Geodetic System 1984”,\n" +
+                "  SPHEROID[“WGS 84”, 6378137.0, 298.257223563],\n" +
+                "  AUTHORITY[“EPSG”, “6326”]]",
+                datum);
+
+        assertWktEquals(Convention.WKT2,
+                "Datum[“World Geodetic System 1984”,\n" +
+                "  Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]],\n" +
+                "  Id[“EPSG”, 6326, Citation[“OGP”], URI[“urn:ogc:def:datum:EPSG::6326”]]]",
+                datum);
+
+        assertWktEquals(Convention.INTERNAL,
+                "Datum[“World Geodetic System 1984”,\n" +
+                "  Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, Id[“EPSG”, 7030, Citation[“OGP”]],\n" +
+                "    Remarks[“Defining parameters cited in EPSG database.”]],\n" +
+                "  Anchor[“Station coordinates changed by a few centimetres in 1994, 1997, 2002 and 2012.”],\n" +
+                "  Scope[“Satellite navigation.”],\n" +
+                "  Area[“World.”],\n" +
+                "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
+                "  Id[“EPSG”, 6326, Citation[“OGP”]],\n" +
+                "  Remarks[“No distinction between the original and subsequent WGS 84 frames.”]]",
+                datum);
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -25,12 +25,13 @@ import org.apache.sis.xml.Namespaces;
 import org.apache.sis.xml.MarshallerPool;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.referencing.GeodeticObjectVerifier.*;
 import static org.apache.sis.test.mock.PrimeMeridianMock.GREENWICH;
 
@@ -57,7 +58,7 @@ public final strictfp class DefaultPrime
     public void testToWKT() {
         final DefaultPrimeMeridian pm = new DefaultPrimeMeridian(GREENWICH);
         assertIsGreenwich(pm);
-        assertWktEquals("PRIMEM[“Greenwich”, 0.0]", pm);
+        assertWktEquals("PrimeMeridian[“Greenwich”, 0.0, AngleUnit[“degree”, 0.017453292519943295]]", pm);
     }
 
     /**
@@ -146,10 +147,16 @@ public final strictfp class DefaultPrime
         assertEquals("greenwichLongitude", 2.33722917, pm.getGreenwichLongitude(NonSI.DEGREE_ANGLE), 1E-12);
         assertEquals("Equivalent to 2°20′14.025″.", pm.getRemarks().toString());
         assertNull("name.codeSpace", pm.getName().getCodeSpace());
-        assertWktEquals("PRIMEM[“Paris”, 2.33722917, AUTHORITY[“EPSG”, “8903”]]", pm);
+        assertWktEquals(Convention.WKT1,
+                "PRIMEM[“Paris”, 2.33722917, AUTHORITY[“EPSG”, “8903”]]", pm);
+        assertWktEquals(Convention.WKT2,
+                "PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“OGP”], URI[“urn:ogc:def:meridian:EPSG::8903”]]]", pm);
+        assertWktEquals(Convention.INTERNAL,
+                "PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“OGP”]],\n" +
+                "  Remarks[“Equivalent to 2°20′14.025″.”]]", pm);
         assertXmlEquals(
                 "<gml:PrimeMeridian xmlns:gml=\"" + Namespaces.GML + "\">\n" +
-                "  <gml:identifier codeSpace=\"OGP\">urn:ogc:def:meridian:EPSG::8903</gml:identifier>" +
+                "  <gml:identifier codeSpace=\"OGP\">urn:ogc:def:meridian:EPSG::8903</gml:identifier>\n" +
                 "  <gml:name>Paris</gml:name>\n" +
                 "  <gml:remarks>Equivalent to 2°20′14.025″.</gml:remarks>\n" +
                 "  <gml:greenwichLongitude uom=\"urn:ogc:def:uom:EPSG::9105\">2.5969213</gml:greenwichLongitude>\n" +

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -25,7 +25,7 @@ import org.apache.sis.metadata.iso.citat
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.ReferencingAssert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
 

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -23,6 +23,7 @@ import javax.xml.bind.JAXBException;
 import org.opengis.referencing.datum.VerticalDatumType;
 import org.apache.sis.internal.referencing.VerticalDatumTypes;
 import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.util.Version;
 import org.apache.sis.xml.XML;
 import org.apache.sis.xml.MarshallerPool;
@@ -31,7 +32,7 @@ import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
-import static org.apache.sis.referencing.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.referencing.GeodeticObjectVerifier.*;
 
 
@@ -89,10 +90,12 @@ public final strictfp class DefaultVerti
     public void testToWKT() {
         DefaultVerticalDatum datum;
         datum = new DefaultVerticalDatum(singletonMap(DefaultVerticalDatum.NAME_KEY, "Geoidal"), VerticalDatumType.GEOIDAL);
-        assertWktEquals("VERT_DATUM[“Geoidal”, 2005]", datum);
+        assertWktEquals(Convention.WKT1, "VERT_DATUM[“Geoidal”, 2005]", datum);
+        assertWktEquals(Convention.WKT2, "VerticalDatum[“Geoidal”]", datum);
 
         datum = new DefaultVerticalDatum(singletonMap(DefaultVerticalDatum.NAME_KEY, "Ellipsoidal"), VerticalDatumTypes.ELLIPSOIDAL);
-        assertWktEquals("VERT_DATUM[“Ellipsoidal”, 2002]", datum);
+        assertWktEquals(Convention.WKT1, "VERT_DATUM[“Ellipsoidal”, 2002]", datum);
+        assertWktEquals(Convention.WKT2, "VerticalDatum[“Ellipsoidal”]", datum);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -33,7 +33,7 @@ import static org.apache.sis.internal.re
 
 
 /**
- * Tests {@link TimeDependentBWP}.
+ * Tests the {@link TimeDependentBWP} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -25,7 +25,7 @@ import static java.lang.StrictMath.*;
 
 
 /**
- * Tests {@link AffineTransforms2D} static methods.
+ * Tests the {@link AffineTransforms2D} static methods.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4 (derived from geotk-2.2)

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -44,16 +44,14 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.referencing.FormulasTest.class,
     org.apache.sis.internal.referencing.VerticalDatumTypesTest.class,
     org.apache.sis.internal.referencing.AxisDirectionsTest.class,
-    org.apache.sis.internal.referencing.ReferencingUtilitiesTest.class,
-    org.apache.sis.io.wkt.ConventionTest.class,
-    org.apache.sis.io.wkt.SymbolsTest.class,
-    org.apache.sis.io.wkt.FormatterTest.class,
     org.apache.sis.internal.jaxb.referencing.CodeTest.class,
     org.apache.sis.internal.jaxb.referencing.SecondDefiningParameterTest.class,
     org.apache.sis.referencing.IdentifiedObjectsTest.class,
     org.apache.sis.referencing.NamedIdentifierTest.class,
     org.apache.sis.referencing.AbstractIdentifiedObjectTest.class,
     org.apache.sis.referencing.AbstractReferenceSystemTest.class,
+    org.apache.sis.parameter.DefaultParameterDescriptorTest.class,
+    org.apache.sis.parameter.DefaultParameterValueTest.class,
     org.apache.sis.referencing.datum.BursaWolfParametersTest.class,
     org.apache.sis.referencing.datum.TimeDependentBWPTest.class,
     org.apache.sis.referencing.datum.DefaultEllipsoidTest.class,
@@ -67,12 +65,15 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.cs.AbstractCSTest.class,
     org.apache.sis.referencing.cs.DefaultCartesianCSTest.class,
     org.apache.sis.referencing.cs.DefaultEllipsoidalCSTest.class,
+    org.apache.sis.referencing.cs.DefaultSphericalCSTest.class,
     org.apache.sis.referencing.cs.DefaultCompoundCSTest.class,
     org.apache.sis.referencing.cs.CoordinateSystemsTest.class,
     org.apache.sis.referencing.cs.HardCodedCSTest.class,
     org.apache.sis.referencing.crs.AbstractCRSTest.class,
     org.apache.sis.referencing.crs.DefaultGeodeticCRSTest.class,
+    org.apache.sis.referencing.crs.DefaultGeocentricCRSTest.class,
     org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class,
+    org.apache.sis.referencing.crs.DefaultVerticalCRSTest.class,
     org.apache.sis.referencing.crs.SubTypesTest.class,
     org.apache.sis.referencing.crs.DefaultCompoundCRSTest.class,
     org.apache.sis.referencing.crs.HardCodedCRSTest.class,

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -17,7 +17,6 @@
 package org.apache.sis.internal.converter;
 
 import java.io.Serializable;
-import java.io.InvalidObjectException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.ObjectConverter;
@@ -78,7 +77,7 @@ final class Column extends TableColumn<C
     /**
      * Resources to the singleton instance on deserialization.
      */
-    private Object readResolve() throws InvalidObjectException {
+    private Object readResolve() {
         return target ? TARGET : SOURCE;
     }
 

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -18,7 +18,6 @@ package org.apache.sis.internal.converte
 
 import java.util.Set;
 import java.util.EnumSet;
-import java.io.ObjectStreamException;
 import org.apache.sis.math.FunctionProperty;
 import org.apache.sis.util.ObjectConverter;
 import org.apache.sis.util.resources.Errors;
@@ -144,7 +143,7 @@ abstract class SystemConverter<S,T> exte
      * Returns the singleton instance on deserialization, if any. If no instance already exist
      * in the virtual machine, we do not cache the instance (for now) for security reasons.
      */
-    protected final Object readResolve() throws ObjectStreamException {
+    protected final Object readResolve() {
         return unique();
     }
 

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -19,10 +19,10 @@ package org.apache.sis.internal.jaxb;
 import java.util.Iterator;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Locale;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
 import java.io.Serializable;
-import java.io.ObjectStreamException;
 import java.lang.reflect.Field;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
@@ -273,7 +273,7 @@ public final class NonMarshalledAuthorit
      * We need to use Java reflection because the {@code sis-metadata} module may not be in the
      * classpath.
      */
-    private static IdentifierSpace<?> getCitation(final String name) throws ObjectStreamException {
+    private static IdentifierSpace<?> getCitation(final String name) {
         try {
             final Field field = Class.forName("org.apache.sis.metadata.iso.citation.DefaultCitation").getDeclaredField(name);
             field.setAccessible(true);
@@ -281,7 +281,7 @@ public final class NonMarshalledAuthorit
         } catch (Exception e) {
             if (!warningLogged) {
                 warningLogged = true;
-                final LogRecord record = Errors.getResources(null).getLogRecord(Level.WARNING,
+                final LogRecord record = Errors.getResources((Locale) null).getLogRecord(Level.WARNING,
                         Errors.Keys.MissingRequiredModule_1, "sis-metadata");
                 /*
                  * Log directly the the logger rather than invoking the Context.warningOccured(…) method because
@@ -298,7 +298,7 @@ public final class NonMarshalledAuthorit
      * Invoked at deserialization time in order to replace the deserialized instance
      * by the appropriate instance defined in the {@link IdentifierSpace} interface.
      */
-    private Object readResolve() throws ObjectStreamException {
+    private Object readResolve() {
         int code = 0;
         while (true) {
             final IdentifierSpace<?> candidate;

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlValu
 import javax.xml.bind.annotation.XmlAttribute;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.Schemas;
+import org.apache.sis.internal.util.DefinitionURI;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.measure.Units;
 
@@ -142,7 +143,7 @@ public final class Measure {
         if (!asXPointer) {
             final Integer code = Units.getEpsgCode(unit, inAxis);
             if (code != null) {
-                return "urn:ogc:def:uom:EPSG::" + code;
+                return DefinitionURI.PREFIX + ":uom:EPSG::" + code;
             }
         }
         if (unit == null || unit.equals(Unit.ONE)) {

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -206,7 +206,7 @@ public class SimpleIdentifiedObject impl
     }
 
     /**
-     * Returns a pseudo-WKT representation.
+     * Returns a pseudo-WKT representation for debugging purpose.
      */
     @Override
     public String toString() {
@@ -222,32 +222,13 @@ public class SimpleIdentifiedObject impl
             codespace = null;
             authority = null;
         }
-        return toString("OBJECT", authority, codespace, code, false);
-    }
-
-    /**
-     * Returns a pseudo-WKT representation.
-     *
-     * @param  type       The WKT heading text.
-     * @param  authority  The authority to write in the {@code "AUTHORITY"} element.
-     * @param  codespace  Usually an abbreviation of the authority name.
-     * @param  code       The code to write in the {@code "AUTHORITY"} element, or {@code null} if none.
-     * @param  deprecated {@code true} if the object to format is deprecated.
-     * @return The pseudo-WKT.
-     */
-    public static String toString(final String type, final Citation authority,
-            final String codespace, final String code, final boolean deprecated)
-    {
-        final StringBuilder buffer = new StringBuilder(type).append("[\"");
+        final StringBuilder buffer = new StringBuilder("OBJECT[\"");
         if (codespace != null) {
             buffer.append(codespace).append(DefaultNameSpace.DEFAULT_SEPARATOR);
         }
         buffer.append(code).append('"');
         if (authority != null) {
-            buffer.append(", AUTHORITY[\"").append(Citations.getIdentifier(authority)).append("\"]");
-        }
-        if (deprecated) {
-            buffer.append(", DEPRECATED");
+            buffer.append(", ID[\"").append(Citations.getIdentifier(authority)).append("\"]");
         }
         return buffer.append(']').toString();
     }

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -207,9 +207,9 @@ public class SimpleReferenceIdentifier i
      * @return Pseudo Well Known Text for this identifier.
      */
     public String toWKT() {
-        final StringBuilder buffer = new StringBuilder(40).append("AUTHORITY[");
+        final StringBuilder buffer = new StringBuilder(40).append("ID[");
         append(buffer, Citations.getIdentifier(authority)); // Do not invoke getCodeSpace().
-        append(buffer.append(','), code);
+        append(buffer.append(", "), code);
         return buffer.append(']').toString();
     }
 

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -101,6 +101,11 @@ import static org.apache.sis.internal.ut
  */
 public final class DefinitionURI {
     /**
+     * The {@value} prefix used in all URI supported by this class.
+     */
+    public static final String PREFIX = "urn:ogc:def";
+
+    /**
      * The URN separator.
      */
     public static final char SEPARATOR = ':';
@@ -442,7 +447,7 @@ public final class DefinitionURI {
      * @return An identifier using the URN syntax, or {@code null} if an information is missing.
      */
     public static String format(final String type, final ReferenceIdentifier identifier) {
-        final StringBuilder buffer = new StringBuilder("urn:ogc:def");
+        final StringBuilder buffer = new StringBuilder(PREFIX);
         for (int p=0; p<4; p++) {
             final String component;
             switch (p) {
@@ -469,7 +474,7 @@ public final class DefinitionURI {
      * @return A URN representation of this URI.
      */
     public String toURN() {
-        final StringBuilder buffer = new StringBuilder("urn:ogc:def");
+        final StringBuilder buffer = new StringBuilder(PREFIX);
         int n = 4;
         if (parameters != null) {
             n += parameters.length;

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.internal.util;
 
+import java.util.Map;
+import java.util.HashMap;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.ComparisonMode;
 
@@ -33,6 +35,35 @@ import static java.lang.Math.abs;
  */
 public final class Numerics extends Static {
     /**
+     * Some frequently used {@link Double} values. As of Java 7, those values do not
+     * seem to be cached by {@link Double#valueOf(double)} like JDK does for integers.
+     */
+    private static final Map<Object,Object> CACHE = new HashMap<Object,Object>(32);
+    static {
+        cache(   0);
+        cache(   1);
+        cache(  10);
+        cache(  60);
+        cache(  90);
+        cache( 100);
+        cache( 180);
+        cache( 180*60*60);
+        cache( 360);
+        cache(1000);
+        cache(Double.POSITIVE_INFINITY);
+        cache(Double.NaN);
+    }
+
+    /**
+     * Helper method for the construction of the {@link #CACHE} map.
+     */
+    private static void cache(final double value) {
+        Double key;
+        key = Double.valueOf( value); CACHE.put(key, key);
+        key = Double.valueOf(-value); CACHE.put(key, key);
+    }
+
+    /**
      * Relative difference tolerated when comparing floating point numbers using
      * {@link org.apache.sis.util.ComparisonMode#APPROXIMATIVE}.
      *
@@ -95,6 +126,32 @@ public final class Numerics extends Stat
     }
 
     /**
+     * If the given value is presents in the cache, returns the cached value.
+     * Otherwise returns the given value as-is.
+     *
+     * @param  <T> The type of the given value.
+     * @param  value The given value for which to get a cached instance, if one exists.
+     * @return An object equals to the given value (may be the given instance itself).
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T cached(final T value) {
+        final Object candidate = CACHE.get(value);
+        return (candidate != null) ? (T) candidate : value;
+    }
+
+    /**
+     * Wraps the given {@code value} in a {@link Double} wrapper, using one of the cached instance if possible.
+     *
+     * @param  value The value to get as a {@code Double}.
+     * @return The given value as a {@code Double}.
+     */
+    public static Double valueOf(final double value) {
+        final Double n = Double.valueOf(value);
+        final Object candidate = CACHE.get(value);
+        return (candidate != null) ? (Double) candidate : n;
+    }
+
+    /**
      * Returns a copy of the given array where each value has been casted to the {@code float} type.
      *
      * @param  data The array to copy, or {@code null}.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -32,7 +32,6 @@ import org.apache.sis.util.CharSequences
  * @module
  */
 public final class Utilities extends Static {
-
     /**
      * Do not allow instantiation of this class.
      */

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -19,7 +19,6 @@ package org.apache.sis.io;
 import java.text.Format;
 import java.text.FieldPosition;
 import java.text.ParsePosition;
-import java.io.InvalidObjectException;
 import org.apache.sis.util.Classes;
 
 
@@ -72,7 +71,7 @@ final class ClassFormat extends Format {
     /**
      * Resolves to the singleton instance on deserialization.
      */
-    private Object readResolve() throws InvalidObjectException {
+    private Object readResolve() {
         return INSTANCE;
     }
 }

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -102,14 +102,13 @@ public abstract class CompoundFormat<T> 
     /**
      * Creates a new format for the given locale. The given locale can be {@code null} or
      * {@link Locale#ROOT} if this format shall parse and format "unlocalized" strings.
-     * See {@link #getLocale()} for more information on {@code ROOT} locale.
+     * See {@link #getLocale()} for more information about the {@code ROOT} locale.
      *
-     * @param locale   The locale to use for numbers, dates and angles formatting,
-     *                 or {@code null} for the {@linkplain Locale#ROOT root locale}.
+     * @param locale   The locale for the new {@code Format}, or {@code null} for {@code Locale.ROOT}.
      * @param timezone The timezone, or {@code null} for UTC.
      */
     protected CompoundFormat(final Locale locale, final TimeZone timezone) {
-        this.locale   = (locale   != null) ? locale   : Locale.ROOT;
+        this.locale   = (locale != null) ? locale : Locale.ROOT;
         this.timezone = timezone;
     }
 
@@ -119,11 +118,11 @@ public abstract class CompoundFormat<T> 
      * is implementation-dependent, but some typical examples are:
      *
      * <ul>
-     *   <li>Format {@link Number}s using {@code toString()} instead than {@code NumberFormat}.</li>
-     *   <li>Format {@link Date}s using the ISO pattern instead than the English one.</li>
+     *   <li>Format {@link Number} instances using {@code toString()} instead than {@code NumberFormat}.</li>
+     *   <li>Format {@link Date} instances using the ISO pattern instead than the English one.</li>
      * </ul>
      *
-     * @return The locale used for this format, or {@link Locale#ROOT} for unlocalized format.
+     * @return The locale of this {@code Format}, or {@code Locale.ROOT} for unlocalized format.
      */
     @Override
     public Locale getLocale() {
@@ -144,6 +143,13 @@ public abstract class CompoundFormat<T> 
      * The returned type may be a subclass of {@code <T>} if the format is configured in a way
      * that restrict the kind value to be parsed.
      *
+     * {@example
+     *   <ul>
+     *     <li><code>StatisticsFormat</code> unconditionally returns <code>Statistics.class</code>.</li>
+     *     <li><code>TreeTableFormat</code> unconditionally returns <code>TreeTable.class</code>.</li>
+     *   </ul>
+     * }
+     *
      * @return The base type of values parsed and formatted by this {@code Format} instance.
      */
     public abstract Class<? extends T> getValueType();

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -20,7 +20,6 @@ import java.text.Format;
 import java.text.FieldPosition;
 import java.text.ParsePosition;
 import java.text.ParseException;
-import java.io.InvalidObjectException;
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.internal.util.LocalizedParseException;
@@ -140,7 +139,7 @@ final class DefaultFormat extends Format
     /**
      * Resolves to the singleton instance on deserialization.
      */
-    private Object readResolve() throws InvalidObjectException {
+    private Object readResolve() {
         final Format format = getInstance(type);
         return (format != null) ? format : this;
     }

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -18,6 +18,7 @@ package org.apache.sis.measure;
 
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.util.Numerics;
 
 
 /**
@@ -206,7 +207,7 @@ public class NumberRange<E extends Numbe
         if (Double.isNaN(value)) {
             throw new IllegalArgumentException(Errors.format(Errors.Keys.NotANumber_1, name));
         }
-        return (value != infinity) ? Double.valueOf(value) : null;
+        return (value != infinity) ? Numerics.valueOf(value) : null;
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -21,7 +21,6 @@ import java.util.HashMap;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.io.Serializable;
-import java.io.ObjectStreamException;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.logging.Logging;
 
@@ -272,7 +271,7 @@ public class OptionKey<T> implements Ser
      * Resolves this option key on deserialization. This method is invoked
      * only for instance of the exact {@code OptionKey} class, not subclasses.
      */
-    private Object readResolve() throws ObjectStreamException {
+    private Object readResolve() {
         try {
             return OptionKey.class.getField(name).get(null);
         } catch (Exception e) { // (ReflectiveOperationException) on JDK7 branch.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -108,30 +108,40 @@ public interface LenientComparable {
     /**
      * Compares this object with the given object for equality.
      * The strictness level is controlled by the second argument,
-     * for stricter to more permissive values:
+     * from stricter to more permissive values:
      *
-     * <ol>
-     *   <li>{@link ComparisonMode#STRICT STRICT} –
-     *        All attributes of the compared objects shall be strictly equal.</li>
-     *   <li>{@link ComparisonMode#BY_CONTRACT BY_CONTRACT} –
-     *       Only the attributes published in the interface contract need to be compared.</li>
-     *   <li>{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} –
-     *       Only the attributes relevant to the object functionality are compared.</li>
-     *   <li>{@link ComparisonMode#APPROXIMATIVE APPROXIMATIVE} –
-     *       Only the attributes relevant to the object functionality are compared,
-     *       with some tolerance threshold on numerical values.</li>
-     *   <li>{@link ComparisonMode#DEBUG DEBUG} –
-     *        special mode for figuring out why two objects expected to be equal are not.</li>
-     * </ol>
-     *
-     * Note that {@code this.equals(other, mode)} is <strong>not</strong> guaranteed to be equal
-     * to {@code other.equals(this, mode)}.  In particular, the {@code BY_CONTRACT} level and all
-     * levels below it will typically compare only the properties known to {@code this} instance,
-     * ignoring any properties that may be known only by the {@code other} instance.
+     * <p><table class="compact" >
+     *   <tr><td>{@link ComparisonMode#STRICT STRICT}:</td>
+     *        <td>All attributes of the compared objects shall be strictly equal.</td></tr>
+     *   <tr><td>{@link ComparisonMode#BY_CONTRACT BY_CONTRACT}:</td>
+     *       <td>Only the attributes published in the interface contract need to be compared.</td></tr>
+     *   <tr><td>{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA}:</td>
+     *       <td>Only the attributes relevant to the object functionality are compared.</td></tr>
+     *   <tr><td>{@link ComparisonMode#APPROXIMATIVE APPROXIMATIVE}:</td>
+     *       <td>Only the attributes relevant to the object functionality are compared,
+     *           with some tolerance threshold on numerical values.</td></tr>
+     *   <tr><td>{@link ComparisonMode#DEBUG DEBUG}:</td>
+     *        <td>Special mode for figuring out why two objects expected to be equal are not.</td></tr>
+     * </table></p>
+     *
+     * {@section Conformance to the <code>equals(Object)</code> method contract}
+     * {@link ComparisonMode#STRICT} is the only mode compliant with the {@link Object#equals(Object)} contract.
+     * For all other modes <var>m</var>, the comparison is not guaranteed to be <cite>symmetric</cite> neither
+     * <cite>transitive</cite>:
+     *
+     * <ul>
+     *   <li>{@code x.equals(y,m)} is <strong>not</strong> guaranteed to be equal to {@code y.equals(x,m)}.
+     *       In particular, the {@code BY_CONTRACT} mode and all modes below it will typically compare only the
+     *       properties known to {@code this} instance, ignoring any properties that may be known only by the other
+     *       instance.</li>
+     *   <li>{@code x.equals(y,m)} and {@code y.equals(z,m)} does <strong>not</strong> implies
+     *       {@code x.equals(z,m)}. In particular, the use of a comparison threshold for the
+     *       {@code APPROXIMATIVE} mode is incompatible with the transitivity contract.</li>
+     * </ul>
      *
      * @param  other The object to compare to {@code this}.
      * @param  mode The strictness level of the comparison.
-     * @return {@code true} if both objects are equal.
+     * @return {@code true} if both objects are equal according the given comparison mode.
      *
      * @see Utilities#deepEquals(Object, Object, ComparisonMode)
      */



Mime
View raw message