public abstract class AbstractEarPluginIT
extends junit.framework.TestCase
Constructor and Description |
---|
AbstractEarPluginIT() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertClassPathElements(File baseDir,
String projectName,
String[] artifacts,
boolean[] artifactsDirectory,
String[][] expectedClassPathElements)
Asserts that given EAR archive artifacts have expected elements in artifact manifest Class-Path entry.
|
protected void |
assertDeploymentDescriptors(File baseDir,
String projectName)
Asserts that the deployment descriptors have been generated successfully.
|
protected void |
assertEarArchive(File baseDir,
String projectName) |
protected void |
assertEarDirectory(File baseDir,
String projectName) |
protected void |
assertEarModulesContent(File baseDir,
String projectName,
String earModuleName,
String[] artifacts,
boolean[] artifactsDirectory,
String[][] includedEntries,
String[][] excludedEntries)
Asserts that given EAR archive artifacts have expected entries and don't have unexpected entries.
|
protected String |
buildFinalName(String projectName) |
protected File |
doTestProject(String projectName,
String[] expectedArtifacts)
Executes the specified projects and asserts the given artifacts as artifacts (non directory)
|
protected File |
doTestProject(String projectName,
String[] expectedArtifacts,
boolean cleanBeforeExecute)
Executes the specified projects and asserts the given artifacts as artifacts (non directory)
|
protected File |
doTestProject(String projectName,
String[] expectedArtifacts,
boolean[] artifactsDirectory)
Executes the specified projects and asserts the given artifacts.
|
protected File |
doTestProject(String projectName,
String earModuleName,
String[] expectedArtifacts,
boolean[] artifactsDirectory,
String[] artifactsToValidateManifest,
boolean[] artifactsToValidateManifestDirectory,
String[][] expectedClassPathElements,
boolean cleanBeforeExecute)
Executes the specified projects and asserts the given artifacts.
|
protected File |
executeMojo(String projectName)
Execute the EAR plugin for the specified project.
|
protected File |
executeMojo(String projectName,
boolean expectNoError,
boolean cleanBeforeExecute)
Execute the EAR plugin for the specified project.
|
protected String[] |
getClassPathElements(File earFile,
String artifact,
boolean directory)
Retrieves elements of Class-Path entry of manifest of given EAR module.
|
protected File |
getEarArchive(File baseDir,
String projectName) |
protected File |
getEarDirectory(File baseDir,
String projectName) |
protected File |
getEarModuleDirectory(File baseDir,
String earModuleName) |
protected File |
getTargetDirectory(File basedir) |
protected File |
getTestDir(String projectName) |
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, setUp, tearDown, toString
protected File executeMojo(String projectName, boolean expectNoError, boolean cleanBeforeExecute) throws org.apache.maven.shared.verifier.VerificationException, IOException
projectName
- the name of the projectexpectNoError
- true/falsecleanBeforeExecute
- call clean plugin before executionorg.apache.maven.shared.verifier.VerificationException
IOException
protected File executeMojo(String projectName) throws org.apache.maven.shared.verifier.VerificationException, IOException
projectName
- the name of the projectorg.apache.maven.shared.verifier.VerificationException
IOException
protected File doTestProject(String projectName, String earModuleName, String[] expectedArtifacts, boolean[] artifactsDirectory, String[] artifactsToValidateManifest, boolean[] artifactsToValidateManifestDirectory, String[][] expectedClassPathElements, boolean cleanBeforeExecute) throws org.apache.maven.shared.verifier.VerificationException, IOException
projectName
- the project to testearModuleName
- the name of 1st level EAR module in multi-module project or null
if project is single-moduleexpectedArtifacts
- the list of artifacts to be found in the EAR archiveartifactsDirectory
- whether the artifact from expectedArtifacts
list is an exploded or notartifactsToValidateManifest
- the list of EAR archive artifacts to validate Class-Path entry of artifact
manifest or null
if there is no need to validate Class-Path entryartifactsToValidateManifestDirectory
- whether the artifact from artifactsToValidateManifest
list is
an exploded or not, can be null
if
artifactsToValidateManifest
is null
expectedClassPathElements
- the list of elements of Class-Path entry of manifest, rows should match
artifacts passed in artifactsToValidateManifest
parameter;
can be null
if artifactsToValidateManifest
is null
cleanBeforeExecute
- call clean plugin before executionorg.apache.maven.shared.verifier.VerificationException
IOException
protected File doTestProject(String projectName, String[] expectedArtifacts, boolean[] artifactsDirectory) throws org.apache.maven.shared.verifier.VerificationException, IOException
projectName
- the project to testexpectedArtifacts
- the list of artifacts to be found in the EAR archiveartifactsDirectory
- whether the artifact from expectedArtifacts
list is an exploded or notorg.apache.maven.shared.verifier.VerificationException
IOException
protected File doTestProject(String projectName, String[] expectedArtifacts) throws org.apache.maven.shared.verifier.VerificationException, IOException
projectName
- the project to testexpectedArtifacts
- the list of artifacts to be found in the EAR archiveorg.apache.maven.shared.verifier.VerificationException
IOException
protected File doTestProject(String projectName, String[] expectedArtifacts, boolean cleanBeforeExecute) throws org.apache.maven.shared.verifier.VerificationException, IOException
projectName
- the project to testexpectedArtifacts
- the list of artifacts to be found in the EAR archivecleanBeforeExecute
- call clean plugin before executionorg.apache.maven.shared.verifier.VerificationException
IOException
protected void assertEarModulesContent(File baseDir, String projectName, String earModuleName, String[] artifacts, boolean[] artifactsDirectory, String[][] includedEntries, String[][] excludedEntries) throws IOException
baseDir
- the directory of the tested projectprojectName
- the project to testearModuleName
- the name of 1st level EAR module in multi-module project or null
if project is single-moduleartifacts
- the list of artifacts to be found in the EAR archiveartifactsDirectory
- whether the artifact from artifacts
list is an exploded or notincludedEntries
- entries which should exist in artifacts, rows should match artifacts passed in
artifacts
parameter; can be null
if there is no need to assert
existence of entries in artifactsexcludedEntries
- entries which should not exist in artifacts, rows should match artifacts passed in
artifacts
parameter; can be null
if there is no need to assert
absence of paths in artifactsIOException
- exception in case of failure during reading of artifact archive.protected File getTestDir(String projectName) throws IOException
IOException
protected void assertDeploymentDescriptors(File baseDir, String projectName) throws IOException
expected-META-INF
directory of the
project. Note that the MANIFEST.mf
file is ignored and is not tested.baseDir
- the directory of the tested projectprojectName
- the name of the projectIOException
- exception in case of an error.protected void assertClassPathElements(File baseDir, String projectName, String[] artifacts, boolean[] artifactsDirectory, String[][] expectedClassPathElements) throws IOException
baseDir
- the directory of the tested projectprojectName
- the name of the projectartifacts
- the list of EAR archive artifacts to validate Class-Path entry of artifact manifest or
null
if there is no need to validate Class-Path entryartifactsDirectory
- whether the artifact from artifacts
list is an exploded or not,
can be null
if artifacts
is null
expectedClassPathElements
- the list of expected elements of Class-Path entry of manifest, rows should match
artifacts passed in artifacts
parameter; can be null
if artifacts
is null
IOException
- exception in case of failure during reading of artifact manifest.protected String[] getClassPathElements(File earFile, String artifact, boolean directory) throws IOException
earFile
- the EAR file to investigateartifact
- the name of artifact in EAR archive representing EAR moduleartifact
artifact in earFile
fileIOException
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.