Search in sources :

Example 6 with DefaultMuleContext

use of org.mule.runtime.core.internal.context.DefaultMuleContext 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 7 with DefaultMuleContext

use of org.mule.runtime.core.internal.context.DefaultMuleContext in project mule by mulesoft.

the class MuleTestUtils method spyInjector.

public static Injector spyInjector(MuleContext muleContext) {
    Injector spy = spy(muleContext.getInjector());
    ((DefaultMuleContext) muleContext).setInjector(spy);
    return spy;
}
Also used : DefaultMuleContext(org.mule.runtime.core.internal.context.DefaultMuleContext) Injector(org.mule.runtime.core.api.Injector)

Aggregations

DefaultMuleContext (org.mule.runtime.core.internal.context.DefaultMuleContext)7 Properties (java.util.Properties)1 TransactionManager (javax.transaction.TransactionManager)1 Test (org.junit.Test)1 ErrorTypeRepository (org.mule.runtime.api.exception.ErrorTypeRepository)1 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)1 TransactionManagerFactoryBean (org.mule.runtime.config.internal.factories.TransactionManagerFactoryBean)1 Injector (org.mule.runtime.core.api.Injector)1 MuleContext (org.mule.runtime.core.api.MuleContext)1 MuleConfiguration (org.mule.runtime.core.api.config.MuleConfiguration)1 BootstrapServiceDiscoverer (org.mule.runtime.core.api.config.bootstrap.BootstrapServiceDiscoverer)1 AbstractConfigurationBuilder (org.mule.runtime.core.api.config.builders.AbstractConfigurationBuilder)1 DefaultMuleContextFactory (org.mule.runtime.core.api.context.DefaultMuleContextFactory)1 DefaultQueueConfiguration (org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration)1 DefaultsConfigurationBuilder (org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder)1 SchedulerController (org.mule.runtime.core.internal.connector.SchedulerController)1 ErrorTypeLocatorFactory.createDefaultErrorTypeLocator (org.mule.runtime.core.internal.exception.ErrorTypeLocatorFactory.createDefaultErrorTypeLocator)1 ErrorTypeRepositoryFactory.createDefaultErrorTypeRepository (org.mule.runtime.core.internal.exception.ErrorTypeRepositoryFactory.createDefaultErrorTypeRepository)1 MuleLifecycleInterceptor (org.mule.runtime.core.internal.lifecycle.MuleLifecycleInterceptor)1 DefaultRegistryBroker (org.mule.runtime.core.internal.registry.DefaultRegistryBroker)1