sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1707810 - /sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
Date Fri, 09 Oct 2015 20:32:12 GMT
Author: desruisseaux
Date: Fri Oct  9 20:32:11 2015
New Revision: 1707810

URL: http://svn.apache.org/viewvc?rev=1707810&view=rev
Log:
Avoid a random test failure.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java?rev=1707810&r1=1707809&r2=1707810&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
[UTF-8] Fri Oct  9 20:32:11 2015
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.referencing.operation.projection;
 
+import java.util.Random;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.internal.referencing.Formulas;
@@ -24,7 +25,6 @@ import org.apache.sis.parameter.Paramete
 import org.apache.sis.referencing.operation.transform.CoordinateDomain;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
-import org.apache.sis.test.TestUtilities;
 import org.junit.Test;
 
 import static java.lang.StrictMath.toRadians;
@@ -152,7 +152,11 @@ public final strictfp class TransverseMe
     @DependsOnMethod("testTransverseMercator")
     public void testSerialization() throws FactoryException, TransformException {
         createNormalizedProjection(true, 40);
-        final double[] source = CoordinateDomain.GEOGRAPHIC_RADIANS_HALF_λ.generateRandomInput(TestUtilities.createRandomNumberGenerator(),
2, 10);
+        /*
+         * Use a fixed seed for the random number generator in this test, because in case
of failure this class will not
+         * report which seed it used. This limitation exists because this test class does
not extend the SIS TestCase.
+         */
+        final double[] source = CoordinateDomain.GEOGRAPHIC_RADIANS_HALF_λ.generateRandomInput(new
Random(5346144739450824145L), 2, 10);
         final double[] target = new double[source.length];
         transform.transform(source, 0, target, 0, 10);
         transform = assertSerializedEquals(transform);



Mime
View raw message