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

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


The following commit(s) were added to refs/heads/master by this push:
     new efb015f  Clean up integration tests (#58)
efb015f is described below

commit efb015f7096476a5664fa327feacbeee7f2121ef
Author: Elliotte Rusty Harold <elh...@users.noreply.github.com>
AuthorDate: Sat Nov 23 13:17:46 2024 +0000

    Clean up integration tests (#58)
---
 .../verify.bsh                                     | 13 ++++++++----
 src/it/report-changes-generation/verify.bsh        | 19 ++++++++++-------
 src/it/report-changes-interpolation/verify.bsh     | 24 ++++++++++++++--------
 .../verify.bsh                                     | 23 +++++++++++++--------
 src/it/report-changes-system/verify.bsh            | 21 +++++++++++--------
 5 files changed, 63 insertions(+), 37 deletions(-)

diff --git a/src/it/announcement-generate-custom-template/verify.bsh 
b/src/it/announcement-generate-custom-template/verify.bsh
index 41089bd..065696b 100644
--- a/src/it/announcement-generate-custom-template/verify.bsh
+++ b/src/it/announcement-generate-custom-template/verify.bsh
@@ -19,21 +19,26 @@
  */
 
 import java.io.*;
+import java.nio.file.*;
 import java.util.*;
 import java.util.jar.*;
-import org.codehaus.plexus.util.*;
 
 boolean result = true;
 
 try
 {
     File report = new File( basedir, "target/announcement/test-announce.vm" );
-    if ( !report.exists() || report.isDirectory() )
+    if ( !report.exists() )
     {
-        System.err.println( "report file is missing or a directory." );
+        System.err.println( "report file is missing." );
         return false;
     }
-    String reportContent = FileUtils.fileRead( report );
+    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( "maven-changes-plugin-test-1.1 
release" );
     if ( indexOf < 0 )
diff --git a/src/it/report-changes-generation/verify.bsh 
b/src/it/report-changes-generation/verify.bsh
index e678f00..81d4fed 100644
--- a/src/it/report-changes-generation/verify.bsh
+++ b/src/it/report-changes-generation/verify.bsh
@@ -19,33 +19,38 @@
  */
 
 import java.io.*;
+import java.nio.file.*;
 import java.util.*;
 import java.util.jar.*;
-import org.codehaus.plexus.util.*;
 
 boolean result = true;
 
 try
 {
     File report = new File( basedir, "target/site/changes-report.html" );
-    if ( !report.exists() || report.isDirectory() )
+    if ( !report.exists() )
     {
-        System.err.println( "report file is missing or a directory." );
+        System.err.println( "report file is missing." );
         return false;
     }
-    String reportContent = FileUtils.fileRead( report );
+    if ( report.isDirectory() )
+    {
+        System.err.println( "report is 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-report.html doesn't contains Changes title" 
);
+      System.err.println( "changes-report.html doesn't contain Changes title" 
);
       return false;
     }
 
     indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains jira issue 
link" );
+      System.err.println( "changes-report.html doesn't contain jira issue 
link" );
       return false;
     }
 
@@ -61,7 +66,7 @@ try
     indexOf = reportContent.indexOf( "bug-12345" );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains issue text for 
issue specified with <fixes> element" );
+      System.err.println( "changes-report.html doesn't contain issue text for 
issue specified with <fixes> element" );
       return false;
     }
     indexOf = reportContent.indexOf( "Fixes ." );
diff --git a/src/it/report-changes-interpolation/verify.bsh 
b/src/it/report-changes-interpolation/verify.bsh
index 6e950f1..72dade0 100644
--- a/src/it/report-changes-interpolation/verify.bsh
+++ b/src/it/report-changes-interpolation/verify.bsh
@@ -19,34 +19,40 @@
  */
 
 import java.io.*;
+import java.nio.file.*;
 import java.text.*;
 import java.util.*;
 import java.util.jar.*;
-import org.codehaus.plexus.util.*;
+import java.nio.file.*;
 
 boolean result = true;
 
 try
 {
     File report = new File( basedir, "target/site/changes-report.html" );
-    if ( !report.exists() || report.isDirectory() )
+    if ( !report.exists() )
     {
-        System.err.println( "report file is missing or a directory." );
+        System.err.println( "report file is missing." );
         return false;
     }
-    String reportContent = FileUtils.fileRead( report );
+    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-report.html doesn't contains Changes title" 
);
+      System.err.println( "changes-report.html doesn't contain Changes title" 
);
       return false;
     }
 
     indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains jira issue 
link" );
+      System.err.println( "changes-report.html doesn't contain jira issue 
link" );
       return false;
     }
 
@@ -62,7 +68,7 @@ try
     indexOf = reportContent.indexOf( "bug-12345" );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains issue text for 
issue specified with <fixes> element" );
+      System.err.println( "changes-report.html doesn't contain issue text for 
issue specified with <fixes> element" );
       return false;
     }
     indexOf = reportContent.indexOf( "Fixes ." );
@@ -75,7 +81,7 @@ try
     indexOf = reportContent.indexOf( "<a href=\"#a99.0\">" );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains version from 
pom" );
+      System.err.println( "changes-report.html doesn't contain version from 
pom" );
       return false;
     }
 
@@ -86,7 +92,7 @@ try
     indexOf = reportContent.indexOf( formattedDate );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't publishDate" );
+      System.err.println( "changes-report.html doesn't contain publishDate" );
       return false;
     }
 
diff --git a/src/it/report-changes-system-noissuemanagement/verify.bsh 
b/src/it/report-changes-system-noissuemanagement/verify.bsh
index 2756ae8..f74aeb4 100644
--- a/src/it/report-changes-system-noissuemanagement/verify.bsh
+++ b/src/it/report-changes-system-noissuemanagement/verify.bsh
@@ -19,51 +19,56 @@
  */
 
 import java.io.*;
+import java.nio.file.*;
 import java.util.*;
 import java.util.jar.*;
-import org.codehaus.plexus.util.*;
 
 boolean result = true;
 
 try
 {
     File report = new File( basedir, "target/site/changes-report.html" );
-    if ( !report.exists() || report.isDirectory() )
+    if ( !report.exists() )
     {
-        System.err.println( "report file is missing or a directory." );
+        System.err.println( "report file is missing." );
         return false;
     }
-    String reportContent = FileUtils.fileRead( report );
+    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-report.html doesn't contains Changes title" 
);
+      System.err.println( "changes-report.html doesn't contain Changes title" 
);
       return false;
     }
 
     indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains jira issue 
link" );
+      System.err.println( "changes-report.html doesn't contain jira issue 
link" );
       return false;
     }
     indexOf = reportContent.indexOf( "href=\"http://localhost/1212\""; );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains qc issue link" 
);
+      System.err.println( "changes-report.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-report.html doesn't contains redmine issue 
link" );
+      System.err.println( "changes-report.html doesn't contain redmine issue 
link" );
       return false;
     }
     indexOf = reportContent.indexOf( "2008-01-01" );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains date 
2008-01-01" );
+      System.err.println( "changes-report.html doesn't contain date 
2008-01-01" );
       return false;
     }
 
diff --git a/src/it/report-changes-system/verify.bsh 
b/src/it/report-changes-system/verify.bsh
index f40d27c..2e6de8c 100644
--- a/src/it/report-changes-system/verify.bsh
+++ b/src/it/report-changes-system/verify.bsh
@@ -19,45 +19,50 @@
  */
 
 import java.io.*;
+import java.nio.file.*;
 import java.util.*;
 import java.util.jar.*;
-import org.codehaus.plexus.util.*;
 
 boolean result = true;
 
 try
 {
     File report = new File( basedir, "target/site/en/changes-report.html" );
-    if ( !report.exists() || report.isDirectory() )
+    if ( !report.exists() )
     {
-        System.err.println( "report file is missing or a directory." );
+        System.err.println( "report file is missing." );
         return false;
     }
-    String reportContent = FileUtils.fileRead( report );
+    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-report.html doesn't contains Changes title" 
);
+      System.err.println( "changes-report.html doesn't contain Changes title" 
);
       return false;
     }
 
     indexOf = reportContent.indexOf( 
"href=\"http://myjira/browse/MCHANGES-88\""; );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains jira issue 
link" );
+      System.err.println( "changes-report.html doesn't contain jira issue 
link" );
       return false;
     }
     indexOf = reportContent.indexOf( "href=\"http://localhost/1212\""; );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains qc issue link" 
);
+      System.err.println( "changes-report.html doesn't contain qc issue link" 
);
       return false;
     }
     indexOf = reportContent.indexOf( "2008-01-01" );
     if ( indexOf < 0 )
     {
-      System.err.println( "changes-report.html doesn't contains date 
2008-01-01" );
+      System.err.println( "changes-report.html doesn't contain date 
2008-01-01" );
       return false;
     }
 }

Reply via email to