@Mojo(name="test",
defaultPhase=TEST,
requiresDependencyResolution=TEST)
public class MUnitMojo
extends org.apache.maven.plugin.AbstractMojo
MUnit Mojo to run tests
| Constructor and Description |
|---|
MUnitMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected JVMStarter |
createJVMStarter(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) |
protected void |
doExecute() |
void |
execute() |
protected void |
generateApplicationStructure() |
protected List<String> |
getEffectiveArgLines(String starterJarFileName) |
protected File |
getWorkingDirectory() |
protected boolean |
hasExecutedBefore()
This method avoids running MUnit more than once.
|
protected void |
init() |
protected File |
saveRunConfigurationToFile(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) |
public static final String STARTER_CLASS_FILE
public static final String RUN_CONFIGURATION_JSON
public static final String MULE_ARTIFACT_JSON_FILE_NAME
public static final String MUNIT_PREVIOUS_RUN_PLACEHOLDER
@Parameter(property="project",
required=true)
protected org.apache.maven.project.MavenProject project
@Parameter(property="project.testClasspathElements",
required=true,
readonly=true)
protected List<String> classpathElements
@Parameter(property="munit.test") protected String munitTest
@Parameter(property="munit.tags") protected String munitTags
@Parameter(defaultValue="${skipMunitTests}")
protected boolean skipMunitTests
@Parameter(property="skipAfterFailure",
defaultValue="false")
protected boolean skipAfterFailure
@Parameter(property="system.property.variables") protected Map<String,String> systemPropertyVariables
@Parameter(property="environment.variables") protected Map<String,String> environmentVariables
@Parameter(property="munit.coverage") protected Coverage coverage
@Parameter(defaultValue="${project.build.directory}/test-mule/munit")
protected File munitTestsDirectory
@Parameter(property="redirectTestOutputToFile",
defaultValue="false")
protected boolean redirectTestOutputToFile
@Parameter(defaultValue="${project.build.directory}/munit-reports/output/")
protected File testOutputDirectory
@Parameter(property="enableSurefireReports",
defaultValue="true")
protected boolean enableSurefireReports
@Parameter(defaultValue="${project.build.directory}/surefire-reports/")
protected File surefireReportsFolder
@Parameter(property="runtimeVersion") protected String runtimeVersion
@Parameter(property="runtimeProduct") protected String runtimeProduct
@Parameter(defaultValue="${session}",
readonly=true)
protected org.apache.maven.execution.MavenSession session
@Parameter(defaultValue="${plugin.version}")
protected String pluginVersion
@Parameter(property="munit.coverageReportData",
defaultValue="${project.build.directory}/munit-reports/coverage-report.data")
protected File coverageReportDataFile
@Parameter(property="munit.coverageConfigData",
defaultValue="${project.build.directory}/munit-reports/coverage-config.data")
protected File coverageConfigDataFile
@Component protected org.apache.maven.toolchain.ToolchainManager toolchainManager
protected MojoExecutionExceptionFactory exceptionFactory
protected ClasspathManager classpathManager
protected CoverageLimitsChecker coverageLimitsChecker
protected ResultPrinterFactory resultPrinterFactory
protected MessageHandlerFactory messageHandlerFactory
protected RunConfigurationFactory runConfigurationFactory
protected JVMLocator jvmLocator
protected JarFileFactory jarFileFactory
protected MuleApplicationModelLoader muleApplicationModelLoader
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected boolean hasExecutedBefore()
protected void init()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void doExecute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void generateApplicationStructure()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected JVMStarter createJVMStarter(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) throws org.apache.maven.plugin.MojoExecutionException, IOException
org.apache.maven.plugin.MojoExecutionExceptionIOExceptionprotected File saveRunConfigurationToFile(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) throws IOException
IOExceptionprotected File getWorkingDirectory()
Copyright © 2017. All rights reserved.