org.apache.maven.plugin.source
Class AbstractSourcePluginTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.codehaus.plexus.PlexusTestCase
org.apache.maven.plugin.testing.AbstractMojoTestCase
org.apache.maven.plugin.source.AbstractSourcePluginTestCase
- All Implemented Interfaces:
- Test
- Direct Known Subclasses:
- SourceJarMojoTest, TestSourceJarMojoTest
public abstract class AbstractSourcePluginTestCase
- extends AbstractMojoTestCase
- Author:
- Stephane Nicoll
Fields inherited from class org.codehaus.plexus.PlexusTestCase |
basedir, container |
Method Summary |
protected void |
assertJarContent(File jarFile,
String[] expectedFiles)
|
protected void |
assertSourceArchive(File testTargetDir,
String projectName)
|
protected void |
assertTestSourceArchive(File testTargetDir,
String projectName)
|
protected String |
buildFinalSourceName(String projectName)
|
protected String |
buildFinalTestSourceName(String projectName)
|
protected File |
doTestProject(String projectName,
boolean expectSourceArchive,
boolean expectTestSourceArchive,
String[] expectedSourceFiles,
String[] expectedTestSourceFiles,
String classifier)
Executes the specified projects and asserts the given artifacts. |
protected File |
doTestProjectWithSourceArchive(String projectName,
String[] expectedSourceFiles,
String classifier)
Executes the specified projects and asserts the given artifacts for a source archive. |
protected File |
doTestProjectWithTestSourceArchive(String projectName,
String[] expectedTestSourceFiles,
String classifier)
Executes the specified projects and asserts the given artifacts for a test source archive. |
protected void |
executeMojo(String projectName,
String classifier)
Execute the source plugin for the specified project. |
protected abstract String |
getGoal()
|
protected File |
getSourceArchive(File testTargetDir,
String projectName)
|
protected File |
getTestDir(String projectName)
|
protected File |
getTestSourceArchive(File testTargetDir,
String projectName)
|
protected File |
getTestTargetDir(String projectName)
|
Methods inherited from class org.apache.maven.plugin.testing.AbstractMojoTestCase |
configureMojo, configureMojo, extractPluginConfiguration, extractPluginConfiguration, getVariablesAndValuesFromObject, getVariablesAndValuesFromObject, getVariableValueFromObject, lookupEmptyMojo, lookupEmptyMojo, lookupMojo, lookupMojo, lookupMojo, setUp, 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.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, failNotEquals, failNotSame, failSame, format |
FINAL_NAME_PREFIX
protected static final String FINAL_NAME_PREFIX
- See Also:
- Constant Field Values
FINAL_NAME_SUFFIX
protected static final String FINAL_NAME_SUFFIX
- See Also:
- Constant Field Values
AbstractSourcePluginTestCase
public AbstractSourcePluginTestCase()
getGoal
protected abstract String getGoal()
executeMojo
protected void executeMojo(String projectName,
String classifier)
throws Exception
- Execute the source plugin for the specified project.
- Parameters:
projectName
- the name of the project
- Throws:
Exception
- if an error occurred
doTestProject
protected File doTestProject(String projectName,
boolean expectSourceArchive,
boolean expectTestSourceArchive,
String[] expectedSourceFiles,
String[] expectedTestSourceFiles,
String classifier)
throws Exception
- Executes the specified projects and asserts the given artifacts.
- Parameters:
projectName
- the project to testexpectSourceArchive
- if a source archive is expectedexpectTestSourceArchive
- if a test source archive is expectedexpectedSourceFiles
- the expected files in the source archive, if anyexpectedTestSourceFiles
- the expected files in the test source archive, if any
- Returns:
- the base directory of the project
- Throws:
Exception
- if any error occurs
doTestProjectWithSourceArchive
protected File doTestProjectWithSourceArchive(String projectName,
String[] expectedSourceFiles,
String classifier)
throws Exception
- Executes the specified projects and asserts the given artifacts for a source archive.
- Parameters:
projectName
- the project to testexpectedSourceFiles
- the expected files in the source archive, if any
- Returns:
- the base directory of the project
- Throws:
Exception
- if any error occurs
doTestProjectWithTestSourceArchive
protected File doTestProjectWithTestSourceArchive(String projectName,
String[] expectedTestSourceFiles,
String classifier)
throws Exception
- Executes the specified projects and asserts the given artifacts for a test source archive.
- Parameters:
projectName
- the project to testexpectedTestSourceFiles
- the expected files in the test source archive, if any
- Returns:
- the base directory of the project
- Throws:
Exception
- if any error occurs
assertSourceArchive
protected void assertSourceArchive(File testTargetDir,
String projectName)
assertTestSourceArchive
protected void assertTestSourceArchive(File testTargetDir,
String projectName)
getSourceArchive
protected File getSourceArchive(File testTargetDir,
String projectName)
getTestSourceArchive
protected File getTestSourceArchive(File testTargetDir,
String projectName)
buildFinalSourceName
protected String buildFinalSourceName(String projectName)
buildFinalTestSourceName
protected String buildFinalTestSourceName(String projectName)
getTestDir
protected File getTestDir(String projectName)
throws IOException
- Throws:
IOException
assertJarContent
protected void assertJarContent(File jarFile,
String[] expectedFiles)
throws IOException
- Throws:
IOException
getTestTargetDir
protected File getTestTargetDir(String projectName)
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.