use of org.mule.runtime.module.artifact.builder.TestArtifactDescriptor in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysApplicationWithPrivilegedPluginDependingOnPlugin.
@Test
public void deploysApplicationWithPrivilegedPluginDependingOnPlugin() throws Exception {
ArtifactPluginFileBuilder echoPlugin = new ArtifactPluginFileBuilder("echoPlugin").configuredWith(PRIVILEGED_EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo").configuredWith(PRIVILEGED_ARTIFACTS_PROPERTY, "org.mule.test:dependantPlugin").dependingOn(new JarFileBuilder("echoTestJar", echoTestJarFile));
ArtifactPluginFileBuilder dependantPlugin = new ArtifactPluginFileBuilder("dependantPlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.echo").containingClass(pluginEcho3TestClassFile, "org/foo/echo/Plugin3Echo.class").dependingOn(echoPlugin);
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("plugin-depending-on-plugin-app").definedBy("plugin-depending-on-plugin-app-config.xml").dependingOn(dependantPlugin);
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, artifactFileBuilder.getId());
executeApplicationFlow("main");
}
use of org.mule.runtime.module.artifact.builder.TestArtifactDescriptor in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysApplicationWithPluginDependingOnPlugin.
@Test
public void deploysApplicationWithPluginDependingOnPlugin() throws Exception {
ArtifactPluginFileBuilder dependantPlugin = new ArtifactPluginFileBuilder("dependantPlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.echo").containingClass(pluginEcho3TestClassFile, "org/foo/echo/Plugin3Echo.class").dependingOn(echoPlugin);
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("plugin-depending-on-plugin-app").definedBy("plugin-depending-on-plugin-app-config.xml").dependingOn(dependantPlugin);
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, artifactFileBuilder.getId());
executeApplicationFlow("main");
}
use of org.mule.runtime.module.artifact.builder.TestArtifactDescriptor in project mule by mulesoft.
the class ApplicationDeploymentTestCase method failsToDeployApplicationWithPluginDependantOnPluginNotShipped.
@Test
public void failsToDeployApplicationWithPluginDependantOnPluginNotShipped() throws Exception {
ArtifactPluginFileBuilder dependantPlugin = new ArtifactPluginFileBuilder("dependantPlugin").dependingOn(echoPlugin);
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("plugin-depending-on-plugin-app").definedBy("plugin-depending-on-plugin-app-config.xml").dependingOn(dependantPlugin);
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentFailure(applicationDeploymentListener, artifactFileBuilder.getId(), times(1));
}
use of org.mule.runtime.module.artifact.builder.TestArtifactDescriptor in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysLightApplicationWithPluginDependingOnPlugin.
@Test
public void deploysLightApplicationWithPluginDependingOnPlugin() throws Exception {
ArtifactPluginFileBuilder dependantPlugin = new ArtifactPluginFileBuilder("dependantPlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.echo").containingClass(pluginEcho3TestClassFile, "org/foo/echo/Plugin3Echo.class").dependingOn(echoPlugin);
File mavenRepoFolder = Paths.get(getMuleBaseFolder().getAbsolutePath(), "repository").toFile();
File testGroupIdRepoFolder = Paths.get(mavenRepoFolder.getAbsolutePath(), "org", "mule", "test").toFile();
JarFileBuilder testJarFileDependency = new JarFileBuilder("echoTestJar", echoTestJarFile);
copyFile(testJarFileDependency.getArtifactPomFile(), Paths.get(testGroupIdRepoFolder.getAbsolutePath(), "echoTestJar", "1.0.0", "echoTestJar-1.0.0.pom").toFile());
copyFile(testJarFileDependency.getArtifactFile(), Paths.get(testGroupIdRepoFolder.getAbsolutePath(), "echoTestJar", "1.0.0", "echoTestJar-1.0.0.jar").toFile());
copyFile(echoPlugin.getArtifactPomFile(), Paths.get(testGroupIdRepoFolder.getAbsolutePath(), "echoPlugin", "1.0.0", "echoPlugin-1.0.0.pom").toFile());
copyFile(echoPlugin.getArtifactFile(), Paths.get(testGroupIdRepoFolder.getAbsolutePath(), "echoPlugin", "1.0.0", "echoPlugin-1.0.0-mule-plugin.jar").toFile());
copyFile(dependantPlugin.getArtifactPomFile(), Paths.get(testGroupIdRepoFolder.getAbsolutePath(), "dependantPlugin", "1.0.0", "dependantPlugin-1.0.0.pom").toFile());
copyFile(dependantPlugin.getArtifactFile(), Paths.get(testGroupIdRepoFolder.getAbsolutePath(), "dependantPlugin", "1.0.0", "dependantPlugin-1.0.0-mule-plugin.jar").toFile());
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("plugin-depending-on-plugin-app").definedBy("plugin-depending-on-plugin-app-config.xml").dependingOn(dependantPlugin).usingLightWeightPackage();
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, artifactFileBuilder.getId());
executeApplicationFlow("main");
}
use of org.mule.runtime.module.artifact.builder.TestArtifactDescriptor in project mule by mulesoft.
the class ApplicationDeploymentTestCase method failsToDeployApplicationWithMissingPluginDependencyOnPlugin.
@Test
public void failsToDeployApplicationWithMissingPluginDependencyOnPlugin() throws Exception {
ArtifactPluginFileBuilder dependantPlugin = new ArtifactPluginFileBuilder("dependantPlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.foo.echo").containingClass(pluginEcho3TestClassFile, "org/foo/echo/Plugin3Echo.class");
final TestArtifactDescriptor artifactFileBuilder = new ApplicationFileBuilder("plugin-depending-on-plugin-app").definedBy("plugin-depending-on-plugin-app-config.xml").dependingOn(dependantPlugin);
addPackedAppFromBuilder(artifactFileBuilder);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, artifactFileBuilder.getId());
try {
executeApplicationFlow("main");
fail("Expected to fail as there should be a missing class");
} catch (Exception e) {
assertThat(e.getCause().getCause(), instanceOf(MuleFatalException.class));
assertThat(e.getCause().getCause().getCause(), instanceOf(NoClassDefFoundError.class));
assertThat(e.getCause().getCause().getCause().getMessage(), containsString("org/foo/EchoTest"));
}
}
Aggregations