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 abstract org.mule.munit.remote.api.configuration.RunConfiguration |
createRunConfiguration(TargetRuntime targetRuntime) |
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<org.mule.tools.model.Deployment> |
getDeployments() |
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 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 boolean |
shouldDiscoverRuntimes(Optional<DiscoverRuntimes> discoverRuntimes) |
void |
validateProperties() |
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(property="enableSonarReports",
defaultValue="true")
public boolean enableSonarReports
@Parameter(defaultValue="${project.build.directory}/surefire-reports/")
public File surefireReportsFolder
@Parameter(defaultValue="${project.build.directory}/sonar-reports/")
public File sonarReportsFolder
@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
@Parameter public RuntimeConfiguration runtimeConfiguration
@Component protected org.apache.maven.toolchain.ToolchainManager toolchainManager
@Component public org.eclipse.aether.RepositorySystem repositorySystem
@Component protected org.apache.maven.project.ProjectBuilder projectBuilder
@Component protected org.apache.maven.repository.RepositorySystem mavenRepositorySystem
@Parameter(property="project.build.directory",
required=true)
public File outputDirectory
@Parameter(readonly=true,
required=true,
defaultValue="${localRepository}")
public org.apache.maven.artifact.repository.ArtifactRepository localRepository
@Parameter(readonly=true,
required=true,
defaultValue="${project.remoteArtifactRepositories}")
public List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories
@Parameter(defaultValue="${project.basedir}")
public File projectBaseFolder
@Parameter public org.mule.tools.model.anypoint.CloudHubDeployment cloudHubDeployment
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 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()
protected abstract org.mule.munit.remote.api.configuration.RunConfiguration createRunConfiguration(TargetRuntime targetRuntime) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected Map<TargetRuntime,org.mule.munit.remote.api.configuration.RunConfiguration> getRunConfigurations() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected boolean shouldDiscoverRuntimes(Optional<DiscoverRuntimes> discoverRuntimes)
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()
public List<org.mule.tools.model.Deployment> getDeployments()
public void validateProperties()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionCopyright © 2020. All rights reserved.