You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2024/12/07 13:06:44 UTC
(maven-plugin-testing) branch maven-plugin-testing-3.x updated: Remove TODOs (#48)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch maven-plugin-testing-3.x
in repository https://gitbox.apache.org/repos/asf/maven-plugin-testing.git
The following commit(s) were added to refs/heads/maven-plugin-testing-3.x by this push:
new 1a12bb9 Remove TODOs (#48)
1a12bb9 is described below
commit 1a12bb9bee480355076ee38c7b30b8c2cea2c214
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Sat Dec 7 13:06:39 2024 +0000
Remove TODOs (#48)
* Remove TODOs
---
.../apache/maven/plugin/testing/AbstractMojoTestCase.java | 15 ---------------
.../java/org/apache/maven/plugin/testing/SilentLog.java | 5 +----
.../maven/plugin/testing/resources/TestResources.java | 1 -
.../maven/plugin/testing/PluginArtifactFileTest.java | 4 +---
4 files changed, 2 insertions(+), 23 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 8c11a8f..a03feb8 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.Xpp3Dom;
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 {
@@ -118,12 +109,6 @@ public abstract class AbstractMojoTestCase extends PlexusTestCase {
private Map<String, MojoDescriptor> 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(
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 e94d81b..deaceeb 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,8 +323,5 @@ public class SilentLog implements Log, Logger {
}
@Override
- public void setThreshold(int threshold) {
- // TODO Auto-generated method stub
-
- }
+ public void setThreshold(int threshold) {}
}
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 54343f1..1541506 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 class TestResources extends TestWatcher {
// 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 6025f21..2163a25 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<Artifact> artifacts =
execution.getMojoDescriptor().getPluginDescriptor().getArtifacts();
@@ -40,6 +40,4 @@ public class PluginArtifactFileTest extends AbstractMojoTestCase {
assertEquals("0.0.1-SNAPSHOT", artifact.getBaseVersion());
assertTrue(artifact.getFile().getAbsolutePath().endsWith(FS + "target" + FS + "test-classes"));
}
-
- // TODO find a way to automate testing of jar:file:/ test plugin URLs
}