public abstract class AbstractWarMojoTest extends AbstractMojoTestCase
Modifier and Type | Field and Description |
---|---|
protected static String |
MANIFEST_PATH |
protected static File |
OVERLAYS_ROOT_DIR |
protected static File |
OVERLAYS_TEMP_DIR |
Constructor and Description |
---|
AbstractWarMojoTest() |
Modifier and Type | Method and Description |
---|---|
protected ArtifactStub |
buildWarOverlayStub(String id)
Builds a test overlay.
|
protected void |
configureMojo(AbstractWarMojo mojo,
List<String> 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.
|
configureMojo, configureMojo, extractPluginConfiguration, extractPluginConfiguration, getVariablesAndValuesFromObject, getVariablesAndValuesFromObject, getVariableValueFromObject, lookupEmptyMojo, lookupEmptyMojo, lookupMojo, lookupMojo, lookupMojo, setUp, setVariableValueToObject
createContainerInstance, customizeContext, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getContainer, getCustomConfiguration, getResourceAsStream, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, release, tearDown
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
protected static final File OVERLAYS_TEMP_DIR
protected static final File OVERLAYS_ROOT_DIR
protected static final String MANIFEST_PATH
protected void configureMojo(AbstractWarMojo mojo, List<String> 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 testException
- if an exception occursprotected File createWebAppSource(String id, boolean createSamples) throws Exception
id
- Exception
protected File createClassesDir(String id, boolean empty) throws Exception
id
- empty
- Exception
protected void createDir(File dir)
protected File generateFullOverlayWar(String id) throws Exception
id
- the id of the overlay containing the full structureException
- if an error occursprotected ArtifactStub buildWarOverlayStub(String id)
id
- the id of the overlay (see test/resources/overlays)Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.