use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class AbstractDeploymentTestCase method createHelloExtensionV2PluginFileBuilder.
private ArtifactPluginFileBuilder createHelloExtensionV2PluginFileBuilder() {
MulePluginModelBuilder mulePluginModelBuilder = new MulePluginModelBuilder().setMinMuleVersion(MIN_MULE_VERSION).setName("helloExtensionPlugin").setRequiredProduct(MULE).withBundleDescriptorLoader(createBundleDescriptorLoader("helloExtensionPlugin", MULE_EXTENSION_CLASSIFIER, PROPERTIES_BUNDLE_DESCRIPTOR_LOADER_ID, "2.0.0"));
mulePluginModelBuilder.withClassLoaderModelDescriptorLoader(new MuleArtifactLoaderDescriptorBuilder().setId(MULE_LOADER_ID).build());
mulePluginModelBuilder.withExtensionModelDescriber().setId(JAVA_LOADER_ID).addProperty("type", "org.foo.hello.HelloExtension").addProperty("version", "2.0.0");
return new ArtifactPluginFileBuilder("helloExtensionPlugin-2.0.0").dependingOn(new JarFileBuilder("helloExtensionV2", helloExtensionV2JarFile)).describedBy((mulePluginModelBuilder.build()));
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method createPrivilegedExtensionPlugin.
private ArtifactPluginFileBuilder createPrivilegedExtensionPlugin() {
MulePluginModel.MulePluginModelBuilder mulePluginModelBuilder = new MulePluginModel.MulePluginModelBuilder().setMinMuleVersion(MIN_MULE_VERSION).setName(PRIVILEGED_EXTENSION_ARTIFACT_ID).setRequiredProduct(MULE).withBundleDescriptorLoader(createBundleDescriptorLoader(PRIVILEGED_EXTENSION_ARTIFACT_ID, MULE_EXTENSION_CLASSIFIER, PROPERTIES_BUNDLE_DESCRIPTOR_LOADER_ID, "1.0.0"));
mulePluginModelBuilder.withClassLoaderModelDescriptorLoader(new MuleArtifactLoaderDescriptorBuilder().setId(MULE_LOADER_ID).build());
mulePluginModelBuilder.withExtensionModelDescriber().setId(JAVA_LOADER_ID).addProperty("type", "org.foo.hello.PrivilegedExtension").addProperty("version", "1.0");
return new ArtifactPluginFileBuilder(PRIVILEGED_EXTENSION_ARTIFACT_ID).dependingOn(new JarFileBuilder("privilegedExtensionV1", privilegedExtensionV1JarFile)).describedBy(mulePluginModelBuilder.build());
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder 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.JarFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysMultiPluginVersionLib.
@Test
public void deploysMultiPluginVersionLib() throws Exception {
final ArtifactPluginFileBuilder echoPluginWithLib2 = new ArtifactPluginFileBuilder("echoPlugin2").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.echo").dependingOn(new JarFileBuilder("barUtils2", barUtils2_0JarFile)).containingClass(pluginEcho2TestClassFile, "org/foo/echo/Plugin2Echo.class");
final ApplicationFileBuilder multiLibPluginAppFileBuilder = new ApplicationFileBuilder("multiPluginLibVersion").definedBy("multi-plugin-app-config.xml").dependingOn(echoPluginWithLib1).dependingOn(echoPluginWithLib2);
addPackedAppFromBuilder(multiLibPluginAppFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, multiLibPluginAppFileBuilder.getId());
executeApplicationFlow("main");
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysApplicationWithPrivilegedPluginDependingOnPlugin.
@Test
public void deploysApplicationWithPrivilegedPluginDependingOnPlugin() throws Exception {
ArtifactPluginFileBuilder echoPlugin = new ArtifactPluginFileBuilder("echoPlugin").configuredWith(PRIVILEGED_EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo").configuredWith(PRIVILEGED_ARTIFACTS_PROPERTY, "org.mule.test:dependantPlugin").dependingOn(new JarFileBuilder("echoTestJar", echoTestJarFile));
ArtifactPluginFileBuilder dependantPlugin = new ArtifactPluginFileBuilder("dependantPlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.echo").containingClass(pluginEcho3TestClassFile, "org/foo/echo/Plugin3Echo.class").dependingOn(echoPlugin);
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("plugin-depending-on-plugin-app").definedBy("plugin-depending-on-plugin-app-config.xml").dependingOn(dependantPlugin);
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, artifactFileBuilder.getId());
executeApplicationFlow("main");
}
Aggregations