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-shared-utils.git


The following commit(s) were added to refs/heads/master by this push:
     new c4bc59c  remove last dependency on plexus (#151)
c4bc59c is described below

commit c4bc59c0c6085857a79d5080fa88716ad0af8e0e
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Fri Jun 2 07:22:45 2023 -0400

    remove last dependency on plexus (#151)
    
    * remove last dependency on plexus
---
 pom.xml                                              |  6 ------
 .../apache/maven/shared/utils/io/FileUtilsTest.java  | 20 ++++++++------------
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/pom.xml b/pom.xml
index e513050..5f937ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -120,12 +120,6 @@
       <version>3.0.2</version>
       <scope>provided</scope>
     </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>3.5.1</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
diff --git a/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java 
b/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
index efd49a9..946e74a 100644
--- a/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java
@@ -31,20 +31,18 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.io.StringReader;
 import java.io.Writer;
 import java.net.URL;
 import java.nio.file.Files;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.maven.shared.utils.Os;
 import org.apache.maven.shared.utils.testhelpers.FileTestHelper;
-import org.codehaus.plexus.util.InterpolationFilterReader;
 import org.hamcrest.CoreMatchers;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -444,7 +442,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_YESTERDAY, "Hello ${name}!");
         File to = new File(tempFolder.getRoot(), "to.txt");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertTrue("to.txt did not exist so should have been written", 
to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -455,7 +453,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_YESTERDAY, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_LAST_WEEK, "Older content");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertTrue("to.txt was outdated so should have been overwritten", 
to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -466,7 +464,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_LAST_WEEK, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_YESTERDAY, "Older content");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"), true);
+        FileUtils.copyFile(from, to, null, wrappers(), true);
 
         assertTrue("to.txt was newer but the overwrite should have been 
forced", to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -477,7 +475,7 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_LAST_WEEK, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_YESTERDAY, "Hello Charlie!");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertTrue("to.txt was outdated so should have been overwritten", 
to.lastModified() >= MODIFIED_TODAY);
         assertFileContent(to, "Hello Bob!");
@@ -488,20 +486,18 @@ public class FileUtilsTest {
         File from = write("from.txt", MODIFIED_LAST_WEEK, "Hello ${name}!");
         File to = write("to.txt", MODIFIED_YESTERDAY, "Hello Bob!");
 
-        FileUtils.copyFile(from, to, null, wrappers("name", "Bob"));
+        FileUtils.copyFile(from, to, null, wrappers());
 
         assertFileContent(to, "Hello Bob!");
         assertTrue("to.txt content should be unchanged and have been left 
alone", to.lastModified() < MODIFIED_TODAY);
     }
 
-    private static FileUtils.FilterWrapper[] wrappers(String key, String 
value) {
-        final Map<String, Object> map = new HashMap<>();
-        map.put(key, value);
+    private static FileUtils.FilterWrapper[] wrappers() {
         return new FileUtils.FilterWrapper[] {
             new FileUtils.FilterWrapper() {
                 @Override
                 public Reader getReader(Reader reader) {
-                    return new InterpolationFilterReader(reader, map);
+                    return new StringReader("Hello Bob!");
                 }
             }
         };

Reply via email to