sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1605109 - in /sis/branches/JDK7: ./ core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ core/sis-referencing/src/test/java/or...
Date Tue, 24 Jun 2014 15:25:09 GMT
Author: desruisseaux
Date: Tue Jun 24 15:25:08 2014
New Revision: 1605109

URL: http://svn.apache.org/r1605109
Log:
Merge from the JDK8 branch.

Added:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1D.java
      - copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LogarithmicTransform1D.java
      - copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LogarithmicTransform1D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransferFunction.java
      - copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransferFunction.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomainTest.java
      - copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomainTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1DTest.java
      - copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1DTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
      - copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PowerTransform1D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1600998-1605107

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -818,7 +818,7 @@ public abstract class AbstractMathTransf
     public final boolean equals(final Object object) {
         final boolean eq = equals(object, ComparisonMode.STRICT);
         // If objects are equal, then they must have the same hash code value.
-        assert !eq || hashCode() == object.hashCode() : this;
+        assert !eq || computeHashCode() == ((AbstractMathTransform) object).computeHashCode()
: this;
         return eq;
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -37,6 +37,16 @@ final class ConstantTransform1D extends 
     private static final long serialVersionUID = -1583675681650985947L;
 
     /**
+     * A transform for the positive zero constant.
+     */
+    static final ConstantTransform1D ZERO = new ConstantTransform1D(0);
+
+    /**
+     * A transform for the one constant.
+     */
+    static final ConstantTransform1D ONE = new ConstantTransform1D(1);
+
+    /**
      * Constructs a new constant transform.
      *
      * @param offset The {@code offset} term in the linear equation.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -103,6 +103,8 @@ class LinearTransform1D extends Abstract
             return IdentityTransform1D.INSTANCE;
         }
         if (scale == 0) {
+            if (offset == 0) return ConstantTransform1D.ZERO;
+            if (offset == 1) return ConstantTransform1D.ONE;
             return new ConstantTransform1D(offset);
         }
         return new LinearTransform1D(scale, offset);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -69,11 +69,15 @@ public class PassThroughTransform extend
 
     /**
      * Index of the first affected ordinate.
+     *
+     * @see #getModifiedCoordinates()
      */
     final int firstAffectedOrdinate;
 
     /**
      * Number of unaffected ordinates after the affected ones.
+     *
+     * @see #getModifiedCoordinates()
      */
     final int numTrailingOrdinates;
 
@@ -253,9 +257,16 @@ public class PassThroughTransform extend
      * Returns the ordered sequence of positive integers defining the positions in a source
      * coordinate tuple of the coordinates affected by this pass-through operation.
      *
+     * <div class="note"><b>API note:</b> this method is final for now
because most of Apache SIS code do
+     * not use the {@code modifiedCoordinates} array. Instead, SIS uses the {@code firstAffectedOrdinate}
+     * and {@code numTrailingOrdinates} information provided to the constructor. Consequently
overriding
+     * this method may be misleading since it would be ignored by SIS. We do not want to
make the "really
+     * used" fields public in order to keep the flexibility to replace them by a {@code modifiedCoordinates}
+     * array in a future SIS version.</div>
+     *
      * @return Indices of the modified source coordinates.
      */
-    public int[] getModifiedCoordinates() {
+    public final int[] getModifiedCoordinates() {
         final int[] index = new int[subTransform.getSourceDimensions()];
         for (int i=0; i<index.length; i++) {
             index[i] = i + firstAffectedOrdinate;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PowerTransform1D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PowerTransform1D.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PowerTransform1D.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PowerTransform1D.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -31,6 +31,11 @@ import org.apache.sis.util.ComparisonMod
  * <p>Before to make this class public (if we do), we need to revisit the class name,
define
  * parameters and improve the {@link #concatenate(MathTransform, boolean)} method.</p>
  *
+ * {@section Serialization}
+ * Serialized instances of this class are not guaranteed to be compatible with future SIS
versions.
+ * Serialization should be used only for short term storage or RMI between applications running
the
+ * same SIS version.
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5 (derived from geotk-3.17)
  * @version 0.5
@@ -73,7 +78,7 @@ final class PowerTransform1D extends Abs
      */
     public static MathTransform1D create(final double power) {
         if (power == 1) return IdentityTransform1D.INSTANCE;
-        if (power == 0) return new ConstantTransform1D(1);
+        if (power == 0) return ConstantTransform1D.ONE;
         return new PowerTransform1D(power);
     }
 
@@ -192,7 +197,7 @@ final class PowerTransform1D extends Abs
     @Override
     public boolean equals(final Object object, final ComparisonMode mode) {
         if (object == this) {
-            return true; // Slight optimization
+            return true;  // Optimization for a common case.
         }
         if (super.equals(object, mode)) {
             return Numerics.equals(power, ((PowerTransform1D) object).power);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -34,15 +34,18 @@
  * In the 2D case, Apache SIS provides instances of the standard {@link java.awt.geom.AffineTransform}
  * class when possible.
  *
- * <p>{@code MathTransform} usually performs conversions or transformations from points
given in a
+ * <p>This package does not include map projections, which are a special kind of transforms
defined
+ * in their own {@linkplain org.apache.sis.referencing.operation.projection projection} package.</p>
+ *
+ * {@section Non-spatial coordinates}
+ * {@code MathTransform} usually performs conversions or transformations from points given
in a
  * {@linkplain org.apache.sis.referencing.operation.DefaultCoordinateOperation#getSourceCRS()
  * source coordinate reference system} to coordinate values for the same points in the
  * {@linkplain org.apache.sis.referencing.operation.DefaultCoordinateOperation#getTargetCRS()
  * target coordinate reference system}. However the conversions are not necessarily between
CRS;
- * a {@code MathTransform} can also be used for converting the sample values in a raster
for example.</p>
- *
- * <p>This package does not include map projections, which are a special kind of transforms
defined
- * in their own {@linkplain org.apache.sis.referencing.operation.projection projection} package.</p>
+ * a {@code MathTransform} can also be used for converting the sample values in a raster
for example.
+ * Such kind of transforms are named {@linkplain org.apache.sis.referencing.operation.transform.TransferFunction
+ * transfer functions}.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.5 (derived from geotk-1.2)

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -19,17 +19,16 @@ package org.apache.sis.referencing.opera
 import java.util.Arrays;
 import java.util.Random;
 import org.opengis.referencing.operation.TransformException;
+import static java.lang.StrictMath.*;
+import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_FAILURES;
+import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_BUFFER_SIZE;
 
 // Test imports
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
-
 import static org.junit.Assert.*;
-import static java.lang.StrictMath.*;
-import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_FAILURES;
-import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_BUFFER_SIZE;
 
 
 /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -19,12 +19,11 @@ package org.apache.sis.referencing.opera
 import java.util.Random;
 import org.apache.sis.measure.Latitude;
 import org.apache.sis.measure.Longitude;
+import static java.lang.StrictMath.*;
 
 // Test imports
 import org.apache.sis.test.mock.GeodeticDatumMock;
 
-import static java.lang.StrictMath.*;
-
 
 /**
  * The domain of input coordinates.
@@ -144,7 +143,7 @@ public strictfp enum CoordinateDomain {
      * Geographic input coordinates with angles in radians and only half of the longitude
range.
      * Ordinates are in (<var>lambda</var>, <var>phi</var>, <var>height</var>)
order.
      */
-    GEOGRAPHIC_RADIANS_HALF {
+    GEOGRAPHIC_RADIANS_HALF_λ {
         @Override
         double generate(final Random random, final int dimension) {
             final double range;
@@ -249,7 +248,17 @@ public strictfp enum CoordinateDomain {
     },
 
     /**
-     * Gaussian numbers: can be positives or negatives, mostly close to zero but some
+     * Values in the -10 to 10 range.
+     */
+    RANGE_10 {
+        @Override
+        double generate(final Random random, final int dimension) {
+            return random.nextDouble() * 20 - 10;
+        }
+    },
+
+    /**
+     * Gaussian distribution. Numbers can be positives or negatives, mostly close to zero
but some
      * numbers can be arbitrarily large.
      */
     GAUSSIAN;

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -32,7 +32,10 @@ import org.apache.sis.test.DependsOn;
  * @version 0.5
  * @module
  */
-@DependsOn(ProjectiveTransformTest.class)
+@DependsOn({
+    CoordinateDomainTest.class,
+    ProjectiveTransformTest.class
+})
 public final strictfp class CopyTransformTest extends MathTransformTestCase {
     /**
      * Generates random ordinates with approximatively 5% of NaN values in the array.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -19,15 +19,14 @@ package org.apache.sis.referencing.opera
 import java.util.Arrays;
 import java.util.Random;
 import org.opengis.referencing.operation.TransformException;
+import static java.lang.StrictMath.*;
+import static org.apache.sis.referencing.operation.transform.IterationStrategy.*;
 
 // Test imports
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOnMethod;
-
 import static org.junit.Assert.*;
-import static java.lang.StrictMath.*;
-import static org.apache.sis.referencing.operation.transform.IterationStrategy.*;
 
 
 /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -26,7 +26,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 import org.apache.sis.test.DependsOn;
-
 import static org.opengis.test.Assert.*;
 
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -29,6 +29,8 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.SingleOperation;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.MathTransformFactory;
+
+// Test imports
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -18,7 +18,6 @@ package org.apache.sis.referencing.opera
 
 import java.util.Random;
 import java.io.IOException;
-import java.io.PrintStream;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.MathTransform1D;
@@ -31,24 +30,22 @@ import org.opengis.metadata.Identifier;
 import org.apache.sis.parameter.Parameterized;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Classes;
-import org.apache.sis.math.Statistics;
-import org.apache.sis.math.StatisticsFormat;
 import org.apache.sis.io.TableAppender;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.internal.util.Numerics;
+import static java.lang.StrictMath.*;
 
 // Test imports
 import org.opengis.test.Validators;
-import org.opengis.test.CalculationType;
-import org.opengis.test.ToleranceModifier;
 import org.opengis.test.referencing.TransformTestCase;
-import org.apache.sis.test.TestCase;
 import org.apache.sis.test.TestUtilities;
-
-import static java.lang.StrictMath.*;
 import static org.apache.sis.test.ReferencingAssert.*;
 
+// Branch-dependent imports
+import org.opengis.test.CalculationType;
+import org.opengis.test.ToleranceModifier;
+
 
 /**
  * Base class for tests of {@link AbstractMathTransform} implementations.
@@ -315,30 +312,9 @@ public abstract strictfp class MathTrans
         final int numPts    = ORDINATE_COUNT / dimension;
         final Random random = TestUtilities.createRandomNumberGenerator();
         final double[] coordinates = domain.generateRandomInput(random, dimension, numPts);
-        for (int i = Math.round(coordinates.length * propNaN); --i >= 0;) {
+        for (int i = round(coordinates.length * propNaN); --i >= 0;) {
             coordinates[random.nextInt(coordinates.length)] = Double.NaN;
         }
-        if (TestCase.verbose) {
-            final PrintStream out = out();
-            out.print("Random input coordinates for ");
-            out.print(domain); out.println(" domain:");
-            final Statistics[] stats = new Statistics[dimension];
-            for (int i=0; i<stats.length; i++) {
-                stats[i] = new Statistics(null);
-            }
-            for (int i=0; i<coordinates.length; i++) {
-                stats[i % dimension].accept(coordinates[i]);
-            }
-            final StatisticsFormat format = StatisticsFormat.getInstance();
-            format.setBorderWidth(1);
-            try {
-                format.format(stats, out);
-            } catch (IOException e) {
-                throw new AssertionError(e);
-            }
-            out.println();
-            out.flush();
-        }
         return coordinates;
     }
 
@@ -363,7 +339,7 @@ public abstract strictfp class MathTrans
      */
     @Debug
     protected final void printInternalWKT() {
-        final TableAppender table = new TableAppender(out());
+        final TableAppender table = new TableAppender(System.out);
         table.setMultiLinesCells(true);
         table.appendHorizontalSeparator();
         table.append("WKT of “").append(getName()).append('”').nextColumn();
@@ -387,12 +363,4 @@ public abstract strictfp class MathTrans
             throw new AssertionError(e);
         }
     }
-
-    /**
-     * Where to write debugging information.
-     */
-    @Debug
-    private static PrintStream out() {
-        return System.out;
-    }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -27,13 +27,14 @@ import org.apache.sis.util.ArraysExt;
 
 // Test imports
 import org.junit.Test;
-import org.opengis.test.CalculationType;
-import org.opengis.test.ToleranceModifier;
 import org.apache.sis.test.TestUtilities;
 import org.apache.sis.test.DependsOn;
-
 import static org.junit.Assert.*;
 
+// Branch-dependent imports
+import org.opengis.test.CalculationType;
+import org.opengis.test.ToleranceModifier;
+
 
 /**
  * Tests {@link PassThroughTransform}.
@@ -43,7 +44,11 @@ import static org.junit.Assert.*;
  * @version 0.5
  * @module
  */
-@DependsOn(LinearTransformTest.class)
+@DependsOn({
+    CoordinateDomainTest.class,
+    LinearTransformTest.class,
+    ExponentialTransform1DTest.class
+})
 public final strictfp class PassThroughTransformTest extends MathTransformTestCase {
     /**
      * The random number generator to be used in this test.
@@ -106,11 +111,10 @@ public final strictfp class PassThroughT
      *
      * @throws TransformException Should never happen.
      */
-//    TODO
-//    @Test
-//    public void testPassthrough() throws TransformException {
-//        runTest(ExponentialTransform1D.create(10, -2), PassThroughTransform.class);
-//    }
+    @Test
+    public void testPassthrough() throws TransformException {
+        runTest(ExponentialTransform1D.create(10, 2), PassThroughTransform.class);
+    }
 
     /**
      * Tests a pass-through transform built using the given sub-transform.
@@ -163,10 +167,10 @@ public final strictfp class PassThroughT
          *   - passthrough data, to be given to the transform to be tested.
          *   - sub-transform data, which we will use internally for verifying the pass-through
work.
          */
-        final int passthroughDim  = transform.getSourceDimensions();
-        final int subTransformDim = subTransform.getSourceDimensions();
-        final int numPts          = ORDINATE_COUNT / passthroughDim;
-        final double[] passthroughData  = CoordinateDomain.GEOGRAPHIC.generateRandomInput(random,
passthroughDim, numPts);
+        final int      passthroughDim   = transform.getSourceDimensions();
+        final int      subTransformDim  = subTransform.getSourceDimensions();
+        final int      numPts           = ORDINATE_COUNT / passthroughDim;
+        final double[] passthroughData  = CoordinateDomain.RANGE_10.generateRandomInput(random,
passthroughDim, numPts);
         final double[] subTransformData = new double[numPts * subTransformDim];
         Arrays.fill(subTransformData, Double.NaN);
         for (int i=0; i<numPts; i++) {

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -25,15 +25,16 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.parameter.Parameterized;
 
 // Test imports
-import org.opengis.test.referencing.AffineTransformTest;
 import org.opengis.test.Validators;
 import org.apache.sis.test.DependsOn;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 import org.junit.After;
-
 import static org.opengis.test.Assert.*;
 
+// Branch-dependent imports
+import org.opengis.test.referencing.AffineTransformTest;
+
 
 /**
  * Tests the {@link ProjectiveTransform} class by inheriting the tests defined in GeoAPI
conformance module.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Tue Jun 24 15:25:08 2014
@@ -26,7 +26,7 @@ import org.junit.BeforeClass;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @Suite.SuiteClasses({
@@ -40,12 +40,15 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.operation.matrix.NonSquareMatrixTest.class, // Expected to
be last MatrixTestCase - see javadoc.
     org.apache.sis.referencing.operation.matrix.MatricesTest.class,
     org.apache.sis.referencing.operation.matrix.AffineTransforms2DTest.class,
+    org.apache.sis.referencing.operation.transform.CoordinateDomainTest.class,
     org.apache.sis.referencing.operation.transform.IterationStrategyTest.class,
     org.apache.sis.referencing.operation.transform.AbstractMathTransformTest.class,
     org.apache.sis.referencing.operation.transform.ProjectiveTransformTest.class,
     org.apache.sis.referencing.operation.transform.LinearTransformTest.class,
+    org.apache.sis.referencing.operation.transform.ExponentialTransform1DTest.class,
     org.apache.sis.referencing.operation.transform.CopyTransformTest.class,
     org.apache.sis.referencing.operation.transform.PassThroughTransformTest.class,
+    org.apache.sis.referencing.operation.transform.TransferFunctionTest.class,
 
     org.apache.sis.internal.referencing.FormulasTest.class,
     org.apache.sis.internal.referencing.VerticalDatumTypesTest.class,



Mime
View raw message