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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git

commit bea8468e80c7c40b744e1e7c01b424899577545f
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 25 22:03:43 2026 +0000

    Modernize Groovy IT scripts
    
    See https://github.com/apache/maven-invoker-plugin/issues/811.
---
 src/it/announce-generate/verify.groovy             |  2 -
 .../verify.groovy                                  | 54 ++-----------
 .../verify.groovy                                  |  2 -
 src/it/report-changes-interpolation/verify.groovy  | 92 ++++------------------
 src/it/report-changes-skip-snapshots/verify.groovy |  2 -
 .../verify.groovy                                  | 68 +++-------------
 src/it/report-changes-system/verify.groovy         | 58 ++------------
 .../verify.groovy                                  |  6 +-
 8 files changed, 41 insertions(+), 243 deletions(-)

diff --git a/src/it/announce-generate/verify.groovy 
b/src/it/announce-generate/verify.groovy
index ddc223c..4fb189c 100644
--- a/src/it/announce-generate/verify.groovy
+++ b/src/it/announce-generate/verify.groovy
@@ -43,5 +43,3 @@ assert content.contains( 'Removed:' );
 assert content.contains( 'o The element type \" link \" must be terminated by 
the matching end-tag.' );
 
 assert content.contains( 'Deleted the erroneous code.  Issue: MCHANGES-899.' );
-
-return true;
diff --git a/src/it/announcement-generate-custom-template/verify.groovy 
b/src/it/announcement-generate-custom-template/verify.groovy
index 2b38da6..265a434 100644
--- a/src/it/announcement-generate-custom-template/verify.groovy
+++ b/src/it/announcement-generate-custom-template/verify.groovy
@@ -18,55 +18,15 @@
  * under the License.
  */
 
-import java.io.*;
 import java.nio.file.*;
-import java.util.*;
-import java.util.jar.*;
 
-boolean result = true;
+File report = new File( basedir, "target/announcement/test-announce.vm" )
+assert report.exists() : "report file is missing."
+assert !report.isDirectory() : "report file is a directory."
+String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8")
 
-try
-{
-    File report = new File( basedir, "target/announcement/test-announce.vm" );
-    if ( !report.exists() )
-    {
-        System.err.println( "report file is missing." );
-        return false;
-    }
-    if ( report.isDirectory() )
-    {
-        System.err.println( "report file is a directory." );
-        return false;
-    }
-    String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8");
+assert reportContent.contains( "maven-changes-plugin-test-1.1 release" ) : 
"test-announce.vm doesn't contain 'maven-changes-plugin-test-1.1 release'"
 
-    int indexOf = reportContent.indexOf( "maven-changes-plugin-test-1.1 
release" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "test-announce.vm doesn't contain 
'maven-changes-plugin-test-1.1 release'" );
-      return false;
-    }
+assert reportContent.contains( "Test Announcement Custom template" ) : "Test 
Announcement Custom template"
 
-    indexOf = reportContent.indexOf( "Test Announcement Custom template" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "Test Announcement Custom template" );
-      return false;
-    }
-    
-    indexOf = reportContent.indexOf( '$date.systemDate' );
-    if ( indexOf >= 0 )
-    {
-      System.err.println( '$date.systemDate not resolved' );
-      return false;
-    }
-    
-
-}
-catch( Throwable e )
-{
-    e.printStackTrace();
-    result = false;
-}
-
-return result;
+assert !reportContent.contains( '$date.systemDate' ) : '$date.systemDate not 
resolved'
diff --git a/src/it/report-aggregated-changes-generation/verify.groovy 
b/src/it/report-aggregated-changes-generation/verify.groovy
index 035b2ce..02565b1 100644
--- a/src/it/report-aggregated-changes-generation/verify.groovy
+++ b/src/it/report-aggregated-changes-generation/verify.groovy
@@ -31,5 +31,3 @@ assert content.contains( 'MCHANGES-1' );
 assert content.contains( 'bug-12345' );
 
 assert content.contains( 'No changes in this release.' );
-
-return true;
diff --git a/src/it/report-changes-interpolation/verify.groovy 
b/src/it/report-changes-interpolation/verify.groovy
index 71319f5..b18b4bf 100644
--- a/src/it/report-changes-interpolation/verify.groovy
+++ b/src/it/report-changes-interpolation/verify.groovy
@@ -18,89 +18,29 @@
  * under the License.
  */
 
-import java.io.*;
 import java.nio.file.*;
 import java.text.*;
