Search in sources :

Example 1 with DefaultMuleConfiguration

use of org.mule.runtime.core.api.config.DefaultMuleConfiguration in project mule by mulesoft.

the class ApplicationMuleContextBuilder method createMuleConfiguration.

@Override
protected DefaultMuleConfiguration createMuleConfiguration() {
    final DefaultMuleConfiguration configuration = new DefaultMuleConfiguration(true);
    initializeFromProperties(configuration);
    configuration.setId(appName);
    final String encoding = defaultEncoding;
    if (!isBlank(encoding)) {
        configuration.setDefaultEncoding(encoding);
    }
    return configuration;
}
Also used : DefaultMuleConfiguration(org.mule.runtime.core.api.config.DefaultMuleConfiguration)

Example 2 with DefaultMuleConfiguration

use of org.mule.runtime.core.api.config.DefaultMuleConfiguration in project mule by mulesoft.

the class FlowProcessingStrategyTestCase method processingStrategySetBySystemPropertyOverridesDefault.

@Test
public void processingStrategySetBySystemPropertyOverridesDefault() throws Exception {
    testWithSystemProperty(ProcessingStrategyFactory.class.getName(), TestProcessingStrategyFactory.class.getName(), () -> {
        MuleConfiguration muleConfiguration = new DefaultMuleConfiguration();
        when(muleContext.getConfiguration()).thenReturn(muleConfiguration);
        createFlow(null);
        assertEquals(flow.getProcessingStrategy().getClass(), TestProcessingStrategy.class);
    });
}
Also used : DefaultMuleConfiguration(org.mule.runtime.core.api.config.DefaultMuleConfiguration) MuleConfiguration(org.mule.runtime.core.api.config.MuleConfiguration) DefaultMuleConfiguration(org.mule.runtime.core.api.config.DefaultMuleConfiguration) ProcessingStrategyFactory(org.mule.runtime.core.api.processor.strategy.ProcessingStrategyFactory) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 3 with DefaultMuleConfiguration

use of org.mule.runtime.core.api.config.DefaultMuleConfiguration in project mule by mulesoft.

the class PipelineMessageNotificationTestCase method createMocks.

@Before
public void createMocks() throws Exception {
    muleContext.dispose();
    muleContext = mockContextWithServices();
    when(muleContext.getStatistics()).thenReturn(new AllStatistics());
    when(muleContext.getConfiguration()).thenReturn(new DefaultMuleConfiguration());
    notificationFirer = ((MuleContextWithRegistries) muleContext).getRegistry().lookupObject(NotificationDispatcher.class);
    when(muleContext.getDefaultErrorHandler(empty())).thenReturn(new ErrorHandlerFactory().createDefault(notificationFirer));
    mockErrorTypeLocator();
    when(muleContext.getTransformationService()).thenReturn(new ExtendedTransformationService(muleContext));
}
Also used : ExtendedTransformationService(org.mule.runtime.core.privileged.transformer.ExtendedTransformationService) AllStatistics(org.mule.runtime.core.api.management.stats.AllStatistics) DefaultMuleConfiguration(org.mule.runtime.core.api.config.DefaultMuleConfiguration) MuleContextWithRegistries(org.mule.runtime.core.internal.context.MuleContextWithRegistries) NotificationDispatcher(org.mule.runtime.api.notification.NotificationDispatcher) ErrorHandlerFactory(org.mule.runtime.core.internal.exception.ErrorHandlerFactory) Before(org.junit.Before)

Example 4 with DefaultMuleConfiguration

use of org.mule.runtime.core.api.config.DefaultMuleConfiguration in project mule by mulesoft.

the class LocalTxQueueTransactionRecovererTestCase method configureMuleContext.

@Override
protected void configureMuleContext(MuleContextBuilder contextBuilder) {
    DefaultMuleConfiguration muleConfiguration = new DefaultMuleConfiguration();
    muleConfiguration.setWorkingDirectory(temporaryFolder.getRoot().getAbsolutePath());
    contextBuilder.setMuleConfiguration(muleConfiguration);
}
Also used : DefaultMuleConfiguration(org.mule.runtime.core.api.config.DefaultMuleConfiguration)

Example 5 with DefaultMuleConfiguration

use of org.mule.runtime.core.api.config.DefaultMuleConfiguration in project mule by mulesoft.

the class DomainMuleContextBuilder method getMuleConfiguration.

@Override
protected MuleConfiguration getMuleConfiguration() {
    DefaultMuleConfiguration defaultMuleConfiguration = new DefaultMuleConfiguration(true);
    defaultMuleConfiguration.setDomainId(domainId);
    defaultMuleConfiguration.setId(domainId);
    return defaultMuleConfiguration;
}
Also used : DefaultMuleConfiguration(org.mule.runtime.core.api.config.DefaultMuleConfiguration)

Aggregations

DefaultMuleConfiguration (org.mule.runtime.core.api.config.DefaultMuleConfiguration)11 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 MuleContext (org.mule.runtime.core.api.MuleContext)2 ConfigurationBuilder (org.mule.runtime.core.api.config.ConfigurationBuilder)2 ConfigurationException (org.mule.runtime.core.api.config.ConfigurationException)2 MuleConfiguration (org.mule.runtime.core.api.config.MuleConfiguration)2 SimpleConfigurationBuilder (org.mule.runtime.core.api.config.builders.SimpleConfigurationBuilder)2 DefaultMuleContextFactory (org.mule.runtime.core.api.context.DefaultMuleContextFactory)2 MuleContextBuilder (org.mule.runtime.core.api.context.MuleContextBuilder)2 File (java.io.File)1 Arrays.asList (java.util.Arrays.asList)1 Collections (java.util.Collections)1 Collections.emptyList (java.util.Collections.emptyList)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Optional.empty (java.util.Optional.empty)1