Search in sources :

Example 1 with TestServicesConfigurationBuilder

use of org.mule.tck.config.TestServicesConfigurationBuilder in project mule by mulesoft.

the class ArtifactContextBuilderTestCase method emptyBuilder.

@Test
public void emptyBuilder() throws Exception {
    MuleContext muleContext = newBuilder(new TestServicesConfigurationBuilder()).setExecutionClassloader(currentThread().getContextClassLoader()).setClassLoaderRepository(mock(ClassLoaderRepository.class)).build().getMuleContext();
    assertThat(muleContext, notNullValue());
    assertThat(muleContext.isInitialised(), is(true));
    muleContext.start();
    assertThat(muleContext.isStarted(), is(true));
}
Also used : MuleContext(org.mule.runtime.core.api.MuleContext) ClassLoaderRepository(org.mule.runtime.module.artifact.api.classloader.ClassLoaderRepository) TestServicesConfigurationBuilder(org.mule.tck.config.TestServicesConfigurationBuilder) Test(org.junit.Test)

Example 2 with TestServicesConfigurationBuilder

use of org.mule.tck.config.TestServicesConfigurationBuilder 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)

Aggregations

Test (org.junit.Test)2 TestServicesConfigurationBuilder (org.mule.tck.config.TestServicesConfigurationBuilder)2 TransactionManager (javax.transaction.TransactionManager)1 TransactionManagerFactoryBean (org.mule.runtime.config.internal.factories.TransactionManagerFactoryBean)1 MuleContext (org.mule.runtime.core.api.MuleContext)1 DefaultMuleContextFactory (org.mule.runtime.core.api.context.DefaultMuleContextFactory)1 DefaultsConfigurationBuilder (org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder)1 DefaultMuleContext (org.mule.runtime.core.internal.context.DefaultMuleContext)1 ClassLoaderRepository (org.mule.runtime.module.artifact.api.classloader.ClassLoaderRepository)1 TestTransactionManagerFactory (org.mule.tck.testmodels.mule.TestTransactionManagerFactory)1