public class MuleDeployment extends MuleInstallation
public class MuleApplicationTestCase {
@ClassRule
public static MuleDeployment deployment =
builder().withApplications("/path/to/application.zip").withProperty("-M-Dproperty", "value").timeout(120).deploy();
@Test
public void useApplication() throws IOException {
// App is deployed
// This code exercises the application
}
}
| System Property | Default Value | Description |
| mule.test.deleteOnExit | true | When false, keeps the used Mule Server under target/server/TEST_NAME |
| mule.test.stopOnExit | true | When false, keeps the used Mule Server running |
| mule.test.deployment.timeout | 60000 | Timeout for starting Mule (in milliseconds) |
| mule.test.debug | false | Mule server wait for remote debugger attachment. |
| Modifier and Type | Class and Description |
|---|---|
static class |
MuleDeployment.Builder |
location| Modifier | Constructor and Description |
|---|---|
protected |
MuleDeployment() |
protected |
MuleDeployment(String zippedDistribution) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
after() |
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
byte[] |
attachAppLog(String appName)
Utility method to generate Application log attachment for the Allure report
|
String |
attachProperties()
Utility method to generate System properties attachment for the Allure report
|
byte[] |
attachServerLog()
Utility method to generate Runtime server log attachment for the Allure report
|
protected void |
before() |
static MuleDeployment.Builder |
builder() |
static MuleDeployment.Builder |
builder(String zippedDistribution) |
MuleProcessController |
getMuleProcessController() |
void |
startMule() |
void |
stopMule() |
getMuleHomeprotected MuleDeployment()
protected MuleDeployment(String zippedDistribution)
public static MuleDeployment.Builder builder()
public static MuleDeployment.Builder builder(String zippedDistribution)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRuleapply in class MuleInstallationprotected void before()
throws Throwable
before in class MuleInstallationThrowableprotected void after()
after in class MuleInstallationpublic void startMule()
public void stopMule()
@Attachment(value="Properties") public String attachProperties()
@Attachment(value="Server log ",
type="text/plain",
fileExtension=".log")
public byte[] attachServerLog()
@Attachment(value="Application {appName} log",
type="text/plain",
fileExtension=".log")
public byte[] attachAppLog(String appName)
appName - the application namepublic MuleProcessController getMuleProcessController()
Copyright © 2003–2021 MuleSoft, Inc.. All rights reserved.