use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppWithPluginSharedLibrary.
@Test
public void deploysAppWithPluginSharedLibrary() throws Exception {
final ArtifactPluginFileBuilder echoPluginWithoutLib1 = new ArtifactPluginFileBuilder("echoPlugin1").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo").containingClass(pluginEcho1TestClassFile, "org/foo/Plugin1Echo.class");
final 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 deploysAppZipWithPrivilegedExtensionPlugin.
@Test
public void deploysAppZipWithPrivilegedExtensionPlugin() throws Exception {
ArtifactPluginFileBuilder privilegedExtensionPlugin = createPrivilegedExtensionPlugin();
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("privilegedPluginApp").definedBy(APP_WITH_PRIVILEGED_EXTENSION_PLUGIN_CONFIG).dependingOn(privilegedExtensionPlugin);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppProvidingResourceForPlugin.
@Test
public void deploysAppProvidingResourceForPlugin() throws Exception {
File resourceConsumerClassFile = new CompilerUtils.SingleClassCompiler().compile(getResourceFile("/org/foo/resource/ResourceConsumer.java"));
final ArtifactPluginFileBuilder pluginUsingAppResource = new ArtifactPluginFileBuilder("appResourcePlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.resource").containingClass(resourceConsumerClassFile, "org/foo/resource/ResourceConsumer.class");
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("appProvidingResourceForPlugin").definedBy("app-providing-resource-for-plugin.xml").dependingOn(pluginUsingAppResource).configuredWith(EXPORTED_RESOURCES, "META-INF/app-resource.txt").usingResource(getResourceFile("/test-resource.txt").toString(), "META-INF/app-resource.txt");
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, artifactFileBuilder.getId());
executeApplicationFlow("main");
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppZipWithExtensionPlugin.
@Test
public void deploysAppZipWithExtensionPlugin() throws Exception {
ApplicationFileBuilder applicationFileBuilder = createExtensionApplicationWithServices(APP_WITH_EXTENSION_PLUGIN_CONFIG, helloExtensionV1Plugin);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder in project mule by mulesoft.
the class ApplicationPolicyDeploymentTestCase method appliesApplicationPolicyDuplicatingPlugin.
@Test
public void appliesApplicationPolicyDuplicatingPlugin() throws Exception {
policyManager.registerPolicyTemplate(exceptionThrowingPluginImportingPolicyFileBuilder.getArtifactFile());
ApplicationFileBuilder applicationFileBuilder = createExtensionApplicationWithServices(APP_WITH_EXTENSION_PLUGIN_CONFIG, exceptionThrowingPlugin, helloExtensionV1Plugin);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
policyManager.addPolicy(applicationFileBuilder.getId(), exceptionThrowingPluginImportingPolicyFileBuilder.getArtifactId(), new PolicyParametrization(EXCEPTION_POLICY_NAME, s -> true, 1, emptyMap(), getResourceFile("/exceptionThrowingPolicy.xml"), emptyList()));
try {
executeApplicationFlow("main");
fail("Flow execution was expected to throw an exception");
} catch (MuleRuntimeException expected) {
assertThat(expected.getCause().getCause().getClass().getName(), is(equalTo("org.exception.CustomException")));
}
}
Aggregations