org.codehaus.mojo.exec
Class ExecMojoTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.codehaus.plexus.PlexusTestCase
org.apache.maven.plugin.testing.AbstractMojoTestCase
org.codehaus.mojo.exec.ExecMojoTest
- All Implemented Interfaces:
- junit.framework.Test
public class ExecMojoTest
- extends org.apache.maven.plugin.testing.AbstractMojoTestCase
- Version:
- $Id: ExecMojoTest.java 12372 2010-07-09 20:51:00Z rfscholte $
- Author:
- Jerome Lacoste
Fields inherited from class org.codehaus.plexus.PlexusTestCase |
basedir, container |
Methods inherited from class org.apache.maven.plugin.testing.AbstractMojoTestCase |
configureMojo, configureMojo, extractPluginConfiguration, extractPluginConfiguration, getVariablesAndValuesFromObject, getVariablesAndValuesFromObject, getVariableValueFromObject, lookupEmptyMojo, lookupEmptyMojo, lookupMojo, lookupMojo, lookupMojo, setVariableValueToObject |
Methods inherited from class org.codehaus.plexus.PlexusTestCase |
createContainerInstance, customizeContext, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getContainer, getCustomConfiguration, getResourceAsStream, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, release, tearDown |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
mojo
private ExecMojoTest.MockExecMojo mojo
ExecMojoTest
public ExecMojoTest()
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class org.apache.maven.plugin.testing.AbstractMojoTestCase
- Throws:
Exception
testRunOK
public void testRunOK()
throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
execute
private String execute(File pom,
String goal)
throws Exception
- Returns:
- output from System.out during mojo execution
- Throws:
Exception
setUpProject
private void setUpProject(File pomFile,
ExecMojo mojo)
throws Exception
- Throws:
Exception
testGetExecutablePath
public void testGetExecutablePath()
throws IOException
- Throws:
IOException
testRunFailure
public void testRunFailure()
testRunError
public void testRunError()
testOverrides
public void testOverrides()
throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
testOverrides3
public void testOverrides3()
throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
testIsResultCodeAFailure
public void testIsResultCodeAFailure()
testParseCommandlineOSWin
public void testParseCommandlineOSWin()
throws Exception
- Throws:
Exception
checkMojo
private void checkMojo(String expectedCommandLine)
getCommandLineAsString
private String getCommandLineAsString(org.apache.commons.exec.CommandLine commandline)
assertFileEquals
private void assertFileEquals(String mavenRepo,
File expectedFile,
File actualFile)
throws IOException
- This method asserts that the two given files are equals in their
content.
- Parameters:
mavenRepo
- Not used.expectedFile
- The file that is expected.actualFile
- The file that is.
- Throws:
IOException
- if something goes wrong.
getLines
private List getLines(String mavenRepo,
File file)
throws IOException
- This method gives the list of String in a file.
- Parameters:
mavenRepo
- Not used.file
- The file to be read.
- Returns:
- The list of the lines of the file.
- Throws:
IOException
- if something goes wrong.
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.