org.apache.maven.plugin.war
Class WarOverlaysTest
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
org.apache.maven.plugin.war.AbstractWarExplodedMojoTest
org.apache.maven.plugin.war.WarOverlaysTest
- All Implemented Interfaces:
- junit.framework.Test
public class WarOverlaysTest
- extends AbstractWarExplodedMojoTest
- Author:
- Stephane Nicoll
Methods inherited from class org.apache.maven.plugin.war.AbstractWarMojoTest |
buildWarOverlayStub, configureMojo, createArchive, createClassesDir, createDir, createFile, createFile, createWebAppSource, createWebAppSource, createXMLConfigDir, generateFullOverlayWar, getOverlayFile, getWebAppSource |
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 |
WarOverlaysTest
public WarOverlaysTest()
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class AbstractWarExplodedMojoTest
- Throws:
Exception
getPomFile
protected File getPomFile()
- Description copied from class:
AbstractWarExplodedMojoTest
- Returns the pom configuration to use.
- Specified by:
getPomFile
in class AbstractWarExplodedMojoTest
- Returns:
- the pom configuration
getTestDirectory
protected File getTestDirectory()
- Description copied from class:
AbstractWarExplodedMojoTest
- Returns the test directory to use.
- Specified by:
getTestDirectory
in class AbstractWarExplodedMojoTest
- Returns:
- the test directory
testEnvironment
public void testEnvironment()
throws Exception
- Throws:
Exception
testNoOverlay
public void testNoOverlay()
throws Exception
- Throws:
Exception
testDefaultOverlay
public void testDefaultOverlay()
throws Exception
- Throws:
Exception
testDefaultOverlays
public void testDefaultOverlays()
throws Exception
- Throws:
Exception
testScenarioOneWithDefaulSettings
public void testScenarioOneWithDefaulSettings()
throws Exception
- Merge a dependent WAR when a file in the war source directory
overrides one found in the WAR.
It also tests completeness of the resulting war as well as the proper
order of dependencies.
- Throws:
Exception
- if any error occurs
testScenarioOneWithOverlaySettings
public void testScenarioOneWithOverlaySettings()
throws Exception
- Tests that specifying the overlay explicitely has the same behavior as
the default (i.e. order, etc).
The default project is not specified in this case so it is processed
first by default
- Throws:
Exception
- if an error occurs
testScenarioOneWithFullSettings
public void testScenarioOneWithFullSettings()
throws Exception
- Tests that specifying the overlay explicitely has the same behavior as
the default (i.e. order, etc).
The default project is explicitely specified so this should match the
default.
- Throws:
Exception
- if an error occurs
testOverlaysIncludesExcludesWithMultipleDefinitions
public void testOverlaysIncludesExcludesWithMultipleDefinitions()
throws Exception
- Throws:
Exception
testOverlaysIncludesExcludesWithMultipleDefinitions2
public void testOverlaysIncludesExcludesWithMultipleDefinitions2()
throws Exception
- Throws:
Exception
testCacheWithUpdatedOverlay
public void testCacheWithUpdatedOverlay()
throws Exception
- Throws:
Exception
testCacheWithRemovedOverlay
public void testCacheWithRemovedOverlay()
throws Exception
- Throws:
Exception
assertOverlayedFile
protected void assertOverlayedFile(File webAppDirectory,
String overlayId,
String filePath)
throws IOException
- Asserts that the content of an overlayed file is correct.
Note that the filePath is relative to both the webapp
directory and the overlayed directory, defined by the overlayId.
- Parameters:
webAppDirectory
- the webapp directoryoverlayId
- the id of the overlayfilePath
- the relative path
- Throws:
IOException
- if an error occurred while reading the files
assertDefaultFileContent
protected void assertDefaultFileContent(String testId,
File webAppDirectory,
String filePath)
throws Exception
- Asserts that the content of an overlayed file is correct.
Note that the filePath is relative to both the webapp
directory and the overlayed directory, defined by the overlayId.
- Parameters:
testId
- te id of the testwebAppDirectory
- the webapp directoryfilePath
- the relative path
- Throws:
IOException
- if an error occurred while reading the files
Exception
generateSimpleWarArtifactStub
protected org.apache.maven.plugin.testing.stubs.ArtifactStub generateSimpleWarArtifactStub(String id)
throws Exception
- Throws:
Exception
Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.