use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method failsToDeploysAppZipWithInvalidPrivilegedExtensionPlugin.
@Test
public void failsToDeploysAppZipWithInvalidPrivilegedExtensionPlugin() throws Exception {
ArtifactPluginFileBuilder invalidPrivilegedPlugin = new ArtifactPluginFileBuilder("invalidPrivilegedPlugin").dependingOn(new JarFileBuilder("privilegedExtensionV1", privilegedExtensionV1JarFile)).configuredWith(EXPORTED_RESOURCE_PROPERTY, "/");
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("invalidPrivilegedPluginApp").definedBy(APP_WITH_PRIVILEGED_EXTENSION_PLUGIN_CONFIG).dependingOn(invalidPrivilegedPlugin);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertDeploymentFailure(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class ApplicationDeploymentTestCase method failsToDeployApplicationOnMissingService.
@Test
public void failsToDeployApplicationOnMissingService() throws Exception {
ArtifactPluginFileBuilder extensionPlugin = new ArtifactPluginFileBuilder("extensionPlugin").dependingOn(new JarFileBuilder("bundleExtensionv1", helloExtensionV1JarFile)).configuredWith(EXPORTED_RESOURCE_PROPERTY, "/, META-INF");
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("appWithExtensionPlugin").definedBy(APP_WITH_EXTENSION_PLUGIN_CONFIG).dependingOn(extensionPlugin);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertDeploymentFailure(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class ApplicationPolicyDeploymentTestCase method createInjectedHelloExtensionPluginFileBuilder.
private ArtifactPluginFileBuilder createInjectedHelloExtensionPluginFileBuilder() throws URISyntaxException {
File injectedHelloExtensionJarFile = new CompilerUtils.ExtensionCompiler().compiling(getResourceFile("/org/foo/injected/InjectedHelloExtension.java"), getResourceFile("/org/foo/injected/InjectedHelloOperation.java")).compile("mule-module-hello-1.0.jar", "1.0");
MulePluginModel.MulePluginModelBuilder mulePluginModelBuilder = new MulePluginModel.MulePluginModelBuilder().setMinMuleVersion(MIN_MULE_VERSION).setName("helloExtensionPlugin").setRequiredProduct(MULE).withBundleDescriptorLoader(createBundleDescriptorLoader("helloExtensionPlugin", MULE_EXTENSION_CLASSIFIER, PROPERTIES_BUNDLE_DESCRIPTOR_LOADER_ID, "1.0.0"));
mulePluginModelBuilder.withClassLoaderModelDescriptorLoader(new MuleArtifactLoaderDescriptorBuilder().setId(MULE_LOADER_ID).addProperty(EXPORTED_RESOURCES, asList("/", "META-INF/mule-hello.xsd", "META-INF/spring.handlers", "META-INF/spring.schemas")).build());
mulePluginModelBuilder.withExtensionModelDescriber().setId(JAVA_LOADER_ID).addProperty("type", "org.foo.injected.InjectedHelloExtension").addProperty("version", "1.0");
return new ArtifactPluginFileBuilder("helloExtensionPlugin-1.0").dependingOn(new JarFileBuilder("helloExtensionV1", injectedHelloExtensionJarFile)).describedBy((mulePluginModelBuilder.build()));
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class ApplicationPolicyDeploymentTestCase method createSingleExtensionPlugin.
private ArtifactPluginFileBuilder createSingleExtensionPlugin() {
MulePluginModel.MulePluginModelBuilder mulePluginModelBuilder = new MulePluginModel.MulePluginModelBuilder().setMinMuleVersion(MIN_MULE_VERSION).setName("simpleExtensionPlugin").setRequiredProduct(MULE).withBundleDescriptorLoader(createBundleDescriptorLoader("simpleExtensionPlugin", 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.SimpleExtension").addProperty("version", "1.0.0");
return new ArtifactPluginFileBuilder("simpleExtensionPlugin").dependingOn(new JarFileBuilder("simpleExtension", simpleExtensionJarFile)).describedBy(mulePluginModelBuilder.build());
}
use of org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder in project mule by mulesoft.
the class DomainDeploymentTestCase method deploysDomainWithSharedLibPrecedenceOverApplicationPluginLib.
@Test
public void deploysDomainWithSharedLibPrecedenceOverApplicationPluginLib() throws Exception {
final String domainId = "shared-lib";
final ArtifactPluginFileBuilder pluginFileBuilder = new ArtifactPluginFileBuilder("echoPlugin1").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo").containingClass(pluginEcho1TestClassFile, "org/foo/Plugin1Echo.class").dependingOn(new JarFileBuilder("barUtils2_0", barUtils2_0JarFile));
final DomainFileBuilder domainFileBuilder = new DomainFileBuilder(domainId).dependingOnSharedLibrary(new JarFileBuilder("barUtils1.0", barUtils1_0JarFile)).definedBy("empty-domain-config.xml");
final ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("shared-lib-precedence-app").definedBy("app-shared-lib-precedence-config.xml").dependingOn(pluginFileBuilder).dependingOn(domainFileBuilder);
addPackedDomainFromBuilder(domainFileBuilder);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertDeploymentSuccess(domainDeploymentListener, domainFileBuilder.getId());
assertApplicationDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
executeApplicationFlow("main");
}
Aggregations