-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
32 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,15 @@ | |
/** | ||
* Simple class with a main method to call from unit tests | ||
* | ||
* @author Jerome Lacoste <[email protected]> | ||
* @author Jerome Lacoste | ||
* @version $Id$ | ||
*/ | ||
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 ) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
import org.codehaus.plexus.util.StringOutputStream; | ||
|
||
/** | ||
* @author Jerome Lacoste <[email protected]> | ||
* @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 | ||
* <p/> | ||
* 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.<br> | ||
* 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 | ||
* <p/> | ||
* we load the config from a pom file and fill up the MavenProject property ourselves | ||
* result<br> | ||
* 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 <[email protected]> | ||
* @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 | ||
* <p/> | ||
*/ | ||
// 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 | ||
* <a href="http://jira.codehaus.org/browse/MEXEC-6">MEXEC-6</a>. | ||
* | ||
* @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 | ||
* <a href="http://jira.codehaus.org/browse/MEXEC-15">MEXEC-15</a>. | ||
* | ||
* @throws Exception if any exception occurs | ||
*/ | ||
public void testWaitNonInterruptibleDaemonThreads() | ||
throws Exception | ||
|
@@ -182,7 +188,9 @@ public void testWaitNonInterruptibleDaemonThreads() | |
|
||
/** | ||
* See <a href="http://jira.codehaus.org/browse/MEXEC-15">MEXEC-15</a>. 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
* @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 | ||
{ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
*/ | ||
|
||
/** | ||
* @author Jerome Lacoste <[email protected]> | ||
* @author Jerome Lacoste | ||
* @version $Id$ | ||
*/ | ||
public class NoMain | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
/** | ||
* Executable used to test applications which exit exceptionally. | ||
* | ||
* @author Lukasz Cwik <[email protected]> | ||
* @author Lukasz Cwik | ||
*/ | ||
public class ThrowingMain | ||
{ | ||
|