Search in sources :

Example 6 with XmlExtensionModelLoader

use of org.mule.runtime.extension.api.loader.xml.XmlExtensionModelLoader in project mule by mulesoft.

the class DetectCyclesTestCase method getExtensionModelFrom.

private ExtensionModel getExtensionModelFrom(String modulePath, String... offendingOperations) {
    exception.expectMessage(format(XmlExtensionLoaderDelegate.CYCLIC_OPERATIONS_ERROR, new TreeSet(new HashSet<>(Arrays.asList(offendingOperations))).toString()));
    Map<String, Object> parameters = new HashMap<>();
    parameters.put(RESOURCE_XML, modulePath);
    parameters.put(VALIDATE_XML, validateXml);
    return new XmlExtensionModelLoader().loadExtensionModel(getClass().getClassLoader(), getDefault(emptySet()), parameters);
}
Also used : HashMap(java.util.HashMap) TreeSet(java.util.TreeSet) XmlExtensionModelLoader(org.mule.runtime.extension.api.loader.xml.XmlExtensionModelLoader) HashSet(java.util.HashSet)

Aggregations

HashMap (java.util.HashMap)6 XmlExtensionModelLoader (org.mule.runtime.extension.api.loader.xml.XmlExtensionModelLoader)6 HashSet (java.util.HashSet)2 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)2 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 MuleArtifactFunctionalTestCase (org.mule.functional.junit4.MuleArtifactFunctionalTestCase)1 DslResolvingContext (org.mule.runtime.api.dsl.DslResolvingContext)1 DslResolvingContext.getDefault (org.mule.runtime.api.dsl.DslResolvingContext.getDefault)1 MuleContext (org.mule.runtime.core.api.MuleContext)1 ConfigurationBuilder (org.mule.runtime.core.api.config.ConfigurationBuilder)1 AbstractConfigurationBuilder (org.mule.runtime.core.api.config.builders.AbstractConfigurationBuilder)1 ExtensionManager (org.mule.runtime.core.api.extension.ExtensionManager)1 LifecycleUtils.initialiseIfNeeded (org.mule.runtime.core.api.lifecycle.LifecycleUtils.initialiseIfNeeded)1 XmlExtensionLoaderDelegate (org.mule.runtime.extension.internal.loader.XmlExtensionLoaderDelegate)1