From fb1781c6a3b453f482f30e40a007c4c809358e5c Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Fri, 6 Dec 2024 07:30:24 -0500 Subject: [PATCH 1/3] Remove TODOs --- .../maven/plugin/testing/AbstractMojoTestCase.java | 9 --------- .../java/org/apache/maven/plugin/testing/SilentLog.java | 2 -- .../maven/plugin/testing/resources/TestResources.java | 1 - .../maven/plugin/testing/PluginArtifactFileTest.java | 3 +-- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java index 8c11a8f9..b0d8d48b 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java @@ -79,15 +79,6 @@ import org.codehaus.plexus.util.xml.Xpp3DomBuilder; /** - * TODO: add a way to use the plugin POM for the lookup so that the user doesn't have to provide the a:g:v:goal - * as the role hint for the mojo lookup. - * TODO: standardize the execution of the mojo and looking at the results, but could simply have a template method - * for verifying the state of the mojo post execution - * TODO: need a way to look at the state of the mojo without adding getters, this could be where we finally specify - * the expressions which extract values from the mojo. - * TODO: create a standard directory structure for picking up POMs to make this even easier, we really just need a testing - * descriptor and make this entirely declarative! - * * @author jesse */ public abstract class AbstractMojoTestCase extends PlexusTestCase { diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java index e94d81b9..566f6cc3 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java @@ -324,7 +324,5 @@ public String getName() { @Override public void setThreshold(int threshold) { - // TODO Auto-generated method stub - } } diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java index 54343f12..1541506e 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java @@ -86,7 +86,6 @@ public File getBasedir(String project) throws IOException { // static helpers public static void cp(File basedir, String from, String to) throws IOException { - // TODO ensure destination lastModified timestamp changes FileUtils.copyFile(new File(basedir, from), new File(basedir, to)); } diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java index 6025f21c..1414c3a3 100644 --- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java +++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java @@ -27,7 +27,7 @@ public class PluginArtifactFileTest extends AbstractMojoTestCase { private static final String FS = System.getProperty("file.separator"); public void testArtifact() throws Exception { - MojoExecution execution = newMojoExecution("parameters"); // TODO dedicated test mojo + MojoExecution execution = newMojoExecution("parameters"); List artifacts = execution.getMojoDescriptor().getPluginDescriptor().getArtifacts(); @@ -41,5 +41,4 @@ public void testArtifact() throws Exception { assertTrue(artifact.getFile().getAbsolutePath().endsWith(FS + "target" + FS + "test-classes")); } - // TODO find a way to automate testing of jar:file:/ test plugin URLs } From 09d2bd9b03fe4c23ea7c66b50786a1c58dd58771 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Fri, 6 Dec 2024 07:31:46 -0500 Subject: [PATCH 2/3] spotless --- .../main/java/org/apache/maven/plugin/testing/SilentLog.java | 3 +-- .../apache/maven/plugin/testing/PluginArtifactFileTest.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java index 566f6cc3..deaceeb5 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java @@ -323,6 +323,5 @@ public String getName() { } @Override - public void setThreshold(int threshold) { - } + public void setThreshold(int threshold) {} } diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java index 1414c3a3..2163a256 100644 --- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java +++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/PluginArtifactFileTest.java @@ -40,5 +40,4 @@ public void testArtifact() throws Exception { assertEquals("0.0.1-SNAPSHOT", artifact.getBaseVersion()); assertTrue(artifact.getFile().getAbsolutePath().endsWith(FS + "target" + FS + "test-classes")); } - } From 400119cfcdeacc66a783eb5a8265fa16c889e0e2 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Fri, 6 Dec 2024 07:33:42 -0500 Subject: [PATCH 3/3] more --- .../apache/maven/plugin/testing/AbstractMojoTestCase.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java index b0d8d48b..a03feb8d 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java @@ -109,12 +109,6 @@ public abstract class AbstractMojoTestCase extends PlexusTestCase { private Map mojoDescriptors; - /* - * for the harness I think we have decided against going the route of using the maven project builder. - * instead I think we are going to try and make an instance of the localrespository and assign that - * to either the project stub or into the mojo directly with injection...not sure yet though. - */ - // private MavenProjectBuilder projectBuilder; @Override protected void setUp() throws Exception { assertTrue(