You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2022/09/11 15:44:51 UTC

[maven-reporting-impl] branch MSHARED-1133 created (now 39ed204)

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

slachiewicz pushed a change to branch MSHARED-1133
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git


      at 39ed204  [MSHARED-1133] Drop dependency to junit-addons

This branch includes the following new commits:

     new 39ed204  [MSHARED-1133] Drop dependency to junit-addons

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-reporting-impl] 01/01: [MSHARED-1133] Drop dependency to junit-addons

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MSHARED-1133
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git

commit 39ed204142b87b7f1e867b02eb5412eac02be74f
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Sep 11 17:44:22 2022 +0200

    [MSHARED-1133] Drop dependency to junit-addons
---
 pom.xml                                            |  6 -----
 .../reporting/AbstractMavenReportRendererTest.java | 30 ++++++++++++++--------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4760b73..e3bceb6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,12 +151,6 @@
       <version>4.13.2</version>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>junit-addons</groupId>
-      <artifactId>junit-addons</artifactId>
-      <version>1.4</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
diff --git a/src/test/java/org/apache/maven/reporting/AbstractMavenReportRendererTest.java b/src/test/java/org/apache/maven/reporting/AbstractMavenReportRendererTest.java
index cdb9299..070a98e 100644
--- a/src/test/java/org/apache/maven/reporting/AbstractMavenReportRendererTest.java
+++ b/src/test/java/org/apache/maven/reporting/AbstractMavenReportRendererTest.java
@@ -19,37 +19,46 @@ package org.apache.maven.reporting;
  * under the License.
  */
 
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.List;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import junitx.util.PrivateAccessor;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 /**
  * Test case for some public method in AbstractMavenReportRenderer.
  */
 public class AbstractMavenReportRendererTest
-    extends TestCase
 {
     private static List<String> applyPattern( String pattern )
         throws Throwable
     {
-        return (List<String>) PrivateAccessor.invoke( AbstractMavenReportRenderer.class, "applyPattern",
-                                              new Class[] { String.class }, new Object[] { pattern } );
+        try
+        {
+            Method method = AbstractMavenReportRenderer.class.getDeclaredMethod( "applyPattern", String.class );
+            method.setAccessible( true );
+            return (List<String>) method.invoke( null, pattern );
+        } catch ( InvocationTargetException ite )
+        {
+            throw ite.getTargetException();
+        }
     }
 
     private static void checkPattern( String pattern, String[] expectedResult ) throws Throwable
     {
         List<String> result = applyPattern( pattern );
-        Assert.assertEquals( "result size", expectedResult.length, result.size() );
+        assertEquals( "result size", expectedResult.length, result.size() );
         int i = 0;
         for ( Iterator<String> it = result.iterator(); it.hasNext(); )
         {
             String name = it.next();
             String href = it.next();
-            Assert.assertEquals( expectedResult[i], name );
-            Assert.assertEquals( expectedResult[i + 1], href );
+            assertEquals( expectedResult[i], name );
+            assertEquals( expectedResult[i + 1], href );
             i += 2;
         }
     }
@@ -59,7 +68,7 @@ public class AbstractMavenReportRendererTest
         try
         {
             applyPattern( pattern );
-            Assert.fail( cause + " should throw an IllegalArgumentException" );
+            fail( cause + " should throw an IllegalArgumentException" );
         }
         catch ( IllegalArgumentException iae )
         {
@@ -70,6 +79,7 @@ public class AbstractMavenReportRendererTest
     /**
      * @throws Throwable if any
      */
+    @Test
     public void testApplyPattern() throws Throwable
     {
         // the most simple test