public abstract class AbstractMunitMojo
extends org.apache.maven.plugin.AbstractMojo
| Constructor and Description |
|---|
AbstractMunitMojo() |
| Modifier and Type | Method and Description |
|---|---|
JVMStarter |
createJVMStarter(File runConfigurationFile,
List<String> argLines) |
protected RemoteRepositoriesLocator |
createRemoteRepositoriesLocator() |
protected JVMStarter |
createTestRunExecutor(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) |
void |
doExecute() |
void |
execute() |
protected void |
failBuildIfNecessary(Map<TargetRuntime,RunResult> runResults) |
protected abstract org.mule.munit.remote.api.project.ApplicationStructureGenerator |
getApplicationStructureGenerator() |
List<String> |
getEffectiveArgLines(String starterJarFileName,
File log4jConfigurationFile) |
protected abstract File |
getMuleApplicationJsonPath() |
protected org.mule.runtime.api.deployment.meta.MuleApplicationModel |
getMuleApplicationModel() |
protected MuleApplicationModelLoader |
getMuleApplicationModelLoader() |
protected abstract ResultPrinterFactory |
getResultPrinterFactory() |
protected abstract Map<TargetRuntime,org.mule.munit.remote.api.configuration.RunConfiguration> |
getRunConfigurations() |
File |
getWorkingDirectory() |
protected void |
handleRunResult(TargetRuntime targetRuntime,
RunResult runResult) |
protected boolean |
hasExecutedBefore()
This method avoids running MUnit more than once.
|
protected void |
init() |
protected void |
saveAsJsonDataToFile(Object data,
File dataLocation) |
File |
saveRunConfigurationToFile(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) |
protected static final String ARG_TOKEN
protected static final String RUN_CONFIGURATION_ARG
public static final String RUN_CONFIGURATION_JSON
public static final String STARTER_CLASS_FILE
public static final String MUNIT_PREVIOUS_RUN_PLACEHOLDER
protected static final Class REMOTE_RUNNER_CLASS
public static final String MULE_ARTIFACT_JSON_FILE_NAME
@Parameter(property="munit.test") public String munitTest
@Parameter(property="munit.tags") public String munitTags
@Parameter(property="munit.failIfNoTests",
defaultValue="true")
public boolean munitFailIfNoTests
@Parameter(property="munit.debug") public String munitDebug
@Parameter(property="runtimeVersion") public String runtimeVersion
@Parameter(property="runtimeProduct") public String runtimeProduct
@Parameter(defaultValue="${skipMunitTests}")
public boolean skipMunitTests
@Parameter(defaultValue="${project.build.directory}/test-mule/munit")
public File munitTestsDirectory
@Parameter(property="project",
required=true)
public org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${session}",
readonly=true)
public org.apache.maven.execution.MavenSession session
@Parameter(defaultValue="${repositorySystemSession}",
readonly=true)
public org.eclipse.aether.RepositorySystemSession repositorySystemSession
@Parameter(defaultValue="${plugin.artifactId}")
public String pluginArtifactId
@Parameter(property="redirectTestOutputToFile",
defaultValue="false")
public boolean redirectTestOutputToFile
@Parameter(defaultValue="${project.build.directory}/munit-reports/output/")
public File testOutputDirectory
@Parameter(property="enableSurefireReports",
defaultValue="true")
public boolean enableSurefireReports
@Parameter(defaultValue="${project.build.directory}/surefire-reports/")
public File surefireReportsFolder
@Parameter(property="skipAfterFailure",
defaultValue="false")
public boolean skipAfterFailure
@Parameter(property="munit.jvm") public String jvm
@Parameter(property="system.property.variables") public Map<String,String> systemPropertyVariables
@Parameter(property="environment.variables") public Map<String,String> environmentVariables
@Parameter(property="maven.test.failure.ignore",
defaultValue="false")
public boolean testFailureIgnore
@Component protected org.apache.maven.toolchain.ToolchainManager toolchainManager
@Component public org.eclipse.aether.RepositorySystem repositorySystem
protected com.google.gson.Gson gson
public JVMLocator jvmLocator
public JarFileFactory jarFileFactory
public ClasspathManager classpathManager
public MessageHandlerFactory messageHandlerFactory
public WorkingDirectoryGenerator workingDirectoryGenerator
public MuleApplicationModelLoader muleApplicationModelLoader
public RuntimeVersionProviderFactory runtimeVersionProviderFactory
public RuntimeVersionsLocator runtimeVersionsLocator
public ResultPrinterFactory resultPrinterFactory
protected void init()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected boolean hasExecutedBefore()
public void doExecute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected JVMStarter createTestRunExecutor(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) throws IOException
IOExceptionprotected void handleRunResult(TargetRuntime targetRuntime, RunResult runResult)
protected void failBuildIfNecessary(Map<TargetRuntime,RunResult> runResults) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected abstract Map<TargetRuntime,org.mule.munit.remote.api.configuration.RunConfiguration> getRunConfigurations() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected abstract ResultPrinterFactory getResultPrinterFactory()
protected abstract org.mule.munit.remote.api.project.ApplicationStructureGenerator getApplicationStructureGenerator()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected abstract File getMuleApplicationJsonPath()
public List<String> getEffectiveArgLines(String starterJarFileName, File log4jConfigurationFile)
public JVMStarter createJVMStarter(File runConfigurationFile, List<String> argLines) throws IOException
IOExceptionpublic File saveRunConfigurationToFile(org.mule.munit.remote.api.configuration.RunConfiguration runConfiguration) throws IOException
IOExceptionprotected MuleApplicationModelLoader getMuleApplicationModelLoader() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected org.mule.runtime.api.deployment.meta.MuleApplicationModel getMuleApplicationModel()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic File getWorkingDirectory()
protected RemoteRepositoriesLocator createRemoteRepositoriesLocator()
Copyright © 2019. All rights reserved.