sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1741229 - in /sis/branches/JDK7: ./ core/sis-referencing/src/test/java/org/apache/sis/io/wkt/ core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/ core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/tr...
Date Wed, 27 Apr 2016 11:16:38 GMT
Author: desruisseaux
Date: Wed Apr 27 11:16:38 2016
New Revision: 1741229

URL: http://svn.apache.org/viewvc?rev=1741229&view=rev
Log:
Merge more determinist tests from the JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/GeodeticObjectFactoryTest.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/ProjectiveTransformTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 27 11:16:38 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1740992
+/sis/branches/JDK8:1584960-1741224
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java?rev=1741229&r1=1741228&r2=1741229&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java
[UTF-8] Wed Apr 27 11:16:38 2016
@@ -23,11 +23,11 @@ import org.opengis.referencing.datum.Ver
 import org.opengis.util.FactoryException;
 import org.opengis.test.wkt.CRSParserTest;
 import org.apache.sis.internal.metadata.AxisNames;
+import org.apache.sis.test.TestRunner;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 import org.junit.Ignore;
 import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 
 import static org.junit.Assert.*;
 
@@ -41,7 +41,7 @@ import static org.junit.Assert.*;
  * @version 0.7
  * @module
  */
-@RunWith(JUnit4.class)
+@RunWith(TestRunner.class)
 @DependsOn(GeodeticObjectParserTest.class)
 public final strictfp class WKTParserTest extends CRSParserTest {
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/GeodeticObjectFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/GeodeticObjectFactoryTest.java?rev=1741229&r1=1741228&r2=1741229&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/GeodeticObjectFactoryTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/GeodeticObjectFactoryTest.java
[UTF-8] Wed Apr 27 11:16:38 2016
@@ -49,9 +49,9 @@ import org.apache.sis.io.wkt.Convention;
 
 // Test dependencies
 import org.opengis.test.referencing.ObjectFactoryTest;
+import org.apache.sis.test.TestRunner;
 import org.apache.sis.test.DependsOn;
 import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -67,7 +67,7 @@ import static org.apache.sis.test.Metada
  * @version 0.7
  * @module
  */
-@RunWith(JUnit4.class)
+@RunWith(TestRunner.class)
 @DependsOn({
     org.apache.sis.referencing.crs.DefaultGeocentricCRSTest.class,
     org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class,

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=1741229&r1=1741228&r2=1741229&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] Wed Apr 27 11:16:38 2016
@@ -24,8 +24,8 @@ import org.opengis.referencing.operation
 // Test imports
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestRunner;
 import static org.opengis.test.Assert.*;
 
 
@@ -38,7 +38,7 @@ import static org.opengis.test.Assert.*;
  * @version 0.5
  * @module
  */
-@RunWith(JUnit4.class)
+@RunWith(TestRunner.class)
 @DependsOn(ProjectiveTransformTest.class)
 public final strictfp class LinearTransformTest extends ProjectiveTransformTest {
     /**

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=1741229&r1=1741228&r2=1741229&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] Wed Apr 27 11:16:38 2016
@@ -29,9 +29,9 @@ import org.apache.sis.parameter.Paramete
 
 // Test imports
 import org.opengis.test.Validators;
+import org.apache.sis.test.TestRunner;
 import org.apache.sis.test.DependsOn;
 import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 import org.junit.After;
 import org.junit.Test;
 import static org.opengis.test.Assert.*;
@@ -51,7 +51,7 @@ import org.opengis.test.referencing.Affi
  * @version 0.7
  * @module
  */
-@RunWith(JUnit4.class)
+@RunWith(TestRunner.class)
 @DependsOn({AbstractMathTransformTest.class, ScaleTransformTest.class})
 public strictfp class ProjectiveTransformTest extends AffineTransformTest {
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1741229&r1=1741228&r2=1741229&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
Wed Apr 27 11:16:38 2016
@@ -268,21 +268,29 @@ public final class TestRunner extends Bl
      * @param methods The methods to sort.
      */
     private static void sortDependantTestsLast(final FrameworkMethod[] methods) {
-        Set<String> dependencies = null;
+        final Set<String> dependencies = new HashSet<>();
+        int retryCount = methods.length;
         for (int i=methods.length-1; --i>=0;) {
             final FrameworkMethod method = methods[i];
             final DependsOnMethod depend = method.getAnnotation(DependsOnMethod.class);
             if (depend != null) {
-                if (dependencies == null) {
-                    dependencies = new HashSet<>();
-                }
                 dependencies.addAll(Arrays.asList(depend.value()));
                 for (int j=methods.length; --j>i;) {
                     if (dependencies.contains(methods[j].getName())) {
-                        // Found a method j which is a dependency of i. Move i after j.
-                        // The order of other methods relative to j is left unchanged.
+                        /*
+                         * Found a method j which is a dependency of i. Move i after j.
+                         * The order of other methods relative to j is left unchanged.
+                         *
+                         * As a result of this move, maybe some methods between i and j
+                         * need to be revisited. We should restart the iteration from j.
+                         * Over unlimited retries could cause an infinite loop, so we
+                         * arbitrarily limit the amount of time we retry.
+                         */
                         System.arraycopy(methods, i+1, methods, i, j-i);
                         methods[j] = method;
+                        if (--retryCount >= 0) {
+                            i = j;                      // Revisit the methods between i
and j.
+                        }
                         break;
                     }
                 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java?rev=1741229&r1=1741228&r2=1741229&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java
[UTF-8] Wed Apr 27 11:16:38 2016
@@ -17,11 +17,11 @@
 package org.apache.sis.util.iso;
 
 import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 import org.junit.BeforeClass;
 import org.junit.AfterClass;
 import org.opengis.test.util.NameTest;
 import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestRunner;
 
 
 /**
@@ -33,7 +33,7 @@ import org.apache.sis.test.DependsOn;
  * @version 0.3
  * @module
  */
-@RunWith(JUnit4.class)
+@RunWith(TestRunner.class)
 @DependsOn(AbstractNameTest.class)
 public final strictfp class DefaultNameFactoryTest extends NameTest {
     /**



Mime
View raw message