sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1679002 - in /sis/branches/JDK8/core: sis-referencing/src/main/java/org/apache/sis/referencing/operation/ sis-referencing/src/test/java/org/apache/sis/referencing/operation/ sis-referencing/src/test/java/org/apache/sis/test/suite/ sis-util...
Date Tue, 12 May 2015 16:59:44 GMT
Author: desruisseaux
Date: Tue May 12 16:59:43 2015
New Revision: 1679002

URL: http://svn.apache.org/r1679002
Log:
Referencing: more consolidation and tests.

Added:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -268,9 +268,10 @@ class AbstractSingleOperation extends Ab
     }
 
     /**
-     * Returns the operation method.
+     * Returns a description of the operation method, including a list of expected parameter
names.
+     * The returned object does not contains any parameter value.
      *
-     * @return The operation method.
+     * @return A description of the operation method.
      */
     @Override
     public OperationMethod getMethod() {
@@ -278,9 +279,15 @@ class AbstractSingleOperation extends Ab
     }
 
     /**
-     * Returns a description of the parameters. The default implementation tries to infer
the
-     * description from the {@linkplain #getMathTransform() math transform} itself before
to
-     * fallback on the {@linkplain DefaultOperationMethod#getParameters() method parameters}.
+     * Returns a description of the parameters. The default implementation performs the following
choice:
+     *
+     * <ul>
+     *   <li>If parameter values were specified explicitely at construction time,
+     *       then the descriptor of those parameters is returned.</li>
+     *   <li>Otherwise if this method can infer the parameter descriptor from the
+     *       {@linkplain #getMathTransform() math transform}, then that descriptor is returned.</li>
+     *   <li>Otherwise fallback on the {@linkplain DefaultOperationMethod#getParameters()
method parameters}.</li>
+     * </ul>
      *
      * <div class="note"><b>Note:</b>
      * the two parameter descriptions (from the {@code MathTransform} or from the {@code
OperationMethod})
@@ -298,8 +305,16 @@ class AbstractSingleOperation extends Ab
     }
 
     /**
-     * Returns the parameter values. The default implementation infers the parameter values
from the
-     * {@linkplain #getMathTransform() math transform}, if possible.
+     * Returns the parameter values. The default implementation performs the following choice:
+     *
+     * <ul>
+     *   <li>If parameter values were specified explicitely at construction time, then
a
+     *       {@linkplain org.apache.sis.parameter.DefaultParameterValueGroup#clone() clone}
+     *       of those parameters is returned.</li>
+     *   <li>Otherwise if this method can infer the parameter values from the
+     *       {@linkplain #getMathTransform() math transform}, then those parameters are returned.</li>
+     *   <li>Otherwise throw {@link org.apache.sis.util.UnsupportedImplementationException}.</li>
+     * </ul>
      *
      * @return The parameter values.
      * @throws UnsupportedOperationException if the parameter values can not be determined

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -27,13 +27,16 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.referencing.operation.Matrix;
+import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.datum.Datum;
 import org.apache.sis.referencing.cs.CoordinateSystems;
 import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Workaround;
+import org.apache.sis.util.Utilities;
 
 
 /**
@@ -44,10 +47,9 @@ import org.apache.sis.util.Workaround;
  *
  * <p>This coordinate operation contains an {@linkplain DefaultOperationMethod operation
method}, usually
  * with associated {@linkplain org.apache.sis.parameter.DefaultParameterValueGroup parameter
values}.
- * In the SIS default implementation, the parameter values are inferred from the
- * {@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform math
transform}.
- * Subclasses may have to override the {@link #getParameterValues()} method if they need
to provide
- * a different set of parameters.</p>
+ * In the SIS implementation, the parameter values can be either inferred from the
+ * {@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform math
transform}
+ * or explicitely provided at construction time in a <cite>defining conversion</cite>
(see below).</p>
  *
  * <div class="section">Defining conversions</div>
  * {@code OperationMethod} instances are generally created for a pair of existing {@linkplain
#getSourceCRS() source}
@@ -167,7 +169,7 @@ public class DefaultConversion extends A
      * for more information about what Apache SIS means by "normalized".
      *
      * <p>If the caller can not yet supply a {@code MathTransform}, then (s)he shall
supply the parameter values needed
-     * for creating that transform, with the possible omission of {@code "semi-major"} and
{@code "semi-minor"} values.
+     * for creating that transform, with the possible omission of {@code "semi_major"} and
{@code "semi_minor"} values.
      * The semi-major and semi-minor parameter values will be set automatically when the
      * {@link #specialize specialize(…)} method will be invoked.</p>
      *
@@ -308,10 +310,32 @@ public class DefaultConversion extends A
         ArgumentChecks.ensureNonNull("sourceCRS", sourceCRS);
         ArgumentChecks.ensureNonNull("targetCRS", targetCRS);
         ArgumentChecks.ensureNonNull("factory",   factory);
+        ensureCompatibleDatum("sourceCRS", super.getSourceCRS(), sourceCRS);
+        ensureCompatibleDatum("targetCRS", super.getTargetCRS(), targetCRS);
         return SubTypes.create(baseType, this, sourceCRS, targetCRS, factory);
     }
 
     /**
+     * Ensures that the {@code actual} CRS uses a datum which is equals, ignoring metadata,
+     * to the datum of the {@code expected} CRS.
+     *
+     * @param param     The parameter name, used only in case of error.
+     * @param expected  The CRS containing the expected datum, or {@code null}.
+     * @param actual    The CRS for which to check the datam, or {@code null}.
+     */
+    private static void ensureCompatibleDatum(final String param,
+            final CoordinateReferenceSystem expected,
+            final CoordinateReferenceSystem actual)
+    {
+        if ((expected instanceof SingleCRS) && (actual instanceof SingleCRS)) {
+            final Datum datum = ((SingleCRS) expected).getDatum();
+             if (datum != null && !Utilities.equalsIgnoreMetadata(datum, ((SingleCRS)
actual).getDatum())) {
+                throw new IllegalArgumentException(Errors.format(Errors.Keys.IncompatibleDatum_2,
datum.getName(), param));
+             }
+        }
+    }
+
+    /**
      * Creates the math transform to be given to the sub-class constructor.
      * This method is a workaround for RFE #4093999 in Sun's bug database
      * ("Relax constraint on placement of this()/super() call in constructors").

Added: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java?rev=1679002&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.referencing.operation;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import org.opengis.parameter.ParameterValue;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.referencing.crs.GeographicCRS;
+import org.opengis.referencing.cs.EllipsoidalCS;
+import org.opengis.referencing.operation.Matrix;
+import org.opengis.referencing.operation.OperationMethod;
+import org.apache.sis.internal.referencing.OperationMethods;
+import org.apache.sis.referencing.datum.HardCodedDatum;
+import org.apache.sis.referencing.cs.HardCodedCS;
+import org.apache.sis.referencing.crs.HardCodedCRS;
+import org.apache.sis.referencing.crs.DefaultGeographicCRS;
+import org.apache.sis.referencing.datum.DefaultGeodeticDatum;
+import org.apache.sis.referencing.operation.matrix.Matrices;
+import org.apache.sis.referencing.operation.transform.MathTransforms;
+import org.apache.sis.parameter.DefaultParameterDescriptorTest;
+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.test.MetadataAssert.*;
+
+
+/**
+ * Tests {@link DefaultConversion}.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+@DependsOn({
+    DefaultTransformationTest.class     // Because similar to DefaultConversion but simpler.
+})
+public final strictfp class DefaultConversionTest extends TestCase {
+    /**
+     * Tolerance threshold for strict floating point comparisons.
+     */
+    private static final double STRICT = 0;
+
+    /**
+     * The rotation from a CRS using the Paris prime meridian to a CRS using the Greenwich
prime meridian,
+     * in degrees. The definitive value is 2.5969213 grades.
+     */
+    private static final double OFFSET = 2.33722917;
+
+    /**
+     * Creates a CRS using the WGS84 datum, except for the prime meridian which is set to
Paris.
+     * This is not a CRS is real usage (the CRS with Paris prime meridian were using an older
datum),
+     * but this is convenient for testing a conversion consisting of only a longitude rotation.
+     *
+     * @param cs {@link HardCodedCS#GEODETIC_2D}, {@link HardCodedCS#GEODETIC_φλ} or other
compatible coordinate system.
+     */
+    private static GeographicCRS createParisCRS(final EllipsoidalCS cs) {
+        final Map<String, ?> name = Collections.singletonMap(GeographicCRS.NAME_KEY,
HardCodedDatum.PARIS.getName());
+        return new DefaultGeographicCRS(name, new DefaultGeodeticDatum(name,
+                HardCodedDatum.WGS84.getEllipsoid(), HardCodedDatum.PARIS), cs);
+    }
+
+    /**
+     * Creates a very simple conversion performing a longitude rotation on the WGS84 datum.
+     * The source CRS shall use the Paris prime meridian and the target CRS the Greenwich
+     * prime meridian.
+     *
+     * @param sourceCRS A CRS using the Paris prime meridian.
+     * @param targetCRS A CRS using the Greenwich prime meridian.
+     */
+    private static DefaultConversion createLongitudeRotation(final GeographicCRS sourceCRS,
final GeographicCRS targetCRS) {
+        final Matrix rotation = Matrices.createDiagonal(
+                targetCRS.getCoordinateSystem().getDimension() + 1,     // Number of rows.
+                sourceCRS.getCoordinateSystem().getDimension() + 1);    // Number of columns.
+        rotation.setElement(0, rotation.getNumCol() - 1, OFFSET);
+
+        final OperationMethod method = DefaultOperationMethodTest.create(
+                "Longitude rotation", "9601", "EPSG guidance note #7-2",
+                sourceCRS.getCoordinateSystem().getDimension(),
+                DefaultParameterDescriptorTest.createEPSG("Longitude offset", (short) 9601));
+        final ParameterValueGroup pg = method.getParameters().createValue();
+        pg.parameter("Longitude offset").setValue(OFFSET);
+
+        final Map<String, Object> properties = new HashMap<>(4);
+        properties.put(DefaultTransformation.NAME_KEY, "Paris to Greenwich");
+        properties.put(OperationMethods.PARAMETERS_KEY, pg);
+        return new DefaultConversion(properties, sourceCRS, targetCRS, null, method, MathTransforms.linear(rotation));
+    }
+
+    /**
+     * Tests a simple two-dimensional conversion performing a longitude rotation on the WGS84
datum.
+     */
+    @Test
+    public void testConstruction() {
+        final DefaultConversion op = createLongitudeRotation(createParisCRS(HardCodedCS.GEODETIC_2D),
HardCodedCRS.WGS84);
+        assertEquals("name",       "Paris to Greenwich", op.getName().getCode());
+        assertEquals("sourceCRS",  "Paris",              op.getSourceCRS().getName().getCode());
+        assertEquals("targetCRS",  "WGS 84",             op.getTargetCRS().getName().getCode());
+        assertEquals("method",     "Longitude rotation", op.getMethod().getName().getCode());
+        assertEquals("parameters", "Longitude rotation", op.getParameterDescriptors().getName().getCode());
+
+        final ParameterValueGroup parameters = op.getParameterValues();
+        final ParameterValue<?>[] values = parameters.values().toArray(new ParameterValue<?>[1]);
+        assertEquals("parameters",    "Longitude rotation", parameters.getDescriptor().getName().getCode());
+        assertEquals("parameters[0]", "Longitude offset",    values[0].getDescriptor().getName().getCode());
+        assertEquals("parameters[0]", OFFSET, values[0].doubleValue(), STRICT);
+
+        final Matrix m = MathTransforms.getMatrix(op.getMathTransform());
+        assertNotNull("transform", m);
+        final int numCol = m.getNumCol();
+        for (int j=m.getNumRow(); --j >= 0;) {
+            for (int i=numCol; --i >= 0;) {
+                assertEquals((j == 0 && i == numCol-1) ? OFFSET : (i == j) ? 1 :
0, m.getElement(j,i), STRICT);
+            }
+        }
+    }
+
+    /**
+     * Tests serialization.
+     */
+    @Test
+    @DependsOnMethod("testConstruction")
+    public void testSerialization() {
+        assertSerializedEquals(createLongitudeRotation(createParisCRS(HardCodedCS.GEODETIC_2D),
HardCodedCRS.WGS84));
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -18,8 +18,10 @@ package org.apache.sis.referencing.opera
 
 import java.util.Map;
 import java.util.HashMap;
+import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.OperationMethod;
 import org.apache.sis.internal.referencing.OperationMethods;
 import org.apache.sis.parameter.DefaultParameterDescriptorTest;
@@ -30,6 +32,7 @@ import org.apache.sis.referencing.datum.
 import org.apache.sis.referencing.operation.matrix.Matrix4;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
 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;
@@ -51,12 +54,21 @@ import static org.apache.sis.test.Metada
 })
 public final strictfp class DefaultTransformationTest extends TestCase {
     /**
+     * Tolerance threshold for strict floating point comparisons.
+     */
+    private static final double STRICT = 0;
+
+    /**
      * Creates a geocentric CRS using the given datum.
      */
-    private static DefaultGeocentricCRS createCRS(final GeodeticDatum datum) {
-        return new DefaultGeocentricCRS(
-                IdentifiedObjects.getProperties(datum, DefaultGeocentricCRS.IDENTIFIERS_KEY),
-                datum, HardCodedCS.GEOCENTRIC);
+    private static DefaultGeocentricCRS createCRS(final String name, final GeodeticDatum
datum) {
+        Map<String,?> properties = IdentifiedObjects.getProperties(datum, DefaultGeocentricCRS.IDENTIFIERS_KEY);
+        if (name != null) {
+            final Map<String,Object> copy = new HashMap<>(properties);
+            copy.put(DefaultGeocentricCRS.NAME_KEY, name);
+            properties = copy;
+        }
+        return new DefaultGeocentricCRS(properties, datum, HardCodedCS.GEOCENTRIC);
     }
 
     /**
@@ -77,20 +89,57 @@ public final strictfp class DefaultTrans
         properties.put(DefaultTransformation.NAME_KEY, "Tokyo to JGD2000 (GSI)");
         properties.put(OperationMethods.PARAMETERS_KEY, pg);
         return new DefaultTransformation(properties,
-                createCRS(HardCodedDatum.TOKYO),    // SourceCRS
-                createCRS(HardCodedDatum.JGD2000),  // TargetCRS
-                null,                               // InterpolationCRS
+                createCRS(null,      HardCodedDatum.TOKYO),     // SourceCRS
+                createCRS("JGD2000", HardCodedDatum.JGD2000),   // TargetCRS
+                null,                                           // InterpolationCRS
                 method,
                 MathTransforms.linear(translation));
     }
 
     /**
+     * Tests construction.
+     */
+    @Test
+    public void testConstruction() {
+        final DefaultTransformation op = createGeocentricTranslation();
+        assertEquals("name",       "Tokyo to JGD2000 (GSI)",  op.getName().getCode());
+        assertEquals("sourceCRS",  "Tokyo 1918",              op.getSourceCRS().getName().getCode());
+        assertEquals("targetCRS",  "JGD2000",                 op.getTargetCRS().getName().getCode());
+        assertEquals("method",     "Geocentric translations", op.getMethod().getName().getCode());
+        assertEquals("parameters", "Geocentric translations", op.getParameterDescriptors().getName().getCode());
+
+        final ParameterValueGroup parameters = op.getParameterValues();
+        final ParameterValue<?>[] values = parameters.values().toArray(new ParameterValue<?>[3]);
+        assertEquals("parameters",    "Geocentric translations", parameters.getDescriptor().getName().getCode());
+        assertEquals("parameters[0]", "X-axis translation",      values[0] .getDescriptor().getName().getCode());
+        assertEquals("parameters[1]", "Y-axis translation",      values[1] .getDescriptor().getName().getCode());
+        assertEquals("parameters[2]", "Z-axis translation",      values[2] .getDescriptor().getName().getCode());
+        assertEquals("parameters[0]", -146.414, values[0].doubleValue(), STRICT);
+        assertEquals("parameters[1]",  507.337, values[1].doubleValue(), STRICT);
+        assertEquals("parameters[2]",  680.507, values[2].doubleValue(), STRICT);
+
+        final Matrix m = MathTransforms.getMatrix(op.getMathTransform());
+        assertNotNull("transform", m);
+        for (int j=m.getNumRow(); --j >= 0;) {
+            for (int i=m.getNumCol(); --i >= 0;) {
+                double expected = (i == j) ? 1 : 0;
+                if (i == 2) switch (j) {
+                    case 0: expected = -146.414; break;
+                    case 1: expected =  507.337; break;
+                    case 2: expected =  680.507; break;
+                }
+                assertEquals(expected, m.getElement(j,i), STRICT);
+            }
+        }
+    }
+
+    /**
      * Tests WKT formatting.
      */
     @Test
+    @DependsOnMethod("testConstruction")
     public void testWKT() {
         final DefaultTransformation op = createGeocentricTranslation();
-
         assertWktEquals(
                 "CoordinateOperation[“Tokyo to JGD2000 (GSI)”,\n" +
                 "  SourceCRS[GeodeticCRS[“Tokyo 1918”,\n" +
@@ -102,7 +151,7 @@ public final strictfp class DefaultTrans
                 "      Axis[“(Y)”, geocentricY, Order[2]],\n" +
                 "      Axis[“(Z)”, geocentricZ, Order[3]],\n" +
                 "      LengthUnit[“metre”, 1]]],\n" +
-                "  TargetCRS[GeodeticCRS[“Japanese Geodetic Datum 2000”,\n" +
+                "  TargetCRS[GeodeticCRS[“JGD2000”,\n" +
                 "    Datum[“Japanese Geodetic Datum 2000”,\n" +
                 "      Ellipsoid[“GRS 1980”, 6378137.0, 298.257222101, LengthUnit[“metre”,
1]]],\n" +
                 "      PrimeMeridian[“Greenwich”, 0.0, AngleUnit[“degree”, 0.017453292519943295]],\n"
+
@@ -126,7 +175,7 @@ public final strictfp class DefaultTrans
                 "      Axis[“(Y)”, geocentricY],\n" +
                 "      Axis[“(Z)”, geocentricZ],\n" +
                 "      Unit[“metre”, 1]]],\n" +
-                "  TargetCRS[GeodeticCRS[“Japanese Geodetic Datum 2000”,\n" +
+                "  TargetCRS[GeodeticCRS[“JGD2000”,\n" +
                 "    Datum[“Japanese Geodetic Datum 2000”,\n" +
                 "      Ellipsoid[“GRS 1980”, 6378137.0, 298.257222101]],\n" +
                 "    CS[“Cartesian”, 3],\n" +
@@ -144,6 +193,7 @@ public final strictfp class DefaultTrans
      * Tests serialization.
      */
     @Test
+    @DependsOnMethod("testConstruction")
     public void testSerialization() {
         assertSerializedEquals(createGeocentricTranslation());
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -91,6 +91,7 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.operation.DefaultFormulaTest.class,
     org.apache.sis.referencing.operation.DefaultOperationMethodTest.class,
     org.apache.sis.referencing.operation.AbstractSingleOperationTest.class,
+    // Other test classes from the 'operation' package after the CRS tests below.
     org.apache.sis.referencing.operation.transform.OperationMethodSetTest.class,
     org.apache.sis.internal.referencing.provider.AffineTest.class,
     org.apache.sis.internal.referencing.provider.LongitudeRotationTest.class,
@@ -129,6 +130,7 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.crs.DefaultVerticalCRSTest.class,
     org.apache.sis.referencing.crs.DefaultTemporalCRSTest.class,
     org.apache.sis.referencing.operation.DefaultTransformationTest.class,
+    org.apache.sis.referencing.operation.DefaultConversionTest.class,
     org.apache.sis.referencing.crs.DefaultProjectedCRSTest.class,
     org.apache.sis.referencing.crs.DefaultDerivedCRSTest.class,
     org.apache.sis.referencing.crs.SubTypesTest.class,

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -88,7 +88,7 @@ public abstract class TypeRegistration {
         /*
          * Implementation note: do not keep the ServiceLoader in static field because:
          *
-         * 1) It would cache the RegsterableTypes instances, which are not needed after this
method call.
+         * 1) It would cache the TypeRegistration instances, which are not needed after this
method call.
          * 2) The ClassLoader between different invocations may be different in an OSGi context.
          */
         final ArrayList<Class<?>> types = new ArrayList<>();

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Tue May 12 16:59:43 2015
@@ -399,6 +399,11 @@ public final class Errors extends Indexe
         public static final short IncompatibleCoordinateSystemTypes = 44;
 
         /**
+         * Datum of “{1}” shall be “{0}”.
+         */
+        public static final short IncompatibleDatum_2 = 186;
+
+        /**
          * Property “{0}” has an incompatible value.
          */
         public static final short IncompatiblePropertyValue_1 = 45;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] Tue May 12 16:59:43 2015
@@ -89,6 +89,7 @@ IllegalRange_2                    = Rang
 IllegalUnicodeCodePoint_2         = Value {1} for \u201c{0}\u201d is not a valid Unicode
code point.
 IllegalUnitFor_2                  = Unit of measurement \u201c{1}\u201d is not valid for
\u201c{0}\u201d values.
 IncompatibleCoordinateSystemTypes = Incompatible coordinate system types.
+IncompatibleDatum_2               = Datum of \u201c{1}\u201d shall be \u201c{0}\u201d.
 IncompatiblePropertyValue_1       = Property \u201c{0}\u201d has an incompatible value.
 IncompatibleUnit_1                = Unit \u201c{0}\u201d is incompatible with current value.
 IncompatibleUnits_2               = Units \u201c{0}\u201d and \u201c{1}\u201d are incompatible.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1679002&r1=1679001&r2=1679002&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] Tue May 12 16:59:43 2015
@@ -79,6 +79,7 @@ IllegalRange_2                    = La p
 IllegalUnicodeCodePoint_2         = La valeur {1} de \u00ab\u202f{0}\u202f\u00bb n\u2019est
pas un code Unicode valide.
 IllegalUnitFor_2                  = L\u2019unit\u00e9 de mesure \u00ab\u202f{1}\u202f\u00bb
n\u2019est pas valide pour les valeurs de \u00ab\u202f{0}\u202f\u00bb.
 IncompatibleCoordinateSystemTypes = Types de syst\u00e8mes de coordonn\u00e9es incompatibles.
+IncompatibleDatum_2               = Le r\u00e9f\u00e9rentiel de \u00ab\u202f{1}\u202f\u00bb
doit \u00eatre \u00ab\u202f{0}\u202f\u00bb.
 IncompatiblePropertyValue_1       = La valeur de la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb
n\u2019est pas compatible.
 IncompatibleUnit_1                = L\u2019unit\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est
pas compatible avec la valeur actuelle.
 IncompatibleUnits_2               = Les unit\u00e9s \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb
ne sont pas compatibles.



Mime
View raw message