org.apache.maven.plugin.surefire
Class AbstractSurefireMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.surefire.AbstractSurefireMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, SurefireExecutionParameters
Direct Known Subclasses:
IntegrationTestMojo, SurefirePlugin

public abstract class AbstractSurefireMojo
extends org.apache.maven.plugin.AbstractMojo
implements SurefireExecutionParameters

Abstract base class for running tests using Surefire.

Version:
$Id: SurefirePlugin.java 945065 2010-05-17 10:26:22Z stephenc $
Author:
Stephen Connolly

Nested Class Summary
 class AbstractSurefireMojo.DynamicProviderInfo
           
 
Field Summary
protected  SurefireDependencyResolver dependencyResolver
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractSurefireMojo()
           
 
Method Summary
protected abstract  void addPluginSpecificChecksumItems(ChecksumCalculator checksum)
           
protected  ForkStarter createForkStarter(ProviderInfo provider, ForkConfiguration forkConfiguration, ClassLoaderConfiguration classLoaderConfiguration)
           
protected  ProviderConfiguration createProviderConfiguration(ForkConfiguration forkConfiguration)
           
protected  StartupConfiguration createStartupConfiguration(ForkConfiguration forkConfiguration, ProviderInfo provider, ClassLoaderConfiguration classLoaderConfiguration)
           
protected  void ensureParallelRunningCompatibility()
           
protected  void ensureWorkingDirectoryExists()
           
 java.util.List generateTestClasspath()
          Generate the test classpath.
protected  ClassLoaderConfiguration getClassLoaderConfiguration(ForkConfiguration fork)
           
protected abstract  java.lang.String[] getDefaultIncludes()
           
protected  ForkConfiguration getForkConfiguration()
           
protected abstract  java.lang.String getPluginName()
           
protected  org.apache.maven.toolchain.Toolchain getToolchain()
           
protected  boolean hasExecutedBefore()
           
protected  java.util.List initialize()
           
protected  boolean isAnyConcurrencySelected()
           
protected  boolean isForkModeNever()
           
protected  void logReportsDirectory()
           
protected  void processSystemProperties(boolean setInSystem)
           
protected abstract  boolean verifyParameters()
           
protected  void warnIfUselessUseSystemClassLoaderParameter()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.surefire.SurefireExecutionParameters
getAdditionalClasspathElements, getArgLine, getArtifactFactory, getArtifactResolver, getBasedir, getClassesDirectory, getClasspathDependencyExcludes, getClasspathDependencyScopeExclude, getDebugForkedProcess, getEnvironmentVariables, getExcludedGroups, getExcludes, getFailIfNoTests, getForkedProcessTimeoutInSeconds, getForkMode, getGroups, getIncludes, getInternalSystemProperties, getJunitArtifactName, getJvm, getLocalRepository, getMetadataSource, getObjectFactory, getOriginalSystemProperties, getParallel, getPerCoreThreadCount, getPluginArtifactMap, getProject, getProjectArtifactMap, getProperties, getRemoteRepositories, getReportFormat, getReportsDirectory, getRunOrder, getSession, getSuiteXmlFiles, getSystemProperties, getSystemPropertyVariables, getTest, getTestClassesDirectory, getTestNGArtifactName, getTestSourceDirectory, getThreadCount, getToolchainManager, getUseUnlimitedThreads, getWorkingDirectory, isChildDelegation, isDisableXmlReport, isEnableAssertions, isMavenParallel, isPrintSummary, isRedirectTestOutputToFile, isSkip, isSkipExec, isSkipTests, isTrimStackTrace, isUseFile, isUseManifestOnlyJar, isUseSystemClassLoader, setAdditionalClasspathElements, setArgLine, setArtifactFactory, setArtifactResolver, setBasedir, setChildDelegation, setClassesDirectory, setClasspathDependencyExcludes, setClasspathDependencyScopeExclude, setDebugForkedProcess, setDisableXmlReport, setEnableAssertions, setEnvironmentVariables, setExcludedGroups, setExcludes, setFailIfNoTests, setForkedProcessTimeoutInSeconds, setForkMode, setGroups, setIncludes, setInternalSystemProperties, setJunitArtifactName, setJvm, setLocalRepository, setMetadataSource, setObjectFactory, setOriginalSystemProperties, setParallel, setPerCoreThreadCount, setPluginArtifactMap, setPrintSummary, setProject, setProjectArtifactMap, setProperties, setRedirectTestOutputToFile, setRemoteRepositories, setReportFormat, setReportsDirectory, setRunOrder, setSession, setSkip, setSkipExec, setSkipTests, setSuiteXmlFiles, setSystemProperties, setSystemPropertyVariables, setTest, setTestClassesDirectory, setTestNGArtifactName, setTestSourceDirectory, setThreadCount, setToolchainManager, setTrimStackTrace, setUseFile, setUseManifestOnlyJar, setUseSystemClassLoader, setUseUnlimitedThreads, setWorkingDirectory
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

dependencyResolver

protected SurefireDependencyResolver dependencyResolver
Constructor Detail

AbstractSurefireMojo

public AbstractSurefireMojo()
Method Detail

getPluginName

protected abstract java.lang.String getPluginName()

verifyParameters

protected abstract boolean verifyParameters()
                                     throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

initialize

protected java.util.List initialize()
                             throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

logReportsDirectory

protected void logReportsDirectory()

getToolchain

protected final org.apache.maven.toolchain.Toolchain getToolchain()

isAnyConcurrencySelected

protected boolean isAnyConcurrencySelected()

isForkModeNever

protected boolean isForkModeNever()

createProviderConfiguration

protected ProviderConfiguration createProviderConfiguration(ForkConfiguration forkConfiguration)
                                                     throws org.apache.maven.plugin.MojoExecutionException,
                                                            org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

createStartupConfiguration

protected StartupConfiguration createStartupConfiguration(ForkConfiguration forkConfiguration,
                                                          ProviderInfo provider,
                                                          ClassLoaderConfiguration classLoaderConfiguration)
                                                   throws org.apache.maven.plugin.MojoExecutionException,
                                                          org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

createForkStarter

protected ForkStarter createForkStarter(ProviderInfo provider,
                                        ForkConfiguration forkConfiguration,
                                        ClassLoaderConfiguration classLoaderConfiguration)
                                 throws org.apache.maven.plugin.MojoExecutionException,
                                        org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getForkConfiguration

protected ForkConfiguration getForkConfiguration()

addPluginSpecificChecksumItems

protected abstract void addPluginSpecificChecksumItems(ChecksumCalculator checksum)

hasExecutedBefore

protected boolean hasExecutedBefore()

getClassLoaderConfiguration

protected ClassLoaderConfiguration getClassLoaderConfiguration(ForkConfiguration fork)

getDefaultIncludes

protected abstract java.lang.String[] getDefaultIncludes()

generateTestClasspath

public java.util.List generateTestClasspath()
                                     throws org.apache.maven.artifact.DependencyResolutionRequiredException,
                                            org.apache.maven.plugin.MojoExecutionException
Generate the test classpath.

Returns:
List containing the classpath elements
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException - when dependency resolution fails
org.apache.maven.plugin.MojoExecutionException - upon other problems

processSystemProperties

protected void processSystemProperties(boolean setInSystem)

ensureWorkingDirectoryExists

protected void ensureWorkingDirectoryExists()
                                     throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

ensureParallelRunningCompatibility

protected void ensureParallelRunningCompatibility()
                                           throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

warnIfUselessUseSystemClassLoaderParameter

protected void warnIfUselessUseSystemClassLoaderParameter()


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.