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

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
 
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  SurefireStarter createInprocessStarter(ProviderInfo provider, ForkConfiguration forkConfiguration, ClassLoaderConfiguration classLoaderConfiguration)
           
protected  ProviderConfiguration createProviderConfiguration()
           
protected  List createProviders()
           
 void execute()
           
protected  void executeAfterPreconditionsChecked()
           
protected  ClassLoaderConfiguration getClassLoaderConfiguration(ForkConfiguration fork)
           
protected abstract  String[] getDefaultIncludes()
           
protected  ForkConfiguration getForkConfiguration()
           
protected abstract  String getPluginName()
           
protected abstract  void handleSummary(Summary summary)
           
protected  boolean hasExecutedBefore()
           
protected  boolean isAnyConcurrencySelected()
           
protected abstract  boolean isSkipExecution()
           
protected  void logReportsDirectory()
           
protected  void restoreOriginalSystemPropertiesWhenNotForking(Summary summary)
           
 
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, getReportNameSuffix, getReportsDirectory, getRunOrder, getSession, getSuiteXmlFiles, getSystemProperties, getSystemPropertiesFile, getSystemPropertyVariables, getTest, getTestClassesDirectory, getTestMethod, 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, setReportNameSuffix, setReportsDirectory, setRunOrder, setSession, setSkip, setSkipExec, setSkipTests, setSuiteXmlFiles, setSystemProperties, setSystemPropertiesFile, setSystemPropertyVariables, setTest, setTestClassesDirectory, setTestNGArtifactName, setTestSourceDirectory, setThreadCount, setToolchainManager, setTrimStackTrace, setUseFile, setUseManifestOnlyJar, setUseSystemClassLoader, setUseUnlimitedThreads, setWorkingDirectory
 

Constructor Detail

AbstractSurefireMojo

public AbstractSurefireMojo()
Method Detail

getPluginName

protected abstract String getPluginName()

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Specified by:
execute in interface org.apache.maven.plugin.Mojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

isSkipExecution

protected abstract boolean isSkipExecution()

executeAfterPreconditionsChecked

protected void executeAfterPreconditionsChecked()
                                         throws org.apache.maven.plugin.MojoExecutionException,
                                                org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

createProviders

protected List createProviders()
                        throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

handleSummary

protected abstract void handleSummary(Summary summary)
                               throws org.apache.maven.plugin.MojoExecutionException,
                                      org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

restoreOriginalSystemPropertiesWhenNotForking

protected void restoreOriginalSystemPropertiesWhenNotForking(Summary summary)

logReportsDirectory

protected void logReportsDirectory()

isAnyConcurrencySelected

protected boolean isAnyConcurrencySelected()

createProviderConfiguration

protected ProviderConfiguration createProviderConfiguration()
                                                     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

createInprocessStarter

protected SurefireStarter createInprocessStarter(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 String[] getDefaultIncludes()


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