Search in sources :

Example 6 with ClassLoaderModelBuilder

use of org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder 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 7 with ClassLoaderModelBuilder

use of org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder 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 8 with ClassLoaderModelBuilder

use of org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder 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 9 with ClassLoaderModelBuilder

use of org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder 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)

Example 10 with ClassLoaderModelBuilder

use of org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder in project mule by mulesoft.

the class BundlePluginDependenciesResolverTestCase method resolvesDependenciesTwoVersionWhenLatestComesFromTransitiveMinor.

@Test
public void resolvesDependenciesTwoVersionWhenLatestComesFromTransitiveMinor() throws Exception {
    final List<ArtifactPluginDescriptor> pluginDescriptors = createPluginDescriptors(fooPlugin, latestEchoPlugin, bazPlugin);
    latestEchoPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(BAZ_PLUGIN_DESCRIPTOR)).build());
    fooPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(ECHO_PLUGIN_DESCRIPTOR)).build());
    echoPlugin.setClassLoaderModel(new ClassLoaderModelBuilder().dependingOn(singleton(LATEST_BAZ_PLUGIN_DESCRIPTOR)).build());
    final List<ArtifactPluginDescriptor> resolvedPluginDescriptors = dependenciesResolver.resolve(emptySet(), pluginDescriptors);
    assertResolvedPlugins(resolvedPluginDescriptors, bazPlugin, latestEchoPlugin, fooPlugin);
}
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

ClassLoaderModelBuilder (org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel.ClassLoaderModelBuilder)16 Test (org.junit.Test)15 ArtifactPluginDescriptor (org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor)15 List (java.util.List)2 Optional (java.util.Optional)2 BundleDescriptor (org.mule.runtime.module.artifact.api.descriptor.BundleDescriptor)2 File (java.io.File)1 String.format (java.lang.String.format)1 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Set (java.util.Set)1 StringUtils.isEmpty (org.apache.commons.lang3.StringUtils.isEmpty)1 Build (org.apache.maven.model.Build)1 Model (org.apache.maven.model.Model)1 Plugin (org.apache.maven.model.Plugin)1 Xpp3Dom (org.codehaus.plexus.util.xml.Xpp3Dom)1 LocalRepositorySupplierFactory (org.mule.maven.client.api.LocalRepositorySupplierFactory)1