Search in sources :

Example 6 with TestArtifactDescriptor

use of org.mule.runtime.module.artifact.builder.TestArtifactDescriptor 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");
}
Also used : ArtifactPluginFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ArtifactPluginFileBuilder) ApplicationFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder) TestArtifactDescriptor(org.mule.runtime.module.artifact.builder.TestArtifactDescriptor) CompilerUtils(org.mule.tck.util.CompilerUtils) FileUtils.writeStringToFile(org.apache.commons.io.FileUtils.writeStringToFile) File(java.io.File) FileUtils.copyFile(org.apache.commons.io.FileUtils.copyFile) SingleClassCompiler(org.mule.tck.util.CompilerUtils.SingleClassCompiler) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 TestArtifactDescriptor (org.mule.runtime.module.artifact.builder.TestArtifactDescriptor)6 ApplicationFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder)6 ArtifactPluginFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.ArtifactPluginFileBuilder)6 File (java.io.File)2 FileUtils.copyFile (org.apache.commons.io.FileUtils.copyFile)2 FileUtils.writeStringToFile (org.apache.commons.io.FileUtils.writeStringToFile)2 JarFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder)2 MuleException (org.mule.runtime.api.exception.MuleException)1 MuleFatalException (org.mule.runtime.api.exception.MuleFatalException)1 CompilerUtils (org.mule.tck.util.CompilerUtils)1 SingleClassCompiler (org.mule.tck.util.CompilerUtils.SingleClassCompiler)1