use of org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder in project mule by mulesoft.
the class DeployableArtifactDescriptorFactoryTestCase method duplicatesInConfigsAreRemoved.
@Test
public void duplicatesInConfigsAreRemoved() throws Exception {
DeployableFileBuilder artifactFileBuilder = createArtifactFileBuilder().deployedWith("config.resources", "config1.xml,config2.xml,config1.xml");
unzip(artifactFileBuilder.getArtifactFile(), getArtifactFolder());
D desc = createArtifactDescriptor();
assertThat(desc.getConfigResources(), hasSize(2));
assertThat(desc.getConfigResources(), hasItems("config1.xml", "config2.xml"));
}
use of org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder in project mule by mulesoft.
the class DeployableArtifactDescriptorFactoryTestCase method makesConfigFileRelativeToArtifactMuleFolder.
@Test
public void makesConfigFileRelativeToArtifactMuleFolder() throws Exception {
DeployableFileBuilder artifactFileBuilder = createArtifactFileBuilder().deployedWith("config.resources", "config1.xml,config2.xml");
unzip(artifactFileBuilder.getArtifactFile(), getArtifactFolder());
D desc = createArtifactDescriptor();
assertThat(desc.getConfigResources(), hasSize(2));
assertThat(desc.getConfigResources(), hasItems("config1.xml", "config2.xml"));
}
use of org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder in project mule by mulesoft.
the class DeployableArtifactDescriptorFactoryTestCase method readsSharedLibs.
@Test
public void readsSharedLibs() throws Exception {
DeployableFileBuilder artifactFileBuilder = (DeployableFileBuilder) createArtifactFileBuilder().dependingOnSharedLibrary(new JarFileBuilder("shared", echoTestJarFile));
unzip(artifactFileBuilder.getArtifactFile(), getArtifactFolder());
D desc = createArtifactDescriptor();
assertThat(desc.getClassLoaderModel().getUrls().length, equalTo(2));
assertThat(toFile(desc.getClassLoaderModel().getUrls()[0]).getPath(), equalTo(getArtifactFolder().toString()));
assertThat(toFile(desc.getClassLoaderModel().getUrls()[1]).getPath(), endsWith(getArtifactRootFolder() + "test/repository/org/mule/test/shared/1.0.0/shared-1.0.0.jar"));
assertThat(desc.getClassLoaderModel().getExportedPackages(), contains("org.foo"));
assertThat(desc.getClassLoaderModel().getExportedResources(), containsInAnyOrder("META-INF/MANIFEST.MF", "README.txt"));
}
use of org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder in project mule by mulesoft.
the class DeployableArtifactDescriptorFactoryTestCase method readsRuntimeLibs.
@Test
public void readsRuntimeLibs() throws Exception {
DeployableFileBuilder artifactFileBuilder = (DeployableFileBuilder) createArtifactFileBuilder().dependingOn(new JarFileBuilder("runtime", echoTestJarFile));
unzip(artifactFileBuilder.getArtifactFile(), getArtifactFolder());
D desc = createArtifactDescriptor();
assertThat(desc.getClassLoaderModel().getUrls().length, equalTo(2));
assertThat(toFile(desc.getClassLoaderModel().getUrls()[0]).getPath(), equalTo(getArtifactFolder().toString()));
assertThat(desc.getClassLoaderModel().getExportedPackages(), is(empty()));
assertThat(toFile(desc.getClassLoaderModel().getUrls()[1]).getPath(), endsWith(getArtifactRootFolder() + "test/repository/org/mule/test/runtime/1.0.0/runtime-1.0.0.jar"));
}
Aggregations