|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.codehaus.plexus.PlexusTestCase org.apache.maven.plugin.testing.AbstractMojoTestCase org.apache.maven.plugin.war.AbstractWarMojoTest
public abstract class AbstractWarMojoTest
Field Summary | |
---|---|
protected static String |
MANIFEST_PATH
|
protected static File |
OVERLAYS_ROOT_DIR
|
protected static File |
OVERLAYS_TEMP_DIR
|
Fields inherited from class org.codehaus.plexus.PlexusTestCase |
---|
basedir, container |
Constructor Summary | |
---|---|
AbstractWarMojoTest()
|
Method Summary | |
---|---|
protected ArtifactStub |
buildWarOverlayStub(String id)
Builds a test overlay. |
protected void |
configureMojo(AbstractWarMojo mojo,
List filters,
File classesDir,
File webAppSource,
File webAppDir,
MavenProjectBasicStub project)
initialize required parameters |
protected void |
createArchive(File directory,
File destinationFile)
|
protected File |
createClassesDir(String id,
boolean empty)
create a class directory with or without a sample class |
protected void |
createDir(File dir)
|
protected void |
createFile(File testFile)
|
protected void |
createFile(File testFile,
String body)
|
protected File |
createWebAppSource(String id)
|
protected File |
createWebAppSource(String id,
boolean createSamples)
create an isolated web source with a sample jsp file |
protected File |
createXMLConfigDir(String id,
String[] xmlFiles)
create an isolated xml dir |
protected File |
generateFullOverlayWar(String id)
Generates test war Generates war with such a structure: jsp d a.jsp b.jsp c.jsp a.jsp b.jsp c.jsp WEB-INF classes a.class b.class c.class lib a.jar b.jar c.jar web.xml Each of the files will contain: id+'-'+path |
protected File |
getOverlayFile(String id,
String filePath)
|
protected abstract File |
getTestDirectory()
|
protected File |
getWebAppSource(String id)
Returns the webapp source directory for the specified id. |
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.TestCase |
---|
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final File OVERLAYS_TEMP_DIR
protected static final File OVERLAYS_ROOT_DIR
protected static final String MANIFEST_PATH
Constructor Detail |
---|
public AbstractWarMojoTest()
Method Detail |
---|
protected abstract File getTestDirectory() throws Exception
Exception
protected void configureMojo(AbstractWarMojo mojo, List filters, File classesDir, File webAppSource, File webAppDir, MavenProjectBasicStub project) throws Exception
mojo
- filters
- classesDir
- webAppSource
- webAppDir
- project
-
Exception
protected File createXMLConfigDir(String id, String[] xmlFiles) throws Exception
id
- xmlFiles
-
Exception
protected File getWebAppSource(String id) throws Exception
id
- the id of the test
Exception
- if an exception occursprotected File createWebAppSource(String id, boolean createSamples) throws Exception
id
-
Exception
protected File createWebAppSource(String id) throws Exception
Exception
protected File createClassesDir(String id, boolean empty) throws Exception
id
- empty
-
Exception
protected void createDir(File dir)
protected void createFile(File testFile, String body) throws Exception
Exception
protected void createFile(File testFile) throws Exception
Exception
protected File generateFullOverlayWar(String id) throws Exception
id
- the id of the overlay containing the full structure
Exception
- if an error occursprotected ArtifactStub buildWarOverlayStub(String id)
id
- the id of the overlay (see test/resources/overlays)
protected File getOverlayFile(String id, String filePath)
protected void createArchive(File directory, File destinationFile)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |