Search in sources :

Example 6 with DefaultMuleContextFactory

use of org.mule.runtime.core.api.context.DefaultMuleContextFactory in project mule by mulesoft.

the class OptionalObjectsIgnoredTestCase method before.

@Before
public void before() throws Exception {
    muleContext = (MuleContextWithRegistries) new DefaultMuleContextFactory().createMuleContext(testServicesConfigurationBuilder, new SpringXmlConfigurationBuilder(new String[0], emptyMap()));
    muleContext.start();
    muleContext.getRegistry().lookupByType(Calendar.class);
}
Also used : DefaultMuleContextFactory(org.mule.runtime.core.api.context.DefaultMuleContextFactory) SpringXmlConfigurationBuilder(org.mule.runtime.config.internal.SpringXmlConfigurationBuilder) Before(org.junit.Before)

Example 7 with DefaultMuleContextFactory

use of org.mule.runtime.core.api.context.DefaultMuleContextFactory in project mule by mulesoft.

the class TransactionManagerFactoryBeanTestCase method registerTransactionManager.

@Test
public void registerTransactionManager() throws Exception {
    DefaultMuleContext context = (DefaultMuleContext) new DefaultMuleContextFactory().createMuleContext(new TestServicesConfigurationBuilder(), new DefaultsConfigurationBuilder());
    TransactionManagerFactoryBean txMgrFB = new TransactionManagerFactoryBean();
    txMgrFB.setMuleContext(context);
    txMgrFB.setTxManagerFactory(new TestTransactionManagerFactory());
    TransactionManager transactionManager = txMgrFB.getObject();
    assertThat(transactionManager, not(is(IsNull.nullValue())));
}
Also used : DefaultMuleContextFactory(org.mule.runtime.core.api.context.DefaultMuleContextFactory) DefaultMuleContext(org.mule.runtime.core.internal.context.DefaultMuleContext) TransactionManagerFactoryBean(org.mule.runtime.config.internal.factories.TransactionManagerFactoryBean) TransactionManager(javax.transaction.TransactionManager) DefaultsConfigurationBuilder(org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder) TestServicesConfigurationBuilder(org.mule.tck.config.TestServicesConfigurationBuilder) TestTransactionManagerFactory(org.mule.tck.testmodels.mule.TestTransactionManagerFactory) Test(org.junit.Test)

Example 8 with DefaultMuleContextFactory

use of org.mule.runtime.core.api.context.DefaultMuleContextFactory in project mule by mulesoft.

the class ApplicationContextBuilder method doBuildContext.

protected MuleContext doBuildContext() throws Exception {
    MuleContext context;
    MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
    List<ConfigurationBuilder> builders = new ArrayList<>();
    builders.add(getAppBuilder(this.applicationResources));
    addBuilders(builders);
    configureMuleContext(muleContextBuilder);
    context = muleContextFactory.createMuleContext(builders, muleContextBuilder);
    return context;
}
Also used : MuleContext(org.mule.runtime.core.api.MuleContext) DefaultMuleContextFactory(org.mule.runtime.core.api.context.DefaultMuleContextFactory) SpringXmlConfigurationBuilderFactory.createConfigurationBuilder(org.mule.runtime.config.api.SpringXmlConfigurationBuilderFactory.createConfigurationBuilder) ConfigurationBuilder(org.mule.runtime.core.api.config.ConfigurationBuilder) MuleContextFactory(org.mule.runtime.core.api.context.MuleContextFactory) DefaultMuleContextFactory(org.mule.runtime.core.api.context.DefaultMuleContextFactory) ArrayList(java.util.ArrayList)

Aggregations

DefaultMuleContextFactory (org.mule.runtime.core.api.context.DefaultMuleContextFactory)8 ArrayList (java.util.ArrayList)5 ConfigurationBuilder (org.mule.runtime.core.api.config.ConfigurationBuilder)5 MuleContext (org.mule.runtime.core.api.MuleContext)4 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 SpringXmlConfigurationBuilderFactory.createConfigurationBuilder (org.mule.runtime.config.api.SpringXmlConfigurationBuilderFactory.createConfigurationBuilder)2 DefaultMuleConfiguration (org.mule.runtime.core.api.config.DefaultMuleConfiguration)2 SimpleConfigurationBuilder (org.mule.runtime.core.api.config.builders.SimpleConfigurationBuilder)2 MuleContextFactory (org.mule.runtime.core.api.context.MuleContextFactory)2 DefaultsConfigurationBuilder (org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder)2 TestServicesConfigurationBuilder (org.mule.tck.config.TestServicesConfigurationBuilder)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 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1