This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 4d83b73645 Modification of the heuritic rules for sorting the import 
statements used for tests.
4d83b73645 is described below

commit 4d83b7364597c3585009d4aa3ca21205cdd1cd01
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Wed Feb 21 17:00:45 2024 +0100

    Modification of the heuritic rules for sorting the import statements used 
for tests.
---
 .../apache/sis/buildtools/coding/ReorganizeImports.java   | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/buildSrc/src/main/java/org/apache/sis/buildtools/coding/ReorganizeImports.java
 
b/buildSrc/src/main/java/org/apache/sis/buildtools/coding/ReorganizeImports.java
index d532b752e1..76865f7e99 100644
--- 
a/buildSrc/src/main/java/org/apache/sis/buildtools/coding/ReorganizeImports.java
+++ 
b/buildSrc/src/main/java/org/apache/sis/buildtools/coding/ReorganizeImports.java
@@ -150,15 +150,12 @@ public final class ReorganizeImports extends 
SimpleFileVisitor<Path> {
         "org.junit",
         "org.opengis.test",
         "org.apache.sis.image.TiledImageMock",
-        "org.apache.sis.metadata.sql.TestDatabase",
         "org.apache.sis.referencing.cs.HardCodedAxes",
         "org.apache.sis.referencing.cs.HardCodedCS",
         "org.apache.sis.referencing.crs.HardCodedCRS",
         "org.apache.sis.referencing.datum.HardCodedDatum",
         "org.apache.sis.referencing.operation.HardCodedConversions",
-        "org.apache.sis.metadata.iso.citation.HardCodedCitations",
-        "org.apache.sis.metadata.sql.TestDatabase",
-        "org.apache.sis.storage.gpx.TestData"
+        "org.apache.sis.metadata.iso.citation.HardCodedCitations"
     };
 
     /**
@@ -455,9 +452,13 @@ public final class ReorganizeImports extends 
SimpleFileVisitor<Path> {
                 element = element.substring(STATIC.length()).trim();
             }
             if (element.startsWith("org.apache.sis")) {
-                if (element.contains(".test.") || element.endsWith("Test") ||
-                        (element.contains("Assert") && 
!element.contains("ArgumentCheckByAssertion")))
-                {
+                if (element.contains(".test.") || element.endsWith("Test") || 
element.endsWith("TestCase")) {
+                    return true;
+                }
+                if (element.regionMatches(element.lastIndexOf('.')+1, "Test", 
0, 4)) {
+                    return true;
+                }
+                if (element.contains("Assert") && 
!element.contains("ArgumentCheckByAssertion")) {
                     return true;
                 }
             }

Reply via email to