use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class AbstractDeploymentTestCase method createExtensionApplicationWithServices.
protected ApplicationFileBuilder createExtensionApplicationWithServices(String appConfigFile, ArtifactPluginFileBuilder... plugins) throws Exception {
installEchoService();
installFooService();
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("appWithExtensionPlugin").definedBy(appConfigFile);
for (ArtifactPluginFileBuilder plugin : plugins) {
applicationFileBuilder.dependingOn(plugin);
}
return applicationFileBuilder;
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppWithPluginBootstrapProperty.
@Test
public void deploysAppWithPluginBootstrapProperty() throws Exception {
final ArtifactPluginFileBuilder pluginFileBuilder = new ArtifactPluginFileBuilder("bootstrapPlugin").containingResource("plugin-bootstrap.properties", BOOTSTRAP_PROPERTIES).containingClass(echoTestClassFile, "org/foo/EchoTest.class").configuredWith(EXPORTED_RESOURCE_PROPERTY, BOOTSTRAP_PROPERTIES);
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("app-with-plugin-bootstrap").definedBy("app-with-plugin-bootstrap.xml").dependingOn(pluginFileBuilder);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
final Application application = findApp(applicationFileBuilder.getId(), 1);
final Optional<Object> lookupObject = application.getRegistry().lookupByName("plugin.echotest");
assertThat(lookupObject.isPresent(), is(true));
assertThat(lookupObject.get().getClass().getName(), equalTo("org.foo.EchoTest"));
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method removesPreviousAppFolderOnRedeploy.
@Test
public void removesPreviousAppFolderOnRedeploy() throws Exception {
startDeployment();
addPackedAppFromBuilder(emptyAppFileBuilder);
assertApplicationDeploymentSuccess(applicationDeploymentListener, emptyAppFileBuilder.getId());
assertAppsDir(NONE, new String[] { emptyAppFileBuilder.getId() }, true);
assertEquals("Application has not been properly registered with Mule", 1, deploymentService.getApplications().size());
reset(applicationDeploymentListener);
ApplicationFileBuilder emptyAppFileBuilder = new ApplicationFileBuilder("empty-app").usingResource("empty-config.xml", "empty-config.xml").deployedWith(PROPERTY_CONFIG_RESOURCES, "empty-config.xml");
addPackedAppFromBuilder(emptyAppFileBuilder);
assertApplicationRedeploymentSuccess(emptyAppFileBuilder.getId());
assertApplicationFiles(emptyAppFileBuilder.getId(), new String[] { "empty-config.xml" });
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppWithPluginExportingAlreadyProvidedAppPackage.
@Test
public void deploysAppWithPluginExportingAlreadyProvidedAppPackage() throws Exception {
// Defines a plugin that exports org.bar which is also exported on the application
ArtifactPluginFileBuilder echoPluginWithoutLib1 = new ArtifactPluginFileBuilder("echoPlugin1").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo,org.bar").containingClass(pluginEcho1TestClassFile, "org/foo/Plugin1Echo.class");
ApplicationFileBuilder sharedLibPluginAppFileBuilder = new ApplicationFileBuilder("shared-plugin-lib-app").definedBy("app-with-echo1-plugin-config.xml").dependingOn(echoPluginWithoutLib1).dependingOnSharedLibrary(new JarFileBuilder("barUtils", barUtils1_0JarFile));
addPackedAppFromBuilder(sharedLibPluginAppFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, sharedLibPluginAppFileBuilder.getId());
assertAppsDir(NONE, new String[] { sharedLibPluginAppFileBuilder.getId() }, true);
assertApplicationAnchorFileExists(sharedLibPluginAppFileBuilder.getId());
executeApplicationFlow("main");
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppZipWithExtensionUpperCaseAfterStartup.
@Test
public void deploysAppZipWithExtensionUpperCaseAfterStartup() throws Exception {
final ApplicationFileBuilder dummyAppDescriptorFileBuilderWithUpperCaseInExtension = new ApplicationFileBuilder("dummy-app", true).definedBy("dummy-app-config.xml").configuredWith("myCustomProp", "someValue").containingClass(echoTestClassFile, "org/foo/EchoTest.class");
deployAfterStartUp(dummyAppDescriptorFileBuilderWithUpperCaseInExtension);
}
Aggregations