Search in sources :

Example 1 with FileSystemPolicyClassLoaderModelLoader

use of org.mule.runtime.module.deployment.impl.internal.policy.FileSystemPolicyClassLoaderModelLoader in project mule by mulesoft.

the class ArtifactPluginDescriptorFactoryTestCase method setUp.

@Before
public void setUp() throws Exception {
    when(classLoaderFilterFactory.create(null, null)).thenReturn(NULL_CLASSLOADER_FILTER);
    when(descriptorLoaderRepository.get(MULE_LOADER_ID, PLUGIN, ClassLoaderModelLoader.class)).thenReturn(new PluginMavenClassLoaderModelLoader(mavenClientProvider.createMavenClient(newMavenConfigurationBuilder().localMavenRepositoryLocation(mavenClientProvider.getLocalRepositorySuppliers().environmentMavenRepositorySupplier().get()).build()), mavenClientProvider.getLocalRepositorySuppliers()));
    when(descriptorLoaderRepository.get(FILE_SYSTEM_POLICY_MODEL_LOADER_ID, PLUGIN, ClassLoaderModelLoader.class)).thenReturn(new FileSystemPolicyClassLoaderModelLoader());
    when(descriptorLoaderRepository.get(INVALID_LOADER_ID, PLUGIN, ClassLoaderModelLoader.class)).thenThrow(new LoaderNotFoundException(INVALID_LOADER_ID));
    when(descriptorLoaderRepository.get(PROPERTIES_BUNDLE_DESCRIPTOR_LOADER_ID, PLUGIN, BundleDescriptorLoader.class)).thenReturn(new PropertiesBundleDescriptorLoader());
    when(descriptorLoaderRepository.get(INVALID_LOADER_ID, PLUGIN, BundleDescriptorLoader.class)).thenThrow(new LoaderNotFoundException(INVALID_LOADER_ID));
    descriptorFactory = new ArtifactPluginDescriptorFactory(descriptorLoaderRepository, ArtifactDescriptorValidatorBuilder.builder());
}
Also used : PropertiesBundleDescriptorLoader(org.mule.runtime.module.deployment.impl.internal.policy.PropertiesBundleDescriptorLoader) FileSystemPolicyClassLoaderModelLoader(org.mule.runtime.module.deployment.impl.internal.policy.FileSystemPolicyClassLoaderModelLoader) LoaderNotFoundException(org.mule.runtime.module.artifact.api.descriptor.LoaderNotFoundException) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 LoaderNotFoundException (org.mule.runtime.module.artifact.api.descriptor.LoaderNotFoundException)1 FileSystemPolicyClassLoaderModelLoader (org.mule.runtime.module.deployment.impl.internal.policy.FileSystemPolicyClassLoaderModelLoader)1 PropertiesBundleDescriptorLoader (org.mule.runtime.module.deployment.impl.internal.policy.PropertiesBundleDescriptorLoader)1