Search in sources :

Example 1 with DeployableFileBuilder

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"));
}
Also used : DeployableFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder) Test(org.junit.Test)

Example 2 with DeployableFileBuilder

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"));
}
Also used : DeployableFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder) Test(org.junit.Test)

Example 3 with DeployableFileBuilder

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"));
}
Also used : JarFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder) DeployableFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder) Test(org.junit.Test)

Example 4 with DeployableFileBuilder

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"));
}
Also used : JarFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder) DeployableFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 DeployableFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.DeployableFileBuilder)4 JarFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder)2