use of org.mule.runtime.core.api.config.builders.AbstractConfigurationBuilder in project mule by mulesoft.
the class ConvertersNotRegisteredTwiceTestCase method addBuilders.
@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
super.addBuilders(builders);
builders.add(0, new AbstractConfigurationBuilder() {
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
registryHelper = (MuleRegistryHelper) ((MuleContextWithRegistries) muleContext).getRegistry();
registryHelper = spy(registryHelper);
((DefaultMuleContext) muleContext).setMuleRegistry(registryHelper);
}
});
}
use of org.mule.runtime.core.api.config.builders.AbstractConfigurationBuilder in project mule by mulesoft.
the class AbstractXmlExtensionMuleArtifactFunctionalTestCase method addBuilders.
@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
super.addBuilders(builders);
builders.add(new AbstractConfigurationBuilder() {
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
ExtensionManager extensionManager;
if (muleContext.getExtensionManager() == null) {
extensionManager = createDefaultExtensionManager();
muleContext.setExtensionManager(extensionManager);
initialiseIfNeeded(extensionManager, muleContext);
}
extensionManager = muleContext.getExtensionManager();
registerXmlExtensions(extensionManager);
}
private void registerXmlExtensions(ExtensionManager extensionManager) {
// take all the plugins loaded by org.mule.test.runner.api.IsolatedClassLoaderExtensionsManagerConfigurationBuilder in the extension manager
final Set<ExtensionModel> extensions = new HashSet<>(extensionManager.getExtensions());
for (String modulePath : getModulePaths()) {
Map<String, Object> params = new HashMap<>();
params.put(XmlExtensionModelLoader.RESOURCE_XML, modulePath);
params.put(XmlExtensionModelLoader.VALIDATE_XML, shouldValidateXml());
operationsOutputPath().ifPresent(path -> params.put(XmlExtensionModelLoader.RESOURCE_DECLARATION, path));
final DslResolvingContext dslResolvingContext = getDefault(extensions);
final ExtensionModel extensionModel = new XmlExtensionModelLoader().loadExtensionModel(getClass().getClassLoader(), dslResolvingContext, params);
extensions.add(extensionModel);
}
for (ExtensionModel extension : extensions) {
extensionManager.registerExtension(extension);
}
}
});
}
use of org.mule.runtime.core.api.config.builders.AbstractConfigurationBuilder in project mule by mulesoft.
the class ExtensionFunctionalTestCase method addBuilders.
/**
* Adds a {@link ConfigurationBuilder} that sets the {@link #extensionManager} into the {@link #muleContext}. This
* {@link ConfigurationBuilder} is set as the first element of the {@code builders} {@link List}
*
* @param builders the list of {@link ConfigurationBuilder}s that will be used to initialise the {@link #muleContext}
*/
@Override
protected // TODO - MULE-11119: Make final again once we can add the HTTP service injection as the scehduler's is
void addBuilders(List<ConfigurationBuilder> builders) {
super.addBuilders(builders);
builders.add(0, new AbstractConfigurationBuilder() {
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
createExtensionsManager(muleContext);
}
});
}
use of org.mule.runtime.core.api.config.builders.AbstractConfigurationBuilder in project mule by mulesoft.
the class ConfigurationInjectionLifecycleTestCase method addBuilders.
@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
builders.add(new AbstractConfigurationBuilder() {
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
muleContext.getCustomizationService().registerCustomServiceClass("lifecycleTracker", LifecycleTracker.class);
}
});
super.addBuilders(builders);
}
Aggregations