From c0ffd84277cb1e8116f0a57579d5992eeb2a9f64 Mon Sep 17 00:00:00 2001 From: rfscholte Date: Thu, 2 Mar 2017 21:41:59 +0100 Subject: [PATCH] Fix javadoc and documentation --- .../example-exec-for-java-programs.apt.vm | 2 +- .../org/codehaus/mojo/exec/DummyMain.java | 4 +-- .../codehaus/mojo/exec/ExecJavaMojoTest.java | 29 ++++++++++++------- .../org/codehaus/mojo/exec/ExecMojoTest.java | 14 ++++----- .../codehaus/mojo/exec/MainWithThreads.java | 2 ++ .../java/org/codehaus/mojo/exec/NoMain.java | 2 +- .../org/codehaus/mojo/exec/ThrowingMain.java | 2 +- 7 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/site/apt/examples/example-exec-for-java-programs.apt.vm b/src/site/apt/examples/example-exec-for-java-programs.apt.vm index 4904a71e..9e8e0ec1 100644 --- a/src/site/apt/examples/example-exec-for-java-programs.apt.vm +++ b/src/site/apt/examples/example-exec-for-java-programs.apt.vm @@ -88,7 +88,7 @@ In case of the modules as supported since Java9 the configuration looks like java --module-path - --module diff --git a/src/test/java/org/codehaus/mojo/exec/DummyMain.java b/src/test/java/org/codehaus/mojo/exec/DummyMain.java index 51effb19..591efa16 100644 --- a/src/test/java/org/codehaus/mojo/exec/DummyMain.java +++ b/src/test/java/org/codehaus/mojo/exec/DummyMain.java @@ -3,7 +3,7 @@ /** * Simple class with a main method to call from unit tests * - * @author Jerome Lacoste + * @author Jerome Lacoste * @version $Id$ */ public class DummyMain @@ -11,7 +11,7 @@ public class DummyMain /** * Prints Hello followed by each argument, then a new line. Use a space character as separator. * - * @param args + * @param args the arguments */ public static void main( String... args ) { diff --git a/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java b/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java index cc33dd2f..b7ff29db 100644 --- a/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java +++ b/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java @@ -34,7 +34,7 @@ import org.codehaus.plexus.util.StringOutputStream; /** - * @author Jerome Lacoste + * @author Jerome Lacoste * @version $Id$ */ public class ExecJavaMojoTest @@ -48,9 +48,10 @@ public class ExecJavaMojoTest */ /** - * Check that a simple execution with no arguments and no system properties produces the expected result - *

- * we load the config from a pom file and fill up the MavenProject property ourselves + * Check that a simple execution with no arguments and no system properties produces the expected result.
+ * We load the config from a pom file and fill up the MavenProject property ourselves + * + * @throws Exception if any exception occurs */ public void testSimpleRun() throws Exception @@ -64,9 +65,10 @@ public void testSimpleRun() /** * MEXEC-10 Check that an execution with no arguments and an system property with no value produces the expected - * result - *

- * we load the config from a pom file and fill up the MavenProject property ourselves + * result
+ * We load the config from a pom file and fill up the MavenProject property ourselves + * + * @throws Exception if any exception occurs */ public void testEmptySystemProperty() throws Exception @@ -84,7 +86,8 @@ public void testEmptySystemProperty() * Check that an execution that throws propagates the cause of the failure into the output * and correctly unwraps the InvocationTargetException. * - * @author Lukasz Cwik + * @author Lukasz Cwik + * @throws Exception if any exception occurs */ public void testRunWhichThrowsExceptionIsNotWrappedInInvocationTargetException() throws Exception @@ -109,7 +112,6 @@ public void testRunWhichThrowsExceptionIsNotWrappedInInvocationTargetException() /** * MEXEC-29 exec:java throws NPE if the mainClass main method has not a correct signature - *

*/ // Moved this test to src/it/mexec-29 (integration test) // cause it will fail. This is based of trying to @@ -154,6 +156,8 @@ public void testRunWhichThrowsExceptionIsNotWrappedInInvocationTargetException() /** * For cases where the Java code spawns Threads and main returns soon. See * MEXEC-6. + * + * @throws Exception if any exception occurs */ public void testWaitNoDaemonThreads() throws Exception @@ -169,6 +173,8 @@ public void testWaitNoDaemonThreads() * For cases where the Java code spawns Threads and main returns soon, but code contains non interruptible threads. * User is required to timeout the execution, otherwise it will hang. See * MEXEC-15. + * + * @throws Exception if any exception occurs */ public void testWaitNonInterruptibleDaemonThreads() throws Exception @@ -182,7 +188,9 @@ public void testWaitNonInterruptibleDaemonThreads() /** * See MEXEC-15. FIXME: this sometimes fail with - * unit.framework.ComparisonFailure: expected:<...> but was:<...3(f)> + * unit.framework.ComparisonFailure: expected:<...> but was:<...3(f)> + * + * @throws Exception if any exception occurs */ public void testUncooperativeThread() throws Exception @@ -209,6 +217,7 @@ public void testUncooperativeThread() /** * Test the commandline parsing facilities of the {@link AbstractExecMojo} class + * @throws Exception if any exception occurs */ public void testRunWithArgs() throws Exception diff --git a/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java b/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java index 08452029..79286fea 100644 --- a/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java +++ b/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java @@ -35,14 +35,10 @@ import org.apache.maven.project.MavenProjectBuilder; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.logging.console.ConsoleLogger; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringOutputStream; -import org.junit.Assume; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; /** - * @author Jerome Lacoste + * @author Jerome Lacoste * @version $Id$ */ public class ExecMojoTest @@ -108,8 +104,6 @@ public void setUp() mojo.setBasedir( File.createTempFile( "mvn-temp", "txt" ).getParentFile() ); } - /** - */ public void testRunOK() throws MojoExecutionException { @@ -188,9 +182,13 @@ public void testRunOK() // } /** + * + * @param pom the pom file + * @param goal the goal to execute * @return output from System.out during mojo execution + * @throws Exception if any exception occurs */ - private String execute( File pom, String goal ) + protected String execute( File pom, String goal ) throws Exception { diff --git a/src/test/java/org/codehaus/mojo/exec/MainWithThreads.java b/src/test/java/org/codehaus/mojo/exec/MainWithThreads.java index 03aa3d4d..fc6585fa 100644 --- a/src/test/java/org/codehaus/mojo/exec/MainWithThreads.java +++ b/src/test/java/org/codehaus/mojo/exec/MainWithThreads.java @@ -18,6 +18,8 @@ public class MainWithThreads * will be interrupted right away. - if the timer is cancelled (using 'cancelTimer' as argument), the timer will die * on itself after all the other threads - if not, one must use a time out to stop joining on that unresponsive * daemon thread + * + * @param args the arguments **/ public static void main( String... args ) { diff --git a/src/test/java/org/codehaus/mojo/exec/NoMain.java b/src/test/java/org/codehaus/mojo/exec/NoMain.java index 53d7dc20..dc694298 100644 --- a/src/test/java/org/codehaus/mojo/exec/NoMain.java +++ b/src/test/java/org/codehaus/mojo/exec/NoMain.java @@ -17,7 +17,7 @@ */ /** - * @author Jerome Lacoste + * @author Jerome Lacoste * @version $Id$ */ public class NoMain diff --git a/src/test/java/org/codehaus/mojo/exec/ThrowingMain.java b/src/test/java/org/codehaus/mojo/exec/ThrowingMain.java index c99e5482..04d91371 100644 --- a/src/test/java/org/codehaus/mojo/exec/ThrowingMain.java +++ b/src/test/java/org/codehaus/mojo/exec/ThrowingMain.java @@ -21,7 +21,7 @@ /** * Executable used to test applications which exit exceptionally. * - * @author Lukasz Cwik + * @author Lukasz Cwik */ public class ThrowingMain {