You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/05/15 21:42:43 UTC
svn commit: r1679636 [4/5] - in /sis/trunk: ./
application/sis-console/src/main/java/org/apache/sis/console/
application/sis-console/src/test/java/org/apache/sis/console/
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-metadata/src/main...
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Fri May 15 19:42:41 2015
@@ -617,6 +617,7 @@ public class DefaultMathTransformFactory
* if some required parameter has not been supplied, or has illegal value.
*
* @see org.apache.sis.referencing.cs.AxesConvention#NORMALIZED
+ * @see org.apache.sis.referencing.operation.DefaultConversion#DefaultConversion(Map, OperationMethod, MathTransform, ParameterValueGroup)
*/
public MathTransform createBaseToDerived(final CoordinateSystem baseCS,
final MathTransform parameterized, final CoordinateSystem derivedCS)
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java [UTF-8] Fri May 15 19:42:41 2015
@@ -164,7 +164,9 @@ public final class MathTransforms extend
{
ensureNonNull("tr1", tr1);
ensureNonNull("tr2", tr2);
- return ConcatenatedTransform.create(tr1, tr2);
+ final MathTransform tr = ConcatenatedTransform.create(tr1, tr2);
+ assert isValid(getSteps(tr)) : tr;
+ return tr;
}
/**
@@ -258,6 +260,24 @@ public final class MathTransforms extend
}
/**
+ * Makes sure that the given list does not contains two consecutive linear transforms
+ * (because their matrices should have been multiplied together).
+ * This is used for assertion purposes only.
+ */
+ private static boolean isValid(final List<MathTransform> steps) {
+ boolean wasLinear = false;
+ for (final MathTransform step : steps) {
+ if (step instanceof LinearTransform) {
+ if (wasLinear) return false;
+ wasLinear = true;
+ } else {
+ wasLinear = false;
+ }
+ }
+ return true;
+ }
+
+ /**
* Returns all single components of the given (potentially concatenated) transform.
* This method makes the following choice:
*
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java [UTF-8] Fri May 15 19:42:41 2015
@@ -26,6 +26,7 @@ import org.opengis.referencing.operation
import org.apache.sis.referencing.operation.matrix.Matrices;
import org.apache.sis.referencing.operation.matrix.MatrixSIS;
import org.apache.sis.internal.referencing.DirectPositionView;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.geometry.GeneralDirectPosition;
import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.util.ComparisonMode;
@@ -144,6 +145,7 @@ public class PassThroughTransform extend
final MathTransform subTransform,
final int numTrailingOrdinates)
{
+ ensureNonNull ("subTransform", subTransform);
ensurePositive("firstAffectedOrdinate", firstAffectedOrdinate);
ensurePositive("numTrailingOrdinates", numTrailingOrdinates);
if (firstAffectedOrdinate == 0 && numTrailingOrdinates == 0) {
@@ -630,6 +632,6 @@ public class PassThroughTransform extend
formatter.setInvalidWKT(PassThroughTransform.class, null);
}
formatter.append(subTransform);
- return "PassThrough_MT";
+ return WKTKeywords.PassThrough_MT;
}
}
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -43,11 +43,6 @@ import static org.apache.sis.test.Refere
@DependsOn(GeneralDirectPositionTest.class)
public final strictfp class AbstractEnvelopeTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- static final double STRICT = 0;
-
- /**
* Enumeration of implementations to be tested.
* The {@code LAST} constant is for stopping the loops.
*/
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -25,7 +25,6 @@ import org.junit.Test;
import static org.opengis.test.Validators.*;
import static org.apache.sis.test.ReferencingAssert.*;
import static org.apache.sis.geometry.AbstractEnvelopeTest.WGS84;
-import static org.apache.sis.geometry.AbstractEnvelopeTest.STRICT;
/**
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -28,7 +28,6 @@ import static java.lang.Double.NaN;
import static org.opengis.test.Validators.*;
import static org.apache.sis.test.ReferencingAssert.*;
import static org.apache.sis.geometry.AbstractEnvelopeTest.WGS84;
-import static org.apache.sis.geometry.AbstractEnvelopeTest.STRICT;
/**
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/SubEnvelopeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/SubEnvelopeTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/SubEnvelopeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/SubEnvelopeTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -23,7 +23,6 @@ import static java.lang.Double.NaN;
import static org.junit.Assert.*;
import static org.opengis.test.Validators.validate;
import static org.apache.sis.geometry.AbstractEnvelopeTest.WGS84;
-import static org.apache.sis.geometry.AbstractEnvelopeTest.STRICT;
/**
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -45,11 +45,6 @@ import static org.apache.sis.internal.re
*/
public final strictfp class ReferencingUtilitiesTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Tests {@link ReferencingUtilities#isGreenwichLongitudeEquals(PrimeMeridian, PrimeMeridian)}.
*/
@Test
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ServicesForMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ServicesForMetadataTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ServicesForMetadataTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ServicesForMetadataTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -50,11 +50,6 @@ import static org.apache.sis.test.TestUt
})
public final strictfp class ServicesForMetadataTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Creates a test envelope with the given CRS and initialized with
* [-10 … 70]° of longitude, [-20 … 30]° of latitude, [-40 … 60] metres of elevation
* and [51000 … 52000] modified Julian days.
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -144,7 +144,7 @@ public final strictfp class DefaultParam
* @param code The parameter identifier.
* @return The descriptor with the given EPSG identifier.
*/
- static DefaultParameterDescriptor<Double> createEPSG(final String name, final short code) {
+ public static DefaultParameterDescriptor<Double> createEPSG(final String name, final short code) {
final Map<String, Object> properties = properties(name);
assertNull(properties.put(DefaultParameterDescriptor.IDENTIFIERS_KEY,
new ImmutableIdentifier(HardCodedCitations.IOGP, Constants.EPSG, Short.toString(code))));
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -47,13 +47,6 @@ import static org.apache.sis.test.Metada
@DependsOn(DefaultParameterDescriptorTest.class)
public final strictfp class DefaultParameterValueTest extends TestCase {
/**
- * Strict tolerance factor for floating point comparisons. In the particular
- * case of this test suite, we can afford to be strict since we will perform
- * arithmetic only on integer values.
- */
- private static final double STRICT = 0.0;
-
- /**
* Small tolerance factor for floating point comparisons resulting from some calculation.
*/
private static final double EPS = 1E-10;
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/UnmodifiableParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/UnmodifiableParameterValueTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/UnmodifiableParameterValueTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/UnmodifiableParameterValueTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -39,11 +39,6 @@ import static org.junit.Assert.*;
@DependsOn(DefaultParameterValueTest.class)
public final strictfp class UnmodifiableParameterValueTest extends TestCase {
/**
- * Strict tolerance factor for floating point comparisons.
- */
- private static final double STRICT = 0.0;
-
- /**
* Creates an {@link UnmodifiableParameterValue} implementation for the given parameter
* and asserts that we got a new instance equivalent to the original one.
*/
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -108,8 +108,8 @@ public final strictfp class AbstractRefe
new DefaultTemporalExtent()))); // TODO: needs sis-temporal module for testing that one.
final AbstractReferenceSystem object = new AbstractReferenceSystem(properties);
- assertEquals( // Quotes (at least the closing one) conservatively omitted for WKT 1.
- "ReferenceSystem[\"My object.\", AUTHORITY[\"EPSG\", \"4326\"]]",
+ assertEquals(
+ "ReferenceSystem[\"My “object”.\", AUTHORITY[\"EPSG\", \"4326\"]]",
object.toString(Convention.WKT1));
assertWktEquals(Convention.WKT1,
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -43,11 +43,6 @@ import static org.apache.sis.test.Assert
})
public final strictfp class CRSTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Asserts that the result of {@link CRS#forCode(String)} is the given CRS.
*/
private static void verifyForCode(final SingleCRS expected, final String code) throws FactoryException {
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java [UTF-8] Fri May 15 19:42:41 2015
@@ -28,7 +28,6 @@ import org.opengis.referencing.operation
import org.opengis.referencing.operation.MathTransformFactory;
import org.opengis.util.NoSuchIdentifierException;
import org.opengis.util.FactoryException;
-import org.apache.sis.internal.referencing.OperationMethods;
import org.apache.sis.internal.system.DefaultFactories;
import org.apache.sis.referencing.crs.DefaultProjectedCRS;
import org.apache.sis.referencing.operation.DefaultConversion;
@@ -187,11 +186,10 @@ public class GeodeticObjectBuilder exten
* except the aliases and identifiers. The name defaults to the ProjectedCRS name,
* but can optionally be different.
*/
- properties.put(OperationMethods.PARAMETERS_KEY, parameters);
final Object name = (conversionName != null) ? properties.put(Conversion.NAME_KEY, conversionName) : null;
final Object alias = properties.put(Conversion.ALIAS_KEY, null);
final Object identifier = properties.put(Conversion.IDENTIFIERS_KEY, null);
- final Conversion conversion = new DefaultConversion(properties, mtFactory.getLastMethodUsed(), mt);
+ final Conversion conversion = new DefaultConversion(properties, mtFactory.getLastMethodUsed(), mt, parameters);
/*
* Restore the original properties and create the final ProjectedCRS.
*/
@@ -203,7 +201,6 @@ public class GeodeticObjectBuilder exten
return new DefaultProjectedCRS(properties, baseCRS, conversion, derivedCS);
} finally {
onCreate(true);
- properties.remove(OperationMethods.PARAMETERS_KEY);
}
}
}
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -48,11 +48,6 @@ import static org.junit.Assert.*;
})
public final strictfp class StandardDefinitionsTest extends TestCase {
/**
- * The tolerance threshold for strict comparisons of floating point values.
- */
- private static final double STRICT = 0;
-
- /**
* Compares the values created by {@code StandardDefinitions} against hard-coded constants.
* This method tests the following methods:
*
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -58,11 +58,6 @@ public final strictfp class DefaultCompo
private static final DefaultTemporalCRS TIME = HardCodedCRS.TIME;
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Tests construction and serialization of a {@link DefaultCompoundCRS}.
*/
@Test
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -46,11 +46,6 @@ import static org.apache.sis.test.TestUt
})
public final strictfp class DefaultGeographicCRSTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Tests the {@link DefaultGeographicCRS#forConvention(AxesConvention)} method
* for {@link AxesConvention#POSITIVE_RANGE}.
*/
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -45,7 +45,8 @@ import static org.apache.sis.test.Metada
* @module
*/
@DependsOn({
- DefaultGeographicCRSTest.class
+ DefaultGeographicCRSTest.class,
+ org.apache.sis.referencing.operation.DefaultConversionTest.class
})
public final strictfp class DefaultProjectedCRSTest extends XMLTestCase {
/**
@@ -80,7 +81,7 @@ public final strictfp class DefaultProje
@Test
public void testWKT1() throws FactoryException {
final ProjectedCRS crs = create();
- Validators.validate(crs);
+ Validators.validate(crs); // Opportunist check.
assertWktEquals(Convention.WKT1,
"PROJCS[“NTF (Paris) / Lambert zone II”,\n" +
" GEOGCS[“NTF (Paris)”,\n" +
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java [UTF-8] Fri May 15 19:42:41 2015
@@ -18,6 +18,7 @@ package org.apache.sis.referencing.crs;
import java.util.Map;
import java.util.HashMap;
+import java.util.Collections;
import org.opengis.referencing.datum.PixelInCell;
import org.apache.sis.referencing.cs.HardCodedCS;
import org.apache.sis.referencing.datum.HardCodedDatum;
@@ -84,11 +85,10 @@ public final strictfp class HardCodedCRS
* this CRS is to test operations between CRS having different prime meridian.</p>
*
* @since 0.5
- *
- * @see DefaultProjectedCRSTest#NTF_ZONE_II
*/
public static final DefaultGeographicCRS NTF = new DefaultGeographicCRS(
- properties("NTF (Paris)"), HardCodedDatum.NTF, HardCodedCS.GEODETIC_2D);
+ Collections.singletonMap(DefaultGeographicCRS.NAME_KEY, "NTF (Paris)"),
+ HardCodedDatum.NTF, HardCodedCS.GEODETIC_2D);
/**
* A two-dimensional geographic coordinate reference system using a spherical datum.
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -27,7 +27,6 @@ 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.*;
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -51,11 +51,6 @@ import static org.apache.sis.test.Assert
})
public final strictfp class CoordinateSystemsTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- static final double STRICT = 0;
-
- /**
* Tests {@link CoordinateSystems#parseAxisDirection(String)}.
*/
@Test
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -32,7 +32,6 @@ import static java.util.Collections.sing
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;
/**
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -41,11 +41,6 @@ import static org.apache.sis.test.TestUt
@DependsOn(AbstractCSTest.class)
public final strictfp class DefaultEllipsoidalCSTest extends XMLTestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* An XML file in this package containing an ellipsoidal coordinate system definition.
*/
private static final String XML_FILE = "EllipsoidalCS.xml";
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -35,11 +35,6 @@ import static org.apache.sis.test.Metada
@DependsOn(org.apache.sis.internal.referencing.AxisDirectionsTest.class)
public final strictfp class DirectionAlongMeridianTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Tests the {@link DirectionAlongMeridian#parse(AxisDirection)} method.
*/
@Test
@@ -107,7 +102,7 @@ public final strictfp class DirectionAlo
}
/**
- * Test Well Known Text formatting.
+ * Tests Well Known Text formatting.
*/
@Test
public void testWKT() {
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java [UTF-8] Fri May 15 19:42:41 2015
@@ -19,6 +19,7 @@ package org.apache.sis.referencing.datum
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
+import javax.measure.unit.SI;
import javax.measure.unit.NonSI;
import org.opengis.referencing.datum.PixelInCell;
import org.opengis.referencing.datum.VerticalDatumType;
@@ -35,7 +36,7 @@ import static org.opengis.referencing.da
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.5
+ * @version 0.6
* @module
*/
public final strictfp class HardCodedDatum {
@@ -83,7 +84,7 @@ public final strictfp class HardCodedDat
* Earth Gravitational Model}.
*/
public static final DefaultGeodeticDatum WGS72 = new DefaultGeodeticDatum(
- properties("World Geodetic System 1972", "6322", "Satellite navigation."),
+ properties("World Geodetic System 1972", "6322", WGS84.getScope()),
new DefaultEllipsoid(GeodeticDatumMock.WGS84.getEllipsoid()), GREENWICH);
/**
@@ -96,6 +97,28 @@ public final strictfp class HardCodedDat
new DefaultEllipsoid(GeodeticDatumMock.NTF.getEllipsoid()), PARIS);
/**
+ * Tokyo 1918 datum (EPSG:6301). Ellipsoid is Bessel 1841 and prime meridian is Greenwich.
+ * Bursa-Wolf parameters to {@link #JGD2000} are (-146.414, 507.337, 680.507).
+ *
+ * @since 0.6
+ */
+ public static final DefaultGeodeticDatum TOKYO = new DefaultGeodeticDatum(
+ properties("Tokyo 1918", "6301", "Geodetic survey."),
+ DefaultEllipsoid.createFlattenedSphere(properties("Bessel 1841", "7004", null),
+ 6377397.155, 299.1528128, SI.METRE), GREENWICH);
+
+ /**
+ * Japanese Geodetic Datum 2000 datum (EPSG:6612). Ellipsoid is GRS 1980 and prime meridian is Greenwich.
+ * This is useful for testing datum shift from {@link #TOKYO}.
+ *
+ * @since 0.6
+ */
+ public static final DefaultGeodeticDatum JGD2000 = new DefaultGeodeticDatum(
+ properties("Japanese Geodetic Datum 2000", "6612", TOKYO.getScope()),
+ DefaultEllipsoid.createFlattenedSphere(properties("GRS 1980", "7019", null),
+ 6378137, 298.257222101, SI.METRE), GREENWICH);
+
+ /**
* Spherical datum based on GRS 1980 Authalic Sphere (EPSG:6047). Prime meridian is Greenwich.
*/
public static final DefaultGeodeticDatum SPHERE = new DefaultGeodeticDatum(
@@ -103,21 +126,21 @@ public final strictfp class HardCodedDat
new DefaultEllipsoid(GeodeticDatumMock.SPHERE.getEllipsoid()), GREENWICH);
/**
- * Mean sea level, which can be used as an approximation of geoid.
- */
- public static final DefaultVerticalDatum MEAN_SEA_LEVEL = new DefaultVerticalDatum(
- properties("Mean Sea Level", "5100", "Hydrography."),
- VerticalDatumType.GEOIDAL);
-
- /**
* Ellipsoid for measurements of height above the ellipsoid.
* This is not a valid datum according ISO 19111, but is used by Apache SIS for internal calculation.
*/
public static final DefaultVerticalDatum ELLIPSOID = new DefaultVerticalDatum(
- properties("Ellipsoid", null, "Not a valid datum."),
+ properties("Ellipsoid", null, SPHERE.getScope()),
VerticalDatumTypes.ELLIPSOIDAL);
/**
+ * Mean sea level, which can be used as an approximation of geoid.
+ */
+ public static final DefaultVerticalDatum MEAN_SEA_LEVEL = new DefaultVerticalDatum(
+ properties("Mean Sea Level", "5100", "Hydrography."),
+ VerticalDatumType.GEOIDAL);
+
+ /**
* Default datum for time measured since January 1st, 1970 at 00:00 UTC.
*/
public static final DefaultTemporalDatum UNIX = new DefaultTemporalDatum(
@@ -147,7 +170,7 @@ public final strictfp class HardCodedDat
/**
* Creates a map of properties for the given name and EPSG code.
*/
- private static Map<String,?> properties(final String name, final String code, final String scope) {
+ private static Map<String,?> properties(final String name, final String code, final CharSequence scope) {
final Map<String,Object> properties = new HashMap<String,Object>(4);
properties.put(NAME_KEY, name);
if (code != null) {
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/AbstractSingleOperationTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/AbstractSingleOperationTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/AbstractSingleOperationTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/AbstractSingleOperationTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -41,7 +41,7 @@ import static org.opengis.test.Assert.*;
*/
@DependsOn({
DefaultOperationMethodTest.class,
- org.apache.sis.referencing.operation.transform.MathTransformsTest.class
+ MathTransformsTest.class
})
public final strictfp class AbstractSingleOperationTest extends TestCase {
/**
@@ -55,23 +55,24 @@ public final strictfp class AbstractSing
}
/**
- * Tests {@link OperationMethods#checkDimensions(OperationMethod, MathTransform, Map)}.
+ * Tests {@link AbstractSingleOperation#checkDimensions(OperationMethod, MathTransform, Map)}
+ * without interpolation dimension.
*/
@Test
public void testCheckDimensions() {
final Map<String,?> properties = Collections.singletonMap(DefaultOperationMethod.LOCALE_KEY, Locale.ENGLISH);
final MathTransform tr = MathTransformsTest.createConcatenateAndPassThrough();
- AbstractSingleOperation.checkDimensions(createOperationMethod(3, 3), tr, properties);
- AbstractSingleOperation.checkDimensions(createOperationMethod(1, 1), tr, properties);
+ AbstractSingleOperation.checkDimensions(createOperationMethod(3, 3), 0, tr, properties);
+ AbstractSingleOperation.checkDimensions(createOperationMethod(1, 1), 0, tr, properties);
try {
- AbstractSingleOperation.checkDimensions(createOperationMethod(2, 2), tr, properties);
+ AbstractSingleOperation.checkDimensions(createOperationMethod(2, 2), 0, tr, properties);
fail("MathTransform.sourceDimension == 3 shall be considered incompatible.");
} catch (IllegalArgumentException e) {
// This is the expected exception.
assertEquals(e.getMessage(), "The transform has 1 source dimension, while 2 was expected.");
}
try {
- AbstractSingleOperation.checkDimensions(createOperationMethod(3, 1), tr, properties);
+ AbstractSingleOperation.checkDimensions(createOperationMethod(3, 1), 0, tr, properties);
fail("MathTransform.targetDimension == 3 shall be considered incompatible.");
} catch (IllegalArgumentException e) {
// This is the expected exception.
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -19,6 +19,7 @@ package org.apache.sis.referencing.opera
import java.util.Map;
import java.util.HashMap;
import org.opengis.metadata.Identifier;
+import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.referencing.operation.OperationMethod;
@@ -46,7 +47,8 @@ import static org.apache.sis.test.Refere
*/
@DependsOn({
DefaultFormulaTest.class,
- org.apache.sis.referencing.AbstractIdentifiedObjectTest.class
+ org.apache.sis.referencing.AbstractIdentifiedObjectTest.class,
+ org.apache.sis.parameter.DefaultParameterDescriptorGroupTest.class
})
public final strictfp class DefaultOperationMethodTest extends TestCase {
/**
@@ -55,11 +57,12 @@ public final strictfp class DefaultOpera
* @param method The operation name (example: "Mercator (variant A)").
* @param identifier The EPSG numeric identifier (example: "9804").
* @param formula Formula citation (example: "EPSG guidance note #7-2").
- * @param dimension The number of input and output dimension.
+ * @param dimension The number of input and output dimension, or {@code null}.
+ * @param parameters The parameters (can be empty).
* @return The operation method.
*/
- private static DefaultOperationMethod create(final String method, final String identifier, final String formula,
- final Integer dimension)
+ static DefaultOperationMethod create(final String method, final String identifier, final String formula,
+ final Integer dimension, final ParameterDescriptor<?>... parameters)
{
final Map<String,Object> properties = new HashMap<String,Object>(8);
assertNull(properties.put(OperationMethod.NAME_KEY, method));
@@ -69,15 +72,15 @@ public final strictfp class DefaultOpera
* The parameter group for a Mercator projection is actually not empty, but it is not the purpose of
* this class to test DefaultParameterDescriptorGroup. So we use an empty group of parameters here.
*/
- final ParameterDescriptorGroup parameters = new DefaultParameterDescriptorGroup(properties, 1, 1);
+ final ParameterDescriptorGroup pg = new DefaultParameterDescriptorGroup(properties, 1, 1, parameters);
/*
* NAME_KEY share the same Identifier instance for saving a little bit of memory.
* Then define the other properties to be given to OperationMethod.
*/
- assertNotNull(properties.put(OperationMethod.NAME_KEY, parameters.getName()));
+ assertNotNull(properties.put(OperationMethod.NAME_KEY, pg.getName()));
assertNull(properties.put(OperationMethod.IDENTIFIERS_KEY, new ImmutableIdentifier(HardCodedCitations.IOGP, "EPSG", identifier)));
assertNull(properties.put(OperationMethod.FORMULA_KEY, new DefaultCitation(formula)));
- return new DefaultOperationMethod(properties, dimension, dimension, parameters);
+ return new DefaultOperationMethod(properties, dimension, dimension, pg);
}
/**
@@ -152,6 +155,8 @@ public final strictfp class DefaultOpera
/**
* Tests {@link DefaultOperationMethod#toWKT()}.
+ * Since the WKT format of {@code OperationMethod} does not include parameters,
+ * we do not bother specifying the parameters in the object created here.
*/
@Test
@DependsOnMethod("testConstruction")
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilderTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilderTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilderTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -39,13 +39,6 @@ import static org.junit.Assert.*;
*/
public final strictfp class LinearTransformBuilderTest extends TestCase {
/**
- * Tolerance threshold for strict floating point comparisons. This is used when the math transform has
- * been built from exactly 3 points, in which case we expect an exact solution without rounding errors
- * at the scale of {@code double} type since the implementation use double-double arithmetic.
- */
- private static final double STRICT = 0;
-
- /**
* Tests a very simple case where an exact answer is expected.
*/
@Test
@@ -65,6 +58,9 @@ public final strictfp class LinearTransf
/**
* Tests a very simple case where an exact answer is expected.
+ * Tolerance threshold is set to zero because the math transform has been built from exactly 3 points,
+ * in which case we expect an exact solution without rounding errors at the scale of the {@code double}
+ * type. This is possible because SIS implementation uses double-double arithmetic.
*/
@Test
public void testMinimalist2D() {
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] Fri May 15 19:42:41 2015
@@ -64,12 +64,6 @@ public abstract strictfp class MatrixTes
protected static final boolean DETERMINIST = !DoubleDouble.DISABLED;
/**
- * A constant for any test in this class or a subclass which expect
- * a floating point value to be strictly equals to an other value.
- */
- static final double STRICT = 0;
-
- /**
* Tolerance factor for comparisons of floating point numbers between SIS and JAMA implementation,
* which is {@value}. Note that the matrix element values used in this class vary between 0 and 100,
* and the {@code StrictMath.ulp(100.0)} value is approximatively 1.4E-14.
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -47,11 +47,6 @@ import static org.apache.sis.test.Metada
@DependsOn(DefaultParameterDescriptorGroupTest.class)
public final strictfp class ContextualParametersTest extends TestCase {
/**
- * For floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Creates an instance to use for testing purpose.
*/
private static ContextualParameters create(final int srcDim, final int dstDim) {
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -35,11 +35,6 @@ import static org.apache.sis.test.Assert
*/
public final strictfp class MathTransformsTest extends TestCase {
/**
- * For floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Creates a dummy transform for testing purpose.
* The transform has the folowing properties:
*
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -38,11 +38,6 @@ import static org.apache.sis.test.Assert
@DependsOn(ExponentialTransform1DTest.class)
public final class TransferFunctionTest extends TestCase {
/**
- * For floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* Tests the creation of a linear transfer function.
*/
@Test
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] Fri May 15 19:42:41 2015
@@ -57,11 +57,6 @@ import static org.apache.sis.internal.ut
*/
public strictfp class ReferencingAssert extends MetadataAssert {
/**
- * The tolerance threshold for strict comparisons of floating point values.
- */
- private static final double STRICT = 0;
-
- /**
* For subclass constructor only.
*/
protected ReferencingAssert() {
@@ -153,8 +148,8 @@ public strictfp class ReferencingAssert
assertEquals("name", name, axis.getName().getCode());
assertEquals("abbreviation", abbreviation, axis.getAbbreviation());
assertEquals("direction", direction, axis.getDirection());
- assertEquals("minimumValue", minimumValue, axis.getMinimumValue(), STRICT);
- assertEquals("maximumValue", maximumValue, axis.getMaximumValue(), STRICT);
+ assertEquals("minimumValue", minimumValue, axis.getMinimumValue(), TestCase.STRICT);
+ assertEquals("maximumValue", maximumValue, axis.getMaximumValue(), TestCase.STRICT);
assertEquals("unit", unit, axis.getUnit());
assertEquals("rangeMeaning", rangeMeaning, axis.getRangeMeaning());
}
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -59,11 +59,6 @@ import static org.apache.sis.test.TestUt
})
public final strictfp class ReferencingInMetadataTest extends XMLTestCase {
/**
- * Tolerance threshold for strict floating point comparisons.
- */
- private static final double STRICT = 0;
-
- /**
* The resource file which contains an XML representation
* of a {@link Metadata} object with a {@link VerticalCRS}.
*/
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Fri May 15 19:42:41 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,
@@ -126,9 +127,12 @@ import org.junit.BeforeClass;
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.DefaultProjectedCRSTest.class,
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,
org.apache.sis.referencing.crs.DefaultCompoundCRSTest.class,
org.apache.sis.referencing.crs.HardCodedCRSTest.class,
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java [UTF-8] Fri May 15 19:42:41 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<Class<?>>();
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] Fri May 15 19:42:41 2015
@@ -25,11 +25,14 @@ import java.util.ServiceConfigurationErr
/**
* Default factories defined in the {@code sis-utility} module.
* This is a temporary placeholder until we leverage the "dependency injection" pattern.
+ * A candidate replacement is JSR-330.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
* @version 0.6
* @module
+ *
+ * @see <a href="https://jcp.org/en/jsr/detail?id=330">JSR-330</a>
*/
public final class DefaultFactories extends SystemListener {
/**
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java [UTF-8] Fri May 15 19:42:41 2015
@@ -24,7 +24,7 @@ package org.apache.sis.internal.system;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.6
* @module
*/
public final class Semaphores {
@@ -39,11 +39,11 @@ public final class Semaphores {
public static final byte COMPARING = 1;
/**
- * A flag to indicate that {@link org.apache.sis.referencing.operation.DefaultSingleOperation}
- * is querying {@code org.apache.sis.referencing.operation.transform.ConcatenatedTransform} in
- * the intend to format WKT (normally a {@code "PROJCS"} element).
+ * A flag to indicate that {@link org.apache.sis.referencing.operation.AbstractCoordinateOperation}
+ * is querying parameters of a {@code MathTransform} enclosed in the operation. This is often in the
+ * intend to format WKT of a {@code "ProjectedCRS"} element.
*/
- public static final byte PROJCS = 2;
+ public static final byte ENCLOSED_IN_OPERATION = 2;
/**
* A flag to indicate that empty collections should be returned as {@code null}. Returning null
@@ -71,7 +71,7 @@ public final class Semaphores {
/**
* Returns {@code true} if the given flag is set.
*
- * @param flag One of {@link #COMPARING}, {@link #PROJCS} or other constants.
+ * @param flag One of {@link #COMPARING}, {@link #ENCLOSED_IN_OPERATION} or other constants.
* @return {@code true} if the given flag is set.
*/
public static boolean query(final byte flag) {
@@ -82,7 +82,7 @@ public final class Semaphores {
/**
* Sets the given flag.
*
- * @param flag One of {@link #COMPARING}, {@link #PROJCS} or other constants.
+ * @param flag One of {@link #COMPARING}, {@link #ENCLOSED_IN_OPERATION} or other constants.
* @return {@code true} if the given flag was already set.
*/
public static boolean queryAndSet(final byte flag) {
@@ -99,7 +99,7 @@ public final class Semaphores {
/**
* Clears the given flag.
*
- * @param flag One of {@link #COMPARING}, {@link #PROJCS} or other constants.
+ * @param flag One of {@link #COMPARING}, {@link #ENCLOSED_IN_OPERATION} or other constants.
*/
public static void clear(final byte flag) {
final Semaphores s = FLAGS.get();
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] Fri May 15 19:42:41 2015
@@ -50,7 +50,7 @@ import org.apache.sis.internal.jdk7.Obje
*
* <p>Read-only subclasses need to implement the following methods:</p>
* <ul>
- * <li>{@link #size()}</li>
+ * <li>{@link #size()} (not mandatory but recommended)</li>
* <li>{@link #get(Object)}</li>
* <li>{@link #entryIterator()} (non-standard method)</li>
* </ul>
@@ -69,7 +69,7 @@ import org.apache.sis.internal.jdk7.Obje
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.6
* @module
*/
public abstract class AbstractMap<K,V> implements Map<K,V> {
@@ -133,19 +133,114 @@ public abstract class AbstractMap<K,V> i
}
/**
+ * An implementation of {@link EntryIterator} which delegates its work to a standard iterator.
+ * Subclasses can modify the {@link #value} or other properties during iteration.
+ *
+ * <p>This method does not implement the {@link #remove()} method, thus assuming an unmodifiable map
+ * (which is consistent with the default implementation of {@link AbstractMap} methods).
+ * Modifiable maps should override {@code remove()} themselves.</p>
+ *
+ * @param <K> The type of keys maintained by the map.
+ * @param <V> The type of mapped values.
+ *
+ * @see AbstractMap#entryIterator()
+ */
+ protected static class IteratorAdapter<K,V> extends EntryIterator<K,V> {
+ /**
+ * The standard iterator on which to delegate the work.
+ * It is safe to change this value before to invoke {@link #next()}.
+ */
+ protected Iterator<Entry<K,V>> it;
+
+ /**
+ * The entry found by the last call to {@link #next()}.
+ */
+ protected Entry<K,V> entry;
+
+ /**
+ * The value of <code>{@linkplain #entry}.getValue()}</code>.
+ * It is safe to change this value after {@link #next()} invocation.
+ */
+ protected V value;
+
+ /**
+ * Creates a new adapter initialized to the entry iterator of the given map.
+ *
+ * @param map The map from which to return entries.
+ */
+ public IteratorAdapter(final Map<K,V> map) {
+ it = map.entrySet().iterator();
+ }
+
+ /**
+ * Moves to the next entry having a non-null value. If this method returns {@code true}, then the
+ * {@link #entry} and {@link #value} fields are set to the properties of the new current entry.
+ * Otherwise (if this method returns {@code false}) the {@link #entry} and {@link #value} fields
+ * are undetermined.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ protected boolean next() {
+ do {
+ if (!it.hasNext()) {
+ return false;
+ }
+ entry = it.next();
+ value = entry.getValue();
+ } while (value == null);
+ return true;
+ }
+
+ /**
+ * Returns <code>{@linkplain #entry}.getKey()}</code>.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ protected K getKey() {
+ return entry.getKey();
+ }
+
+ /**
+ * Returns {@link #value}, which was itself initialized to <code>{@linkplain #entry}.getValue()}</code>.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ protected V getValue() {
+ return value;
+ }
+ }
+
+ /**
* For subclass constructors.
*/
protected AbstractMap() {
}
/**
+ * Returns the number of key-value mappings in this map.
+ * The default implementation count the number of values returned by {@link #entryIterator()}.
+ * Subclasses should implement a more efficient method.
+ */
+ @Override
+ public int size() {
+ int count = 0;
+ for (final EntryIterator<K,V> it = entryIterator(); it.next();) {
+ if (++count == Integer.MAX_VALUE) break;
+ }
+ return count;
+ }
+
+ /**
* Returns {@code true} if this map contains no element.
*
* @return {@code true} if this map contains no element.
*/
@Override
public boolean isEmpty() {
- return size() == 0;
+ return !entryIterator().next();
}
/**
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Fri May 15 19:42:41 2015
@@ -522,15 +522,17 @@ next: for (final Class<?> candidat
* of interfaces. Only interfaces assignable to {@code baseInterface} are compared.
* Declaration order doesn't matter.
*
- * For example in ISO 19111, different interfaces exist for different coordinate system (CS)
- * geometries ({@code CartesianCS}, {@code PolarCS}, etc.). One can check if two implementations
- * have the same geometry with the following code:
+ * <div class="note"><b>Example:</b>
+ * in ISO 19111, different interfaces exist for different coordinate system (CS) geometries
+ * ({@code CartesianCS}, {@code PolarCS}, etc.). One can check if two implementations have
+ * the same geometry with the following code:
*
* {@preformat java
* if (implementSameInterfaces(cs1, cs2, CoordinateSystem.class)) {
* // The two Coordinate System are of the same kind.
* }
* }
+ * </div>
*
* @param object1 The first object to check for interfaces.
* @param object2 The second object to check for interfaces.
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] Fri May 15 19:42:41 2015
@@ -147,7 +147,7 @@ public final class ObjectConverters exte
}
/**
- * Returns a map whose whose keys and values are derived <cite>on-the-fly</cite> from the given map.
+ * Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.
* Conversions from the original entries to the derived entries are performed when needed
* by invoking the {@link ObjectConverter#apply(Object)} method on the given converters.
*
@@ -175,7 +175,7 @@ public final class ObjectConverters exte
}
/**
- * Returns a map whose whose keys are derived <cite>on-the-fly</cite> from the given map.
+ * Returns a map whose keys are derived <cite>on-the-fly</cite> from the given map.
* Conversions from the original keys to the derived keys are performed when needed by
* invoking the {@link ObjectConverter#apply(Object)} method on the given converter.
*
@@ -203,7 +203,7 @@ public final class ObjectConverters exte
}
/**
- * Returns a map whose whose values are derived <cite>on-the-fly</cite> from the given map.
+ * Returns a map whose values are derived <cite>on-the-fly</cite> from the given map.
* Conversions from the original values to the derived values are performed when needed by
* invoking the {@link ObjectConverter#apply(Object)} method on the given converter.
*
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] Fri May 15 19:42:41 2015
@@ -164,7 +164,7 @@ public final class Containers extends St
}
/**
- * Returns a map whose whose keys and values are derived <cite>on-the-fly</cite> from the given map.
+ * Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.
* Conversions from the original entries to the derived entries are performed when needed
* by invoking the {@link ObjectConverter#apply(Object)} method on the given converters.
* Those conversions are repeated every time a {@code Map} method is invoked; there is no cache.
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Fri May 15 19:42:41 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;
@@ -951,7 +956,7 @@ public final class Errors extends Indexe
public static final short UnresolvedFeatureName_1 = 164;
/**
- * Coordinate reference system is unspecified.
+ * Coordinate reference system has not been specified.
*/
public static final short UnspecifiedCRS = 173;
@@ -961,6 +966,11 @@ public final class Errors extends Indexe
public static final short UnspecifiedFormatForClass_1 = 126;
/**
+ * Parameter values have not been specified.
+ */
+ public static final short UnspecifiedParameterValues = 185;
+
+ /**
* Can not handle instances of ‘{0}’ because arbitrary implementations are not yet supported.
*/
public static final short UnsupportedImplementation_1 = 127;
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Fri May 15 19:42:41 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.
@@ -201,8 +202,9 @@ UnmodifiableObject_1 = This
UnparsableStringForClass_2 = Text \u201c{1}\u201d can not be parsed as an object of type \u2018{0}\u2019.
UnparsableStringForClass_3 = Text \u201c{1}\u201d can not be parsed as an object of type \u2018{0}\u2019, because of the \u201c{2}\u201d characters.
UnresolvedFeatureName_1 = Feature named \u201c{0}\u201d has not yet been resolved.
-UnspecifiedCRS = Coordinate reference system is unspecified.
+UnspecifiedCRS = Coordinate reference system has not been specified.
UnspecifiedFormatForClass_1 = No format is specified for objects of class \u2018{0}\u2019.
+UnspecifiedParameterValues = Parameter values have not been specified.
UnsupportedImplementation_1 = Can not handle instances of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
UnsupportedOperation_1 = The \u2018{0}\u2019 operation is unsupported.
UnsupportedType_1 = The \u2018{0}\u2019 type is unsupported.
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Fri May 15 19:42:41 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.
@@ -189,6 +190,7 @@ UnmodifiableMetadata = Cett
UnmodifiableObject_1 = Cette instance de \u2018{0}\u2019 n\u2019est pas modifiable.
UnspecifiedCRS = Le syst\u00e8me de r\u00e9f\u00e9rence des coordonn\u00e9es n\u2019a pas \u00e9t\u00e9 sp\u00e9cifi\u00e9.
UnspecifiedFormatForClass_1 = Aucun format n\u2019est sp\u00e9cifi\u00e9 pour les objets de classe \u2018{0}\u2019.
+UnspecifiedParameterValues = Les valeurs des param\u00e8tres n\u2019ont pas \u00e9t\u00e9 sp\u00e9cifi\u00e9es.
UnparsableStringForClass_2 = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019.
UnparsableStringForClass_3 = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u00ab\u202f{2}\u202f\u00bb.
UnresolvedFeatureName_1 = L\u2019entit\u00e9 nomm\u00e9e \u00ab\u202f{0}\u202f\u00bb n\u2019a pas encore \u00e9t\u00e9 r\u00e9solue.
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] Fri May 15 19:42:41 2015
@@ -423,14 +423,16 @@ public final class XML extends Static {
/**
* Unmarshall an object from the given string.
+ * Note that the given argument is the XML document itself,
+ * <strong>not</strong> a URL to a XML document.
*
- * @param input The XML representation of an object.
+ * @param xml The XML representation of an object.
* @return The object unmarshalled from the given input.
* @throws JAXBException If an error occurred during the unmarshalling.
*/
- public static Object unmarshal(final String input) throws JAXBException {
- ensureNonNull("input", input);
- final StringReader in = new StringReader(input);
+ public static Object unmarshal(final String xml) throws JAXBException {
+ ensureNonNull("input", xml);
+ final StringReader in = new StringReader(xml);
final MarshallerPool pool = getPool();
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
final Object object = unmarshaller.unmarshal(in);
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -50,7 +50,6 @@ public final strictfp class AbstractMapT
private final List<String> values = new ArrayList<String>(Arrays.asList("one", "two", "three"));
@Override public void clear () { values.clear();}
- @Override public int size () {return values.size();}
@Override public String get (Object k) {return values.get(((Integer) k) - 1);}
@Override public String put (Integer k, String v) {return values.set(k - 1, v);}
@Override protected boolean addKey (Integer k) {return values.add(k == 4 ? "four" : "other");}
@@ -58,7 +57,7 @@ public final strictfp class AbstractMapT
@Override protected EntryIterator<Integer,String> entryIterator() {
return new EntryIterator<Integer,String>() {
private int key;
- @Override protected boolean next() {return ++key <= size();}
+ @Override protected boolean next() {return ++key <= values.size();}
@Override protected Integer getKey() {return key;}
@Override protected String getValue() {return get(key);}
};
@@ -68,15 +67,16 @@ public final strictfp class AbstractMapT
/**
* Tests {@link AbstractMap#keySet()}, {@link AbstractMap#values()} and {@link AbstractMap#entrySet()}.
* This method will also opportunistically tests basic methods like {@link AbstractMap#isEmpty()} and
- * {@link AbstractMap#containsValue(Object)}. This test does not write in the map.
+ * {@link AbstractMap#containsValue(Object)}. This test does not add new values in the map.
*/
@Test
public void testReadOnly() {
final Count map = new Count();
- assertFalse("isEmpty", map.isEmpty());
- assertTrue ("containsKey", map.containsKey(3));
- assertTrue ("containsValue", map.containsValue("three"));
- assertFalse("containsValue", map.containsValue("six"));
+ assertEquals("size", 3, map.size());
+ assertFalse ("isEmpty", map.isEmpty());
+ assertTrue ("containsKey", map.containsKey(3));
+ assertTrue ("containsValue", map.containsValue("three"));
+ assertFalse ("containsValue", map.containsValue("six"));
final Collection<Integer> keys = map.keySet();
assertTrue("contains", keys.contains(3));
@@ -97,11 +97,15 @@ public final strictfp class AbstractMapT
}, entries.toArray());
map.clear();
- assertFalse("containsValue", map.containsValue("three"));
- assertTrue ("isEmpty", map.isEmpty());
- assertTrue ("isEmpty", keys.isEmpty());
- assertTrue ("isEmpty", values.isEmpty());
- assertTrue ("isEmpty", entries.isEmpty());
+ assertFalse ("containsValue", map.containsValue("three"));
+ assertTrue ("isEmpty", map .isEmpty());
+ assertTrue ("isEmpty", keys .isEmpty());
+ assertTrue ("isEmpty", values .isEmpty());
+ assertTrue ("isEmpty", entries.isEmpty());
+ assertEquals("size", 0, map .size());
+ assertEquals("size", 0, keys .size());
+ assertEquals("size", 0, values .size());
+ assertEquals("size", 0, entries.size());
}
/**
@@ -112,7 +116,9 @@ public final strictfp class AbstractMapT
@DependsOnMethod("testReadOnly")
public void testAddKey() {
final Count map = new Count();
+ assertEquals("size", 3, map.size());
assertTrue(map.keySet().add(4));
+ assertEquals("size", 4, map.size());
assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
new SimpleEntry<Integer,String>(1, "one"),
new SimpleEntry<Integer,String>(2, "two"),
@@ -129,7 +135,9 @@ public final strictfp class AbstractMapT
@DependsOnMethod("testReadOnly")
public void testAddValue() {
final Count map = new Count();
+ assertEquals("size", 3, map.size());
assertTrue(map.values().add("quatre"));
+ assertEquals("size", 4, map.size());
assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
new SimpleEntry<Integer,String>(1, "one"),
new SimpleEntry<Integer,String>(2, "two"),
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -63,11 +63,6 @@ public final strictfp class DoubleDouble
private static final double PRODUCT_TOLERANCE_FACTOR = 1E-15;
/**
- * Tolerance threshold for strict comparisons of floating point values.
- */
- private static final double STRICT = 0;
-
- /**
* The random number generator to use for the test.
*/
private final Random random = TestUtilities.createRandomNumberGenerator();
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -40,11 +40,6 @@ import static org.apache.sis.math.Decima
@DependsOn(org.apache.sis.internal.util.NumericsTest.class)
public final strictfp class DecimalFunctionsTest extends TestCase {
/**
- * Tolerance threshold for strict comparisons of floating point values.
- */
- private static final double STRICT = 0;
-
- /**
* Verifies the values of {@link DecimalFunctions#EXPONENT_FOR_ZERO}.
*/
@Test
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -45,11 +45,6 @@ import org.apache.sis.internal.jdk8.JDK8
})
public final strictfp class MathFunctionsTest extends TestCase {
/**
- * Tolerance threshold for strict comparisons of floating point values.
- */
- private static final double STRICT = 0;
-
- /**
* Small number for floating point comparisons.
*/
private static final double EPS = 1E-12;
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -52,11 +52,6 @@ public final strictfp class StatisticsTe
private static final double EPS = 1E-10;
/**
- * Tolerance threshold for strict comparisons of floating point values.
- */
- private static final double STRICT = 0;
-
- /**
* Tests the initial state of newly constructed instance.
*/
@Test
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] Fri May 15 19:42:41 2015
@@ -56,6 +56,16 @@ import static org.apache.sis.test.TestCo
@RunWith(TestRunner.class)
public abstract strictfp class TestCase {
/**
+ * Tolerance threshold for strict comparisons of floating point numbers.
+ * This constant can be used like below, where {@code expected} and {@code actual} are {@code double} values:
+ *
+ * {@preformat java
+ * assertEquals(expected, actual, STRICT);
+ * }
+ */
+ protected static final double STRICT = 0;
+
+ /**
* A flag for code that are pending future SIS development before to be enabled.
* This flag is always set to {@code false}. It shall be used as below:
*