use of org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder in project mule by mulesoft.
the class MuleContextLifecycleTestCase method initialiseOnStarted.
@Test(expected = IllegalStateException.class)
public void initialiseOnStarted() throws Exception {
ctx.initialise();
new DefaultsConfigurationBuilder().configure(ctx);
ctx.start();
// Attempt to initialise once started should fail!
ctx.initialise();
}
use of org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder in project mule by mulesoft.
the class MuleContextLifecycleTestCase method startOnStarted.
@Test(expected = IllegalStateException.class)
public void startOnStarted() throws Exception {
ctx.initialise();
assertTrue("onInitialization never called on listener", callbackListener.wasInitialized);
new DefaultsConfigurationBuilder().configure(ctx);
TestNotificationListener notificationListener = new TestNotificationListener();
notificationListenerRegistry.registerListener(notificationListener);
ctx.start();
assertTrue("CONTEXT_STARTING notification never fired", notificationListener.startingNotificationFired);
assertTrue("CONTEXT_STARTED notification never fired", notificationListener.startedNotificationFired);
assertTrue("onStart never called on listener", callbackListener.wasStarted);
// Can't call twice
ctx.start();
}
use of org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder in project mule by mulesoft.
the class MuleContextLifecycleTestCase method initialiseOnStopped.
@Test(expected = IllegalStateException.class)
public void initialiseOnStopped() throws Exception {
ctx.initialise();
new DefaultsConfigurationBuilder().configure(ctx);
ctx.start();
ctx.stop();
// Attempt to initialise once stopped should fail!
ctx.initialise();
}
use of org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder in project mule by mulesoft.
the class AbstractBenchmark method createMuleContextWithServices.
protected MuleContext createMuleContextWithServices() throws MuleException {
MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
List<ConfigurationBuilder> builderList = new ArrayList<>();
builderList.add(new BasicRuntimeServicesConfigurationBuilder());
builderList.add(new DefaultsConfigurationBuilder());
return muleContextFactory.createMuleContext(builderList.toArray(new ConfigurationBuilder[] {}));
}
use of org.mule.runtime.core.internal.config.builders.DefaultsConfigurationBuilder 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())));
}
Aggregations