-import java.util.*;
-import java.util.jar.*;
-import java.nio.file.*;
-
-boolean result = true;
-
-try
-{
-    File report = new File( basedir, "target/site/changes.html" );
-    if ( !report.exists() )
-    {
-        System.err.println( "report file is missing." );
-        return false;
-    }
-    if ( report.isDirectory() )
-    {
-        System.err.println( "report file is a directory." );
-        return false;
-    }
-    String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8");
-
-    int indexOf = reportContent.indexOf( "Changes" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain Changes title" );
-      return false;
-    }
 
-    indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain jira issue link" );
-      return false;
-    }
+File report = new File( basedir, "target/site/changes.html" )
+assert report.exists() : "report file is missing."
+assert !report.isDirectory() : "report file is a directory."
+String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8")
 
-    // Test for output problem caused by only using <dueTo> elements
-    indexOf = reportContent.indexOf( "Thanks to , " );
-    if ( indexOf != -1 )
-    {
-      System.err.println( "changes.html has too many dueTos in the Map" );
-      return false;
-    }
+assert reportContent.contains( "Changes" ) : "changes.html doesn't contain 
Changes title"
 
-    // Tests output problems caused by only using <fixes> element
-    indexOf = reportContent.indexOf( "bug-12345" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain issue text for issue 
specified with <fixes> element" );
-      return false;
-    }
-    indexOf = reportContent.indexOf( "Fixes ." );
-    if ( indexOf != -1 )
-    {
-      System.err.println( "changes.html doesn't handle empty fixes attribute 
properly" );
-      return false;
-    }
+assert reportContent.contains( "href=\"http://myjira/browse/MCHANGES-88\""; ) : 
"changes.html doesn't contain jira issue link"
 
-    indexOf = reportContent.indexOf( "<a href=\"#a99.0\">" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain version from pom" );
-      return false;
-    }
+// Test for output problem caused by only using <dueTo> elements
+assert !reportContent.contains( "Thanks to , " ) : "changes.html has too many 
dueTos in the Map"
 
-    Date now = new Date();
-       SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd", 
new Locale( "en" ) );
-    String formattedDate = simpleDateFormat.format( now );
+// Tests output problems caused by only using <fixes> element
+assert reportContent.contains( "bug-12345" ) : "changes.html doesn't contain 
issue text for issue specified with <fixes> element"
+assert !reportContent.contains( "Fixes ." ) : "changes.html doesn't handle 
empty fixes attribute properly"
 
-    indexOf = reportContent.indexOf( formattedDate );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain publishDate" );
-      return false;
-    }
+assert reportContent.contains( "<a href=\"#a99.0\">" ) : "changes.html doesn't 
contain version from pom"
 
-}
-catch( Throwable e )
-{
-    e.printStackTrace();
-    result = false;
-}
+Date now = new Date();
+SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd", new 
Locale( "en" ) );
+String formattedDate = simpleDateFormat.format( now );
 
-return result;
+assert reportContent.contains( formattedDate ) : "changes.html doesn't contain 
publishDate"
diff --git a/src/it/report-changes-skip-snapshots/verify.groovy 
b/src/it/report-changes-skip-snapshots/verify.groovy
index 9e1578b..98e7812 100644
--- a/src/it/report-changes-skip-snapshots/verify.groovy
+++ b/src/it/report-changes-skip-snapshots/verify.groovy
@@ -21,5 +21,3 @@ assert new File(basedir, 'build.log').exists();
 content = new File(basedir, 'build.log').text;
 
 assert content.contains( "Skipping snapshot version '1.0-SNAPSHOT'." );
-
-return true;
diff --git a/src/it/report-changes-system-noissuemanagement/verify.groovy 
b/src/it/report-changes-system-noissuemanagement/verify.groovy
index eb8561b..72b005f 100644
--- a/src/it/report-changes-system-noissuemanagement/verify.groovy
+++ b/src/it/report-changes-system-noissuemanagement/verify.groovy
@@ -18,66 +18,16 @@
  * under the License.
  */
 
-import java.io.*;
 import java.nio.file.*;
-import java.util.*;
-import java.util.jar.*;
 
-boolean result = true;
+File report = new File( basedir, "target/site/changes.html" )
+assert report.exists() : "report file is missing."
+assert !report.isDirectory() : "report file is a directory."
+String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8")
 
-try
-{
-    File report = new File( basedir, "target/site/changes.html" );
-    if ( !report.exists() )
-    {
-        System.err.println( "report file is missing." );
-        return false;
-    }
-    if ( report.isDirectory() )
-    {
-        System.err.println( "report file is a directory." );
-        return false;
-    }
-    String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8");
+assert reportContent.contains( "Changes" ) : "changes.html doesn't contain 
Changes title"
 
-    int indexOf = reportContent.indexOf( "Changes" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain Changes title" );
-      return false;
-    }
-
-    indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain jira issue link" );
-      return false;
-    }
-    indexOf = reportContent.indexOf( "href=\"http://localhost/1212\""; );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain qc issue link" );
-      return false;
-    }
-    indexOf = reportContent.indexOf( 
"href=\"http://www.redmine.org/show/issue/88\""; );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain redmine issue link" );
-      return false;
-    }
-    indexOf = reportContent.indexOf( "2008-01-01" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain date 2008-01-01" );
-      return false;
-    }
-
-
-}
-catch( Throwable e )
-{
-    e.printStackTrace();
-    result = false;
-}
-
-return result;
+assert reportContent.contains( "href=\"http://myjira/browse/MCHANGES-88\""; ) : 
"changes.html doesn't contain jira issue link"
+assert reportContent.contains( "href=\"http://localhost/1212\""; ) : 
"changes.html doesn't contain qc issue link"
+assert reportContent.contains( "href=\"http://www.redmine.org/show/issue/88\""; 
) : "changes.html doesn't contain redmine issue link"
+assert reportContent.contains( "2008-01-01" ) : "changes.html doesn't contain 
date 2008-01-01"
diff --git a/src/it/report-changes-system/verify.groovy 
b/src/it/report-changes-system/verify.groovy
index ce4c4da..7fa3873 100644
--- a/src/it/report-changes-system/verify.groovy
+++ b/src/it/report-changes-system/verify.groovy
@@ -18,58 +18,16 @@
  * under the License.
  */
 
-import java.io.*;
 import java.nio.file.*;
-import java.util.*;
-import java.util.jar.*;
 
-boolean result = true;
+File report = new File( basedir, "target/site/en/changes.html" )
+assert report.exists() : "report file is missing."
+assert !report.isDirectory() : "report file is a directory."
+String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8")
 
-try
-{
-    File report = new File( basedir, "target/site/en/changes.html" );
-    if ( !report.exists() )
-    {
-        System.err.println( "report file is missing." );
-        return false;
-    }
-    if ( report.isDirectory() )
-    {
-        System.err.println( "report file is a directory." );
-        return false;
-    }
-    String reportContent = new String(Files.readAllBytes( report.toPath() ), 
"UTF-8");
+assert reportContent.contains( "Changes" ) : "changes.html doesn't contain 
Changes title"
 
-    int indexOf = reportContent.indexOf( "Changes" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain Changes title" );
-      return false;
-    }
+assert reportContent.contains( "href=\"http://myjira/browse/MCHANGES-88\""; ) : 
"changes.html doesn't contain jira issue link"
+assert reportContent.contains( "href=\"http://localhost/1212\""; ) : 
"changes.html doesn't contain qc issue link"
 
-    indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain jira issue link" );
-      return false;
-    }
-    indexOf = reportContent.indexOf( "href=\"http://localhost/1212\""; );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain qc issue link" );
-      return false;
-    }
-    indexOf = reportContent.indexOf( "2008-01-01" );
-    if ( indexOf < 0 )
-    {
-      System.err.println( "changes.html doesn't contain date 2008-01-01" );
-      return false;
-    }
-}
-catch( Throwable e )
-{
-    e.printStackTrace();
-    result = false;
-}
-
-return result;
+assert reportContent.contains( "2008-01-01" ) : "changes.html doesn't contain 
date 2008-01-01"
diff --git a/src/it/report-jira-invalid-issuemanagement/verify.groovy 
b/src/it/report-jira-invalid-issuemanagement/verify.groovy
index eaf850d..844e463 100644
--- a/src/it/report-jira-invalid-issuemanagement/verify.groovy
+++ b/src/it/report-jira-invalid-issuemanagement/verify.groovy
@@ -18,11 +18,7 @@
  * under the License.
  */
 
-import java.io.*;
-import java.util.*;
 
 content = new File( basedir, 'build.log' ).text;
 
-assert !content.contains( '[ERROR]' );
-
-return true;
\ No newline at end of file
+assert !content.contains( '[ERROR]' );
\ No newline at end of file

Reply via email to