use of org.mule.runtime.api.deployment.meta.MuleArtifactLoaderDescriptorBuilder 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.api.deployment.meta.MuleArtifactLoaderDescriptorBuilder in project mule by mulesoft.
the class AbstractDeploymentTestCase method createExceptionThrowingPluginFileBuilder.
private ArtifactPluginFileBuilder createExceptionThrowingPluginFileBuilder() {
final String pluginName = "exceptionPlugin";
MulePluginModel.MulePluginModelBuilder mulePluginModelBuilder = new MulePluginModel.MulePluginModelBuilder().setMinMuleVersion(MIN_MULE_VERSION).setName(pluginName).setRequiredProduct(MULE).withBundleDescriptorLoader(createBundleDescriptorLoader(pluginName, MULE_PLUGIN_CLASSIFIER, PROPERTIES_BUNDLE_DESCRIPTOR_LOADER_ID, "1.0.0"));
mulePluginModelBuilder.withClassLoaderModelDescriptorLoader(new MuleArtifactLoaderDescriptorBuilder().setId(MULE_LOADER_ID).addProperty(EXPORTED_RESOURCES, asList("/META-INF/mule-exception.xsd", "/META-INF/mule.schemas")).build());
File exceptionTestClassFile = null;
File serviceTestClassFile = null;
try {
exceptionTestClassFile = new CompilerUtils.SingleClassCompiler().compile(getResourceFile("/org/exception/CustomException.java"));
serviceTestClassFile = new CompilerUtils.SingleClassCompiler().compile(getResourceFile("/org/exception/ExceptionComponentBuildingDefinitionProvider.java"));
} catch (URISyntaxException e) {
fail(e.getMessage());
}
ArtifactPluginFileBuilder exceptionPluginFileBuilder = new ArtifactPluginFileBuilder("exceptionPlugin").containingResource("exception/META-INF/mule.schemas", "META-INF/mule.schemas").containingResource("exception/META-INF/mule-exception.xsd", "META-INF/mule-exception.xsd").containingResource("exception/META-INF/services/org.mule.runtime.dsl.api.component.ComponentBuildingDefinitionProvider", "META-INF/services/org.mule.runtime.dsl.api.component.ComponentBuildingDefinitionProvider").containingClass(exceptionTestClassFile, "org/exception/CustomException.class").containingClass(serviceTestClassFile, "org/exception/ExceptionComponentBuildingDefinitionProvider.class").configuredWith(EXPORTED_RESOURCE_PROPERTY, "META-INF/mule-exception.xsd,META-INF/mule.schemas").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.exception").describedBy(mulePluginModelBuilder.build());
return exceptionPluginFileBuilder;
}
use of org.mule.runtime.api.deployment.meta.MuleArtifactLoaderDescriptorBuilder 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.api.deployment.meta.MuleArtifactLoaderDescriptorBuilder 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.api.deployment.meta.MuleArtifactLoaderDescriptorBuilder 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());
}
Aggregations