Search in sources :

Example 6 with ArtifactPluginDescriptor

use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.

the class BundlePluginDependenciesResolverTestCase method sanitizesDependantPluginExportedPackages.

@Test
public void sanitizesDependantPluginExportedPackages() throws Exception {
    fooPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().exportingPackages(getFooExportedPackages()).build());
    barPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(FOO_PLUGIN_DESCRIPTOR)).exportingPackages(getBarExportedPackages()).build());
    final List<ArtifactPluginDescriptor> pluginDescriptors = createPluginDescriptors(fooPlugin, barPlugin);
    final List<ArtifactPluginDescriptor> resolvedPluginDescriptors = dependenciesResolver.resolve(emptySet(), pluginDescriptors);
    assertResolvedPlugins(resolvedPluginDescriptors, fooPlugin, barPlugin);
    assertPluginExportedPackages(fooPlugin, "org.foo", "org.foo.mule");
    assertPluginExportedPackages(barPlugin, "org.bar", "org.baz", "org.bar.mule");
}
Also used : ArtifactPluginDescriptor(org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor) ClassLoaderModelBuilder(org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder) Test(org.junit.Test)

Example 7 with ArtifactPluginDescriptor

use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.

the class BundlePluginDependenciesResolverTestCase method resolvesSnapshotPluginDependencyWithCompatibleMinorVersion.

@Test
public void resolvesSnapshotPluginDependencyWithCompatibleMinorVersion() throws Exception {
    ArtifactPluginDescriptor updatedFooPlugin = new ArtifactPluginDescriptor(FOO_PLUGIN);
    updatedFooPlugin.setBundleDescriptor(createTestBundleDescriptor(FOO_PLUGIN, "1.1"));
    final List<ArtifactPluginDescriptor> pluginDescriptors = createPluginDescriptors(updatedFooPlugin, barPlugin);
    BundleDescriptor fooBundleDescriptor = createTestBundleDescriptor(FOO_PLUGIN, "1.0-SNAPSHOT");
    barPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(createBundleDependency(fooBundleDescriptor))).build());
    final List<ArtifactPluginDescriptor> resolvedPluginDescriptors = dependenciesResolver.resolve(emptySet(), pluginDescriptors);
    assertResolvedPlugins(resolvedPluginDescriptors, updatedFooPlugin, barPlugin);
}
Also used : BundleDescriptor(org.mule.runtime.module.artifact.api.descriptor.BundleDescriptor) ArtifactPluginDescriptor(org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor) ClassLoaderModelBuilder(org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder) Test(org.junit.Test)

Example 8 with ArtifactPluginDescriptor

use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.

the class BundlePluginDependenciesResolverTestCase method resolvesPluginDisorderedDependency.

@Test
public void resolvesPluginDisorderedDependency() throws Exception {
    final List<ArtifactPluginDescriptor> pluginDescriptors = createPluginDescriptors(barPlugin, fooPlugin);
    barPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(FOO_PLUGIN_DESCRIPTOR)).build());
    final List<ArtifactPluginDescriptor> resolvedPluginDescriptors = dependenciesResolver.resolve(emptySet(), pluginDescriptors);
    assertResolvedPlugins(resolvedPluginDescriptors, fooPlugin, barPlugin);
}
Also used : ArtifactPluginDescriptor(org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor) ClassLoaderModelBuilder(org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder) Test(org.junit.Test)

Example 9 with ArtifactPluginDescriptor

use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.

the class BundlePluginDependenciesResolverTestCase method resolvesMultipleDependencies.

@Test
public void resolvesMultipleDependencies() throws Exception {
    final List<ArtifactPluginDescriptor> pluginDescriptors = createPluginDescriptors(bazPlugin, barPlugin, fooPlugin);
    barPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(BAZ_PLUGIN_DESCRIPTOR)).build());
    bazPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(FOO_PLUGIN_DESCRIPTOR)).build());
    final List<ArtifactPluginDescriptor> resolvedPluginDescriptors = dependenciesResolver.resolve(emptySet(), pluginDescriptors);
    assertResolvedPlugins(resolvedPluginDescriptors, fooPlugin, bazPlugin, barPlugin);
}
Also used : ArtifactPluginDescriptor(org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor) ClassLoaderModelBuilder(org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder) Test(org.junit.Test)

Example 10 with ArtifactPluginDescriptor

use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.

the class BundlePluginDependenciesResolverTestCase method resolvesPluginOrderedDependency.

@Test
public void resolvesPluginOrderedDependency() throws Exception {
    final List<ArtifactPluginDescriptor> pluginDescriptors = createPluginDescriptors(fooPlugin, barPlugin);
    barPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(FOO_PLUGIN_DESCRIPTOR)).build());
    final List<ArtifactPluginDescriptor> resolvedPluginDescriptors = dependenciesResolver.resolve(emptySet(), pluginDescriptors);
    assertResolvedPlugins(resolvedPluginDescriptors, fooPlugin, barPlugin);
}
Also used : ArtifactPluginDescriptor(org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor) ClassLoaderModelBuilder(org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder) Test(org.junit.Test)

Aggregations

ArtifactPluginDescriptor (org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor)42 Test (org.junit.Test)24 ClassLoaderModelBuilder (org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder)15 ArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader)11 File (java.io.File)7 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 LookupStrategy (org.mule.runtime.module.artifact.api.classloader.LookupStrategy)6 BundleDependency (org.mule.runtime.module.artifact.api.descriptor.BundleDependency)6 ClassLoaderLookupPolicy (org.mule.runtime.module.artifact.api.classloader.ClassLoaderLookupPolicy)5 HashSet (java.util.HashSet)4 LinkedList (java.util.LinkedList)4 List (java.util.List)4 Optional (java.util.Optional)4 Domain (org.mule.runtime.deployment.model.api.domain.Domain)4 DomainDescriptor (org.mule.runtime.deployment.model.api.domain.DomainDescriptor)4 ArtifactPlugin (org.mule.runtime.deployment.model.api.plugin.ArtifactPlugin)4 ArtifactClassLoaderFilter (org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoaderFilter)4 Map (java.util.Map)3 Set (java.util.Set)